From: Nik Okuntseff Date: Thu, 7 Mar 2019 17:54:49 +0000 (+0000) Subject: Starting work on Templates plugin. X-Git-Tag: timetracker_1.19-1~211 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=89a5c1982ce74075e74a814c170e3d87563d5c47;p=timetracker.git Starting work on Templates plugin. --- diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 13be9f64..660e8448 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -318,6 +318,7 @@ $i18n_key_words = array( 'title.week_view' => 'Week View', 'title.swap_roles' => 'Swapping Roles', 'title.work_units' => 'Work Units', +'title.templates' => 'Templates', // Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here. // Strings that are used in a single form must go to the specific form section. diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 2c367628..2b35dcd4 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- +{if isTrue('TEMPLATES_DEBUG')} + + + + +{/if} diff --git a/plugins.php b/plugins.php index 0981cb77..bf0e527f 100644 --- a/plugins.php +++ b/plugins.php @@ -53,6 +53,7 @@ if ($request->isPost()) { $cl_work_units = $request->getParameter('work_units'); $cl_approval = $request->getParameter('approval'); $cl_timesheets = $request->getParameter('timesheets'); + $cl_templates = $request->getParameter('templates'); } else { // Note: we get here in get, and also in post when group changes. // Which plugins do we have enabled in currently selected group? @@ -72,6 +73,7 @@ if ($request->isPost()) { $cl_work_units = in_array('wu', $plugins); $cl_approval = in_array('ap', $plugins); $cl_timesheets = in_array('ts', $plugins); + $cl_templates = in_array('tp', $plugins); } $form = new Form('pluginsForm'); @@ -92,6 +94,9 @@ $form->addInput(array('type'=>'checkbox','name'=>'week_view','value'=>$cl_week_v $form->addInput(array('type'=>'checkbox','name'=>'work_units','value'=>$cl_work_units,'onchange'=>'handlePluginCheckboxes()')); $form->addInput(array('type'=>'checkbox','name'=>'approval','value'=>$cl_approval)); $form->addInput(array('type'=>'checkbox','name'=>'timesheets','value'=>$cl_timesheets)); +if (isTrue('TEMPLATES_DEBUG')) { + $form->addInput(array('type'=>'checkbox','name'=>'templates','value'=>$cl_templates)); +} // Submit button. $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); @@ -130,6 +135,8 @@ if ($request->isPost()) { $plugins .= ',ap'; if ($cl_timesheets) $plugins .= ',ts'; + if ($cl_templates) + $plugins .= ',tp'; // Recycle week view plugin options as they are not configured on this page. $existing_plugins = explode(',', $user->getPlugins());
 Anuko Time Tracker 1.18.53.4833 | Copyright © Anuko | +  Anuko Time Tracker 1.18.53.4834 | 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 c686eaaf..34e7ab2b 100644 --- a/WEB-INF/templates/plugins.tpl +++ b/WEB-INF/templates/plugins.tpl @@ -142,6 +142,12 @@ function handlePluginCheckboxes() { {$forms.pluginsForm.timesheets.control}
{$forms.pluginsForm.templates.control}