Removed group selector from plugins.php to keep things simple.
authorNik Okuntseff <support@anuko.com>
Sat, 8 Dec 2018 19:26:42 +0000 (19:26 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 8 Dec 2018 19:26:42 +0000 (19:26 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/plugins.tpl
plugins.php

index 63adffd..507e6e5 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.29.4615 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.29.4616 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 6b88725..11514d1 100644 (file)
@@ -89,13 +89,6 @@ function handlePluginCheckboxes() {
 <table cellspacing="4" cellpadding="7" border="0">
     <tr>
       <td>
-{if $group_dropdown}
-        <table width="100%">
-          <tr>
-            <td align="center">{$i18n.label.group}: {$forms.pluginsForm.group.control}</td>
-          </tr>
-        </table>
-{/if}
         <table cellspacing="1" cellpadding="2" border="0">
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.charts.control}</td>
index a19c1e1..5027420 100644 (file)
@@ -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)