{include file="$gentemplates/_header.tpl" pagetitle=$ptitle}
{include file="$gentemplates/_navi.tpl" pagetitle=$ptitle}

<form name="np" action="index.php" method="post">
<input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">
<input type="hidden" name="pid" value="{$td.pid}">
<input type="hidden" name="tid" value="{$td.task_id}">
<input type="hidden" name="obj" value="task">
<input type="hidden" name="action" value="{$action}">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.projectname}:</td>
    <td class="formhead">{$td.ptitle}</td>
  </tr>
  
  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.taskname}:</td>
    <td class="tab"><input type="text" name="taskname" size="40" maxlength="100" value="{$td.title|escape:"html"}"></td>
  </tr>
  
  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.assignedto}:</td>
    <td class="tab">{$users|smarty:nodefaults}</td>
  </tr>
  
  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.quotedhours}:</td>
    <td class="tab"><input type="text" name="hours" size="5" maxlength="10" value="{$td.hours}" {if $disabled.hours} readonly {/if}>
      &nbsp;&nbsp;<input type="checkbox" name="billable" {if $td.billable eq 1} checked="checked"{/if} {if $disabled.billable} readonly {/if}/> {$hashmap.billable}
    </td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.usedhours}:</td>
    <td class="tab"><input type="text" name="usedhours" size="5" maxlength="10" value="{$td.usedhours}" {if $disabled.usedhours} readonly {/if}></td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.subtaskof}:</td>
    <td class="tab">{$tasksel|smarty:nodefaults}</td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.constrain}:</td>
    <td class="tab">{$constasksel|smarty:nodefaults}</td>
  </tr>
  
  
  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.milestone}:</td>
    <td class="tab">
    <input type="checkbox" name="milestone" {if $td.milestone eq 1} checked="checked"{/if} {if $disabled.milestone} readonly {/if}/ onChange="milestone_toggle()"></td>
    
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr> 
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.started}:</td>
    <td class="formhead">{mgw_html_select_date prefix="Start" start_year="-5" end_year="+5" time=$sts}
      {datepick form="np" field="StartYear,StartMonth,StartDay"}
      {if $red.startdate} 
      <span style="color:red">{$red.startdate}</span> 
      {/if}
    </td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>

  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.targetdate}:</td>
    <td class="formhead">{mgw_html_select_date prefix="End" start_year="-5" end_year="+5" time=$ets}
      {datepick form="np" field="EndYear,EndMonth,EndDay"} 
      {if $red.targetdate} 
      <span style="color:red">{$red.targetdate}</span> 
      {/if}
    </td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>

  <tr align="left">
    <td class="tab" height="30"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="formhead">{$hashmap.desc}:</td>
    <td class="tab">&nbsp;<br><textarea name="description" rows="6" cols="40">{$td.description}</textarea><br>&nbsp;</td>
  </tr>

  <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
  <tr align="left">
    <td class="tab" height="40"><img src="{$imgpathmaster}/space.gif" alt="" width="60" height="1"></td>
    <td class="tab"></td>
    <td class="formhead"><input type="reset" value="{$hashmap.restore}" class="{$suclass}" />&nbsp;<input type="submit" name="{$suname}" value="{if $mode eq "new"}{$hashmap.create}{else}{$hashmap.save}{/if}" class="{$suclass}">&nbsp;<a class="edit" href="index.php?obj=project&amp;view=details&amp;pid={$td.pid}&amp;{$SESSION}">{$hashmap.abort}</a></td>
  </tr>

  {if $action neq 'create'}
  {section name=c loop=$comments}
  <tr><td class="lines2" height="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1" hspace="0" vspace="0" border="0"></td></tr>
  <tr>
    <td class="tab">&nbsp;</td>
    <td class="tab" valign="top">{$comments[c].lu_username}<br />
      {$comments[c].date|mgw_datetime}</td>
      {if $comments[c].comment_id eq $cidtoedit && $comments[c].owner eq $userid}
      <td class="tab"><br />
	<textarea name="commenttoedit" rows="5" cols="35" />{$comments[c].comment|smarty:nodefaults}</textarea><br />
	<input type="hidden" name="cid" value="{$comments[c].comment_id}" />
	<input type="submit" value="{$edit}" />
      </td>
      {elseif $comments[c].owner eq $userid}
      <td class="tab"><br />{$comments[c].comment|smarty:nodefaults|mgw_linkalize}<br /><br /><a href="index.php?obj=task&amp;view=edit&amp;tid={$td.task_id}&amp;cidtoedit={$comments[c].comment_id}&amp;{$SESSION}">{$edit}</a><br /></td>
      {else}
      <td class="tab"><br />{$comments[c].comment|mgw_linkalize}<br /><br /></td>
      {/if}
    </tr>
    {/section}
    <tr><td class="lines2" height="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1" hspace="0" vspace="0" border="0"></td></tr>
    <tr>
      <td class="tab">&nbsp;</td>
      <td class="tab"></td>
      <form action="index.php" method="POST">
      <td class="formhead">{$hashmap.addcomment}<br />
	<form action="index.php" method="POST">
	<textarea name="comment" rows="5" cols="40" /></textarea><br />
	<input type="submit" value="{$caction}" />
	</form>
      </td>
    </tr>
    <tr><td class="lines" height="1" width="1" colspan="3"><img src="{$imgpathmaster}/space.gif" alt="" width="1" height="1"></td></tr>
    {/if}  
</table>
</form> 
{include file="$gentemplates/_footer.tpl" aktUser=$username}
