From: Nik Okuntseff Date: Fri, 27 Jul 2018 16:57:36 +0000 (+0000) Subject: A bit more progress on report refactoring. X-Git-Tag: timetracker_1.19-1~803 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3c959f0cd6c32bcfa962480ebd87e7ee4ae6d5c1;p=timetracker.git A bit more progress on report refactoring. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index ae5698d2..624ea8f3 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -47,9 +47,9 @@ class ttReportHelper { $dropdown_parts .= ' and l.client_id = '.$options['client_id']; elseif ($user->isClient() && $user->client_id) $dropdown_parts .= ' and l.client_id = '.$user->client_id; - if ($bean->getAttribute('option')) $dropdown_parts .= ' and l.id in(select log_id from tt_custom_field_log where status = 1 and option_id = '.$bean->getAttribute('option').')'; - if ($bean->getAttribute('project')) $dropdown_parts .= ' and l.project_id = '.$bean->getAttribute('project'); - if ($bean->getAttribute('task')) $dropdown_parts .= ' and l.task_id = '.$bean->getAttribute('task'); + if ($options['cf_1_option_id']) $dropdown_parts .= ' and l.id in(select log_id from tt_custom_field_log where status = 1 and option_id = '.$options['cf_1_option_id'].')'; + if ($options['project_id']) $dropdown_parts .= ' and l.project_id = '.$options['project_id']; + if ($options['task_id']) $dropdown_parts .= ' and l.task_id = '.$options['task_id']; if ($bean->getAttribute('include_records')=='1') $dropdown_parts .= ' and l.billable = 1'; if ($bean->getAttribute('include_records')=='2') $dropdown_parts .= ' and l.billable = 0'; if ($bean->getAttribute('invoice')=='1') $dropdown_parts .= ' and l.invoice_id is not NULL'; @@ -145,7 +145,7 @@ class ttReportHelper { $dropdown_parts .= ' and l.client_id = '.$options['client_id']; elseif ($user->isClient() && $user->client_id) $dropdown_parts .= ' and ei.client_id = '.$user->client_id; - if ($bean->getAttribute('project')) $dropdown_parts .= ' and ei.project_id = '.$bean->getAttribute('project'); + if ($options['project_id']) $dropdown_parts .= ' and ei.project_id = '.$options['project_id']; if ($bean->getAttribute('invoice')=='1') $dropdown_parts .= ' and ei.invoice_id is not NULL'; if ($bean->getAttribute('invoice')=='2') $dropdown_parts .= ' and ei.invoice_id is NULL'; if ($bean->getAttribute('paid_status')=='1') $dropdown_parts .= ' and ei.paid = 1'; @@ -1903,13 +1903,12 @@ class ttReportHelper { $options['name'] = null; // No name required. $options['user_id'] = $user->id; // Not sure if we need user_id here. Fav reports use it to recycle $user object in cron.php. $options['client_id'] = $bean->getAttribute('client'); + $options['cf_1_option_id'] = $bean->getAttribute('option'); + $options['project_id'] = $bean->getAttribute('project'); + $options['task_id'] = $bean->getAttribute('task'); /* * TODO: remaining fields to fill in... - `client_id` int(11) default NULL, # client id (if selected) - `cf_1_option_id` int(11) default NULL, # custom field 1 option id (if selected) - `project_id` int(11) default NULL, # project id (if selected) - `task_id` int(11) default NULL, # task id (if selected) `billable` tinyint(4) default NULL, # whether to include billable, not billable, or all records `invoice` tinyint(4) default NULL, # whether to include invoiced, not invoiced, or all records `paid_status` tinyint(4) default NULL, # whether to include paid, not paid, or all records diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 654f8044..49a8ee80 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.93.4289 | Copyright © Anuko | +  Anuko Time Tracker 1.17.93.4290 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}