]> wagnertech.de Git - timetracker.git/commitdiff
Added inactive timesheets to timesheets.php display.
authorNik Okuntseff <support@anuko.com>
Tue, 19 Feb 2019 12:51:00 +0000 (12:51 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 19 Feb 2019 12:51:00 +0000 (12:51 +0000)
WEB-INF/lib/ttTimesheetHelper.class.php
WEB-INF/templates/timesheets.tpl

index 64c73741c22ab562d6fd6a82e7b3334d7c3e93c6..1d43f1527f70f52fb760200a429d2bd47fd79c0b 100644 (file)
@@ -154,7 +154,7 @@ class ttTimesheetHelper {
     if ($user->isClient()) $client_part = "and client_id = $user->client_id";
 
     $sql = "select * from tt_timesheets".
     if ($user->isClient()) $client_part = "and client_id = $user->client_id";
 
     $sql = "select * from tt_timesheets".
-      " where id = $timesheet_id and group_id = $group_id and org_id = $org_id $client_part and status = 1";
+      " where id = $timesheet_id and group_id = $group_id and org_id = $org_id $client_part and status is not null";
     $res = $mdb2->query($sql);
     if (!is_a($res, 'PEAR_Error')) {
       if ($val = $res->fetchRow())
     $res = $mdb2->query($sql);
     if (!is_a($res, 'PEAR_Error')) {
       if ($val = $res->fetchRow())
index 8c3acc95ec0dc00e42428e45014fd30631d14b71..6a5269b58ff2f13f3700d1093545ee947c890baa 100644 (file)
   {/if}
   {if $show_approval_status}
           <td>{if $timesheet.approval_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>
   {/if}
   {if $show_approval_status}
           <td>{if $timesheet.approval_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>
+  {/if}
+          <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}
+      </table>
+  {if !$user->isClient()}
+      <table width="100%">
+        <tr><td align="center"><br><form><input type="button" onclick="chLocation('reports.php');" value="{$i18n.button.add}"></form></td></tr>
+      </table>
   {/if}
 
   {/if}
 
+{if $inactive_timesheets}
+      <table cellspacing="1" cellpadding="3" border="0" width="100%">
 
 
-
+        <tr><td class="sectionHeaderNoBorder">{$i18n.form.timesheets.inactive_timesheets}</td></tr>
+        <tr>
+          <td class="tableHeader">{$i18n.label.thing_name}</td>
+  {if $show_client}
+          <td class="tableHeader">{$i18n.label.client}</td>
+  {/if}
+  {if $show_submit_status}
+          <td class="tableHeader">{$i18n.label.submitted}</td>
+  {/if}
+  {if $show_approval_status}
+          <td class="tableHeader">{$i18n.label.approved}</td>
+  {/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>{$timesheet.name|escape}</td>
+  {if $show_client}
+          <td>{$timesheet.client_name|escape}</td>
+  {/if}
+  {if $show_submit_status}
+          <td>{if $timesheet.submit_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>
+  {/if}
+  {if $show_approval_status}
+          <td>{if $timesheet.approval_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>
+  {/if}
           <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_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>
         </tr>
         {/foreach}
       </table>
         </tr>
         {/foreach}
       </table>
-
   {if !$user->isClient()}
       <table width="100%">
         <tr><td align="center"><br><form><input type="button" onclick="chLocation('reports.php');" value="{$i18n.button.add}"></form></td></tr>
       </table>
   {/if}
   {if !$user->isClient()}
       <table width="100%">
         <tr><td align="center"><br><form><input type="button" onclick="chLocation('reports.php');" value="{$i18n.button.add}"></form></td></tr>
       </table>
   {/if}
+{/if}
     </td>
   </tr>
 </table>
     </td>
   </tr>
 </table>