From 46f39c48caaac4dcc65266c3ca12acfd5706360d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 19 Feb 2019 12:51:00 +0000 Subject: [PATCH] Added inactive timesheets to timesheets.php display. --- WEB-INF/lib/ttTimesheetHelper.class.php | 2 +- WEB-INF/templates/timesheets.tpl | 46 +++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttTimesheetHelper.class.php b/WEB-INF/lib/ttTimesheetHelper.class.php index 64c73741..1d43f152 100644 --- a/WEB-INF/lib/ttTimesheetHelper.class.php +++ b/WEB-INF/lib/ttTimesheetHelper.class.php @@ -154,7 +154,7 @@ class ttTimesheetHelper { 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()) diff --git a/WEB-INF/templates/timesheets.tpl b/WEB-INF/templates/timesheets.tpl index 8c3acc95..6a5269b5 100644 --- a/WEB-INF/templates/timesheets.tpl +++ b/WEB-INF/templates/timesheets.tpl @@ -40,10 +40,52 @@ {/if} {if $show_approval_status} {if $timesheet.approval_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if} + {/if} + {$i18n.label.view} + {if !$user->isClient()} + {$i18n.label.edit} + {$i18n.label.delete} + {/if} + + {/foreach} + + {if !$user->isClient()} + + +

{/if} +{if $inactive_timesheets} + - + + + + {if $show_client} + + {/if} + {if $show_submit_status} + + {/if} + {if $show_approval_status} + + {/if} + + + + + {foreach $inactive_timesheets as $timesheet} + + + {if $show_client} + + {/if} + {if $show_submit_status} + + {/if} + {if $show_approval_status} + + {/if} {if !$user->isClient()} @@ -52,12 +94,12 @@ {/foreach}
{$i18n.form.timesheets.inactive_timesheets}
{$i18n.label.thing_name}{$i18n.label.client}{$i18n.label.submitted}{$i18n.label.approved}{$i18n.label.view}{$i18n.label.edit}{$i18n.label.delete}
{$timesheet.name|escape}{$timesheet.client_name|escape}{if $timesheet.submit_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{if $timesheet.approval_status}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{$i18n.label.view}{$i18n.label.edit}
- {if !$user->isClient()}

{/if} +{/if} -- 2.20.1