From bbf886e62dc4746fdbae813cfb80536228f77626 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 14 Feb 2019 15:07:12 +0000 Subject: [PATCH] Added Timeheets plugin checkbox. --- WEB-INF/resources/en.lang.php | 1 + WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/plugins.tpl | 6 ++++++ plugins.php | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 101a5b71..ef63eb63 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -52,6 +52,7 @@ $i18n_key_words = array( 'menu.time' => 'Time', 'menu.expenses' => 'Expenses', 'menu.reports' => 'Reports', +'menu.timesheets' => 'Timesheets', 'menu.charts' => 'Charts', 'menu.projects' => 'Projects', 'menu.tasks' => 'Tasks', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index de0c021a..8ed3563b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- +{if isTrue('TIMESHEET_DEBUG')} + + + + +{/if} diff --git a/plugins.php b/plugins.php index 5027420e..64615aa2 100644 --- a/plugins.php +++ b/plugins.php @@ -51,6 +51,7 @@ if ($request->isPost()) { $cl_quotas = $request->getParameter('quotas'); $cl_week_view = $request->getParameter('week_view'); $cl_work_units = $request->getParameter('work_units'); + $cl_timesheets = $request->getParameter('timesheets'); } else { // Note: we get here in get, and also in post when group changes. // Which plugins do we have enabled in currently selected group? @@ -68,6 +69,7 @@ if ($request->isPost()) { $cl_quotas = in_array('mq', $plugins); $cl_week_view = in_array('wv', $plugins); $cl_work_units = in_array('wu', $plugins); + $cl_timesheets = in_array('ts', $plugins); } $form = new Form('pluginsForm'); @@ -86,6 +88,7 @@ $form->addInput(array('type'=>'checkbox','name'=>'locking','value'=>$cl_locking, $form->addInput(array('type'=>'checkbox','name'=>'quotas','value'=>$cl_quotas,'onchange'=>'handlePluginCheckboxes()')); $form->addInput(array('type'=>'checkbox','name'=>'week_view','value'=>$cl_week_view,'onchange'=>'handlePluginCheckboxes()')); $form->addInput(array('type'=>'checkbox','name'=>'work_units','value'=>$cl_work_units,'onchange'=>'handlePluginCheckboxes()')); +$form->addInput(array('type'=>'checkbox','name'=>'timesheets','value'=>$cl_timesheets)); // Submit button. $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); @@ -120,6 +123,8 @@ if ($request->isPost()) { $plugins .= ',wv'; if ($cl_work_units) $plugins .= ',wu'; + if ($cl_timesheets) + $plugins .= ',ts'; // Recycle week view plugin options as they are not configured on this page. $existing_plugins = explode(',', $user->getPlugins()); -- 2.20.1
 Anuko Time Tracker 1.18.37.4719 | Copyright © Anuko | +  Anuko Time Tracker 1.18.37.4720 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/plugins.tpl b/WEB-INF/templates/plugins.tpl index c064d18b..9ab38ab9 100644 --- a/WEB-INF/templates/plugins.tpl +++ b/WEB-INF/templates/plugins.tpl @@ -134,6 +134,12 @@ function handlePluginCheckboxes() { {$forms.pluginsForm.work_units.control} {$i18n.label.configure}
{$forms.pluginsForm.timesheets.control}