<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.37.4737 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.37.4738 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
{/if}
<td class="tableHeader">{$i18n.label.view}</td>
<td class="tableHeader">{$i18n.label.edit}</td>
- <td class="tableHeader">{$i18n.label.delete}</td>
</tr>
{foreach $active_timesheets as $timesheet}
<tr valign="top" bgcolor="{cycle values="#f5f5f5,#ffffff"}">
<td><a href="timesheet_view.php?id={$timesheet.id}">{$i18n.label.view}</a></td>
{if !$user->isClient()}
<td><a href="timesheet_edit.php?id={$timesheet.id}">{$i18n.label.edit}</a></td>
- <td><a href="timesheet_delete.php?id={$timesheet.id}">{$i18n.label.delete}</a></td>
{/if}
</tr>
{/foreach}
{/if}
<td class="tableHeader">{$i18n.label.view}</td>
<td class="tableHeader">{$i18n.label.edit}</td>
- <td class="tableHeader">{$i18n.label.delete}</td>
</tr>
{foreach $inactive_timesheets as $timesheet}
<tr valign="top" bgcolor="{cycle values="#f5f5f5,#ffffff"}">
<td><a href="timesheet_view.php?id={$timesheet.id}">{$i18n.label.view}</a></td>
{if !$user->isClient()}
<td><a href="timesheet_edit.php?id={$timesheet.id}">{$i18n.label.edit}</a></td>
- <td><a href="timesheet_delete.php?id={$timesheet.id}">{$i18n.label.delete}</a></td>
{/if}
</tr>
{/foreach}
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
if (!ttValidString($cl_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.comment'));
- if ($err->no()) {
- if ($request->getParameter('btn_save')) {
+ if ($request->getParameter('btn_save')) {
+ if ($err->no()) {
$existing_timesheet = ttTimesheetHelper::getTimesheetByName($cl_name, $timesheet['user_id']);
if (!$existing_timesheet || ($cl_timesheet_id == $existing_timesheet['id'])) {
- // Update project information.
+ // Update timesheet information.
if (ttTimesheetHelper::update(array(
'id' => $cl_timesheet_id,
'name' => $cl_name,
$err->add($i18n->get('error.object_exists'));
}
}
+
+ if ($request->getParameter('btn_delete')) {
+ header("Location: timesheet_delete.php?id=$cl_timesheet_id");
+ exit();
+ }
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));