<!-- BEGIN {$smarty.template} -->

{literal}
<script type="text/javascript">

function calcTimeDiff() {

    if (!document.forms["faddop"].elements["op_duration"].value)
        document.forms["faddop"].elements["op_duration"].value = getDateTimeDiff(document.forms["faddop"].elements["op_startdate"].value + ' ' + document.forms["faddop"].elements["op_starthours"].value,
                                                                                 document.forms["faddop"].elements["op_enddate"].value + ' ' + document.forms["faddop"].elements["op_endhours"].value);
}

</script>
{/literal}

<form action="service.php" method="post" name="faddop" id="faddop" onsubmit="submitTaskForm(this);return false;" autocomplete="off">
<input type="hidden" name="saction" id="saction" value="{$smarty.const.ACTION_SERVICE_ADDTASK}">
<input type="hidden" name="prj_id" id="prj_id" value="{$editprjInfo.prj_id}">

<div class="divbgwrapper">

<table id="addtasktab" cellspacing="0">

  <caption><em>{t}Project{/t}: <span id="frmprjtitle"></span></em>
    <a class="ptr" onclick="hideElement('editopdetails');"><img src="img/phpaga/close.png" alt="X" title="{t}Close{/t}"></a>
  </caption>

  <tr>
    <th colspan="4">{t}Add task{/t}</th>
  </tr>

  <tr>
    <td class="label">{t}Project member{/t}: </td>
    <td class="data" colspan="3">
      <select name="pe_id" id="sel_prjmembers">
        {html_options options=$select_person selected=$opInfo.pe_id}
      </select>
    </td>
  </tr>

  <tr>
    <td class="label">{t}Start date{/t}: </td>
    <td class="data">
      <input type="text" class="tinput format-y-m-d divider-dash no-transparency" id="op_startdate" name="op_startdate" value="{$opInfo.op_startdate|wash}" size="10" maxlength="10">
    </td>
    <td class="label">{t}time{/t}: </td>
    <td class="data"><input type="text" class="tinput" id="op_starthours" name="op_starthours" value="{$opInfo.op_starthours|wash}" size="5" maxlength="5"> <i>hh:mm</i><input type="button" value="{t}Now{/t}" onclick="setCurrentDateTime('op_startdate', 'op_starthours');"></td>
  </tr>

  <tr>
    <td class="label">{t}End date{/t}: </td>
    <td class="data">
      <input type="text" class="tinput format-y-m-d divider-dash no-transparency" id="op_enddate" name="op_enddate" value="{$opInfo.op_enddate|wash}" onfocus="if (!document.getElementById('op_enddate').value) document.getElementById('op_enddate').value = document.getElementById('op_startdate').value;" size="10" maxlength="10">
    </td>
    <td class="label">{t}time{/t}: </td>
    <td class="data"><input type="text" class="tinput" id="op_endhours" name="op_endhours" value="{$opInfo.op_endhours|wash}" size="5" maxlength="5"> <i>hh:mm</i><input type="button" value="{t}Now{/t}" onclick="setCurrentDateTime('op_enddate', 'op_endhours');"></td>
  </tr>

  <tr>
    <td class="label">{t}Category{/t}: </td>
    <td class="data">
      <select name="opcat_id" id="sel_opcat">
        {html_options options=$select_opcat selected=$opInfo.opcat_id}
      </select>
    </td>
    <td class="label">{t}Duration{/t}: </td>
    <td class="data"><input type="text" class="tinput" id="op_duration" name="op_duration" value="{$opInfo.op_duration|wash}" onfocus="calcTimeDiff();" size="6" maxlength="6"> <i>hh:mm</i></td>
  </tr>
  {if $editprjInfo.prj_billabletype != 10}
  <tr>
    <td class="label">{t}Billable{/t}: </td>
    <td class="data" colspan="3">
      <input type="checkbox" class="cbox" id="op_billabletype" name="op_billabletype" value="0" {if $opInfo.billable_checked}checked{/if}>
    </td>
  </tr>
  {/if}
  <tr>
    <td class="label"> {t}Description{/t}: </td>
    <td class="data" colspan="3">
      <textarea name="op_desc" id="op_desc" cols="50" rows="6" wrap="virtual">{$opInfo.op_desc|wash}</textarea>
    </td>
  </tr>
</table>

<div class="buttons">
  <input type="submit" name="submit" value="{t}Submit{/t}">
  <input type="button" name="cancel" value="{t}Cancel{/t}" onclick="hideElement('editopdetails');">
</div>
</div>

</form>

<!-- END {$smarty.template} -->
