From 2469578bc42cdad7caf9ca05855726be8e953fbc Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 Dec 2018 19:26:42 +0000 Subject: [PATCH] Removed group selector from plugins.php to keep things simple. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/plugins.tpl | 7 ------ plugins.php | 40 ++++------------------------------- 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 63adffd9..507e6e5a 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4615 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4616 | 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 6b88725b..11514d16 100644 --- a/WEB-INF/templates/plugins.tpl +++ b/WEB-INF/templates/plugins.tpl @@ -89,13 +89,6 @@ function handlePluginCheckboxes() {
-{if $group_dropdown} - - - - -
{$i18n.label.group}: {$forms.pluginsForm.group.control}
-{/if} diff --git a/plugins.php b/plugins.php index a19c1e12..5027420e 100644 --- a/plugins.php +++ b/plugins.php @@ -34,24 +34,9 @@ if (!ttAccessAllowed('manage_features')) { header('Location: access_denied.php'); exit(); } -if ($request->isPost()) { - $groupChanged = $request->getParameter('group_changed'); // Reused in multiple places below. - if ($groupChanged && !($user->can('manage_subgroups') && $user->isGroupValid($request->getParameter('group')))) { - header('Location: access_denied.php'); // Group changed, but no rght or wrong group id. - exit(); - } -} // End of access checks. -// Determine group for which we display this page. -if ($request->isPost() && $groupChanged) { - $group_id = $request->getParameter('group'); - $user->setOnBehalfGroup($group_id); -} else { - $group_id = $user->getGroup(); -} - -if ($request->isPost() && $request->getParameter('btn_save')) { +if ($request->isPost()) { // Plugins that user wants to save for the current group. $cl_charts = $request->getParameter('charts'); $cl_clients = $request->getParameter('clients'); @@ -86,21 +71,7 @@ if ($request->isPost() && $request->getParameter('btn_save')) { } $form = new Form('pluginsForm'); -// Group dropdown. -if ($user->can('manage_subgroups')) { - $groups = $user->getGroupsForDropdown(); - if (count($groups) > 1) { - $form->addInput(array('type'=>'combobox', - 'onchange'=>'document.pluginsForm.group_changed.value=1;document.pluginsForm.submit();', - 'name'=>'group', - 'style'=>'width: 250px;', - 'value'=>$group_id, - 'data'=>$groups, - 'datakeys'=>array('id','name'))); - $form->addInput(array('type'=>'hidden','name'=>'group_changed')); - $smarty->assign('group_dropdown', 1); - } -} + // Plugin checkboxes. $form->addInput(array('type'=>'checkbox','name'=>'charts','value'=>$cl_charts)); $form->addInput(array('type'=>'checkbox','name'=>'clients','value'=>$cl_clients,'onchange'=>'handlePluginCheckboxes()')); @@ -118,12 +89,9 @@ $form->addInput(array('type'=>'checkbox','name'=>'work_units','value'=>$cl_work_ // Submit button. $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); -if ($request->isPost() && $request->getParameter('btn_save')) { +if ($request->isPost()) { // Note: we get here when the Save button is clicked. - // We update plugin list for the currently selected group. - // - // We don't get here if group changed in post. - // In this case the page is simply re-displayed for new group. + // We update plugin list for the current group. // Prepare plugins string. if ($cl_charts) -- 2.20.1
{$forms.pluginsForm.charts.control}