Moved plugins config out to a separate plugins.php page.
authorNik Okuntseff <support@anuko.com>
Sun, 9 Sep 2018 18:42:53 +0000 (18:42 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 9 Sep 2018 18:42:53 +0000 (18:42 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/group_edit.tpl
WEB-INF/templates/header.tpl
group_edit.php

index 2c74b1e..bfb6356 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.17.98.4321 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.99.4322 | 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 3e34054..ef00ca4 100644 (file)
@@ -14,92 +14,6 @@ function handleTaskRequiredCheckbox() {
     taskRequiredLabel.style.visibility = "hidden";
   }
 }
-
-
-// handlePluginCheckboxes - controls visibility of controls.
-function handlePluginCheckboxes() {
-  var clientsCheckbox = document.getElementById("clients");
-  var invoicesCheckbox = document.getElementById("invoices");
-  var requiredCheckbox = document.getElementById("client_required");
-  var requiredLabel = document.getElementById("client_required_label");
-  if (clientsCheckbox.checked) {
-    requiredCheckbox.style.visibility = "visible";
-    requiredLabel.style.visibility = "visible";
-    invoicesCheckbox.disabled = false;
-  } else {
-    requiredCheckbox.checked = false;
-    requiredCheckbox.style.visibility = "hidden";
-    requiredLabel.style.visibility = "hidden";
-    invoicesCheckbox.checked = false;
-    invoicesCheckbox.disabled = true;
-  }
-
-  var expensesCheckbox = document.getElementById("expenses");
-  var taxCheckbox = document.getElementById("tax_expenses");
-  var taxLabel = document.getElementById("tax_label");
-  if (expensesCheckbox.checked) {
-    taxCheckbox.style.visibility = "visible";
-    taxLabel.style.visibility = "visible";
-  } else {
-    taxCheckbox.checked = false;
-    taxCheckbox.style.visibility = "hidden";
-    taxLabel.style.visibility = "hidden";
-  }
-  var configureLabel = document.getElementById("expenses_config");
-  if (expensesCheckbox.checked) {
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-
-  var customFieldsCheckbox = document.getElementById("custom_fields");
-  configureLabel = document.getElementById("cf_config");
-  if (customFieldsCheckbox.checked) {
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-
-  var notificationsCheckbox = document.getElementById("notifications");
-  configureLabel = document.getElementById("notifications_config");
-  if (notificationsCheckbox.checked) {
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-
-  var lockingCheckbox = document.getElementById("locking");
-  configureLabel = document.getElementById("locking_config");
-  if (lockingCheckbox.checked) {
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-
-  var quotasCheckbox = document.getElementById("quotas");
-  configureLabel = document.getElementById("quotas_config");
-  if (quotasCheckbox.checked){
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-
-  var weekViewCheckbox = document.getElementById("week_view");
-  configureLabel = document.getElementById("week_view_config");
-  if (weekViewCheckbox.checked){
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-
-  var workUnitsCheckbox = document.getElementById("work_units");
-  configureLabel = document.getElementById("work_units_config");
-  if (workUnitsCheckbox.checked){
-    configureLabel.style.visibility = "visible";
-  } else {
-    configureLabel.style.visibility = "hidden";
-  }
-}
 </script>
 
 {$forms.groupForm.open}
@@ -197,60 +111,6 @@ function handlePluginCheckboxes() {
             }
             adjustDecimalPreview();
           </script>
-
-          <tr>
-            <td>&nbsp;</td>
-            <td>&nbsp;</td>
-          </tr>
-
-          <tr>
-             <td colspan="2" class="sectionHeader">{$i18n.title.plugins}</td>
-          </tr>
-          <tr><td>&nbsp;</td></tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.charts.control}</td>
-            <td><label for="charts">{$i18n.title.charts}</label></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.clients.control}</td>
-            <td><label for="clients">{$i18n.title.clients}</label> {$forms.groupForm.client_required.control} <span id="client_required_label"><label for="client_required">{$i18n.label.required}</label></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.invoices.control}</td>
-            <td><label for="invoices">{$i18n.title.invoices}</label></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.paid_status.control}</td>
-            <td><label for="paid_status">{$i18n.label.paid_status}</label></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.custom_fields.control}</td>
-            <td><label for="custom_fields">{$i18n.label.custom_fields}</label> <span id="cf_config"><a href="cf_custom_fields.php">{$i18n.label.configure}</a></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.expenses.control}</td>
-            <td><label for="expenses">{$i18n.title.expenses}</label> {$forms.groupForm.tax_expenses.control} <span id="tax_label"><label for="tax_expenses">{$i18n.label.tax}</label></span> <span id="expenses_config"><a href="predefined_expenses.php">{$i18n.label.configure}</a></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.notifications.control}</td>
-            <td><label for="notifications">{$i18n.title.notifications}</label> <span id="notifications_config"><a href="notifications.php">{$i18n.label.configure}</a></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.locking.control}</td>
-            <td><label for="locking">{$i18n.title.locking}</label> <span id="locking_config"><a href="locking.php">{$i18n.label.configure}</a></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.quotas.control}</td>
-            <td><label for="quotas">{$i18n.label.monthly_quotas}</label> <span id="quotas_config"><a href="quotas.php">{$i18n.label.configure}</a></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.week_view.control}</td>
-            <td><label for="week_view">{$i18n.label.week_view}</label> <span id="week_view_config"><a href="week_view.php">{$i18n.label.configure}</a></span></td>
-          </tr>
-          <tr>
-            <td align="right" nowrap>{$forms.groupForm.work_units.control}</td>
-            <td><label for="week_view">{$i18n.label.work_units}</label> <span id="work_units_config"><a href="work_units.php">{$i18n.label.configure}</a></span></td>
-          </tr>
 {/if}
 
           <tr>
index aa59d3f..c7c445a 100644 (file)
@@ -88,6 +88,9 @@
     {/if}
     {if $user->can('manage_basic_settings')}
             <a class="systemMenu" href="group_edit.php">{$i18n.menu.group}</a> &middot;
+    {/if}
+    {if $user->can('manage_features')}
+            <a class="systemMenu" href="plugins.php">{$i18n.menu.plugins}</a> &middot;
     {/if}
             <a class="systemMenu" href="{$smarty.const.FORUM_LINK}" target="_blank">{$i18n.menu.forum}</a> &middot;
             <a class="systemMenu" href="{$smarty.const.HELP_LINK}" target="_blank">{$i18n.menu.help}</a>
index 01d2ecd..9c4cf36 100644 (file)
@@ -64,21 +64,6 @@ if ($request->isPost()) {
   $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
   $cl_bcc_email = trim($request->getParameter('bcc_email'));
   $cl_allow_ip = trim($request->getParameter('allow_ip'));
-
-  // Plugin checkboxes.
-  $cl_charts = $request->getParameter('charts');
-  $cl_clients = $request->getParameter('clients');
-  $cl_client_required = $request->getParameter('client_required');
-  $cl_invoices = $request->getParameter('invoices');
-  $cl_paid_status = $request->getParameter('paid_status');
-  $cl_custom_fields = $request->getParameter('custom_fields');
-  $cl_expenses = $request->getParameter('expenses');
-  $cl_tax_expenses = $request->getParameter('tax_expenses');
-  $cl_notifications = $request->getParameter('notifications');
-  $cl_locking = $request->getParameter('locking');
-  $cl_quotas = $request->getParameter('quotas');
-  $cl_week_view = $request->getParameter('week_view');
-  $cl_work_units = $request->getParameter('work_units');
 } else {
   $cl_group = $user->group;
   $cl_currency = ($user->currency == ''? CURRENCY_DEFAULT : $user->currency);
@@ -98,22 +83,6 @@ if ($request->isPost()) {
   $cl_uncompleted_indicators = $user->uncompleted_indicators;
   $cl_bcc_email = $user->bcc_email;
   $cl_allow_ip = $user->allow_ip;
-
-  // Which plugins do we have enabled?
-  $plugins = explode(',', $user->plugins);
-  $cl_charts = in_array('ch', $plugins);
-  $cl_clients = in_array('cl', $plugins);
-  $cl_client_required = in_array('cm', $plugins);
-  $cl_invoices = in_array('iv', $plugins);
-  $cl_paid_status = in_array('ps', $plugins);
-  $cl_custom_fields = in_array('cf', $plugins);
-  $cl_expenses = in_array('ex', $plugins);
-  $cl_tax_expenses = in_array('et', $plugins);
-  $cl_notifications = in_array('no', $plugins);
-  $cl_locking = in_array('lk', $plugins);
-  $cl_quotas = in_array('mq', $plugins);
-  $cl_week_view = in_array('wv', $plugins);
-  $cl_work_units = in_array('wu', $plugins);
 }
 
 $form = new Form('groupForm');
@@ -199,21 +168,6 @@ if ($advanced_settings) {
   $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'allow_ip','value'=>$cl_allow_ip));
 }
 
-// Plugin checkboxes.
-$form->addInput(array('type'=>'checkbox','name'=>'charts','value'=>$cl_charts));
-$form->addInput(array('type'=>'checkbox','name'=>'clients','value'=>$cl_clients,'onchange'=>'handlePluginCheckboxes()'));
-$form->addInput(array('type'=>'checkbox','name'=>'client_required','value'=>$cl_client_required));
-$form->addInput(array('type'=>'checkbox','name'=>'invoices','value'=>$cl_invoices));
-$form->addInput(array('type'=>'checkbox','name'=>'paid_status','value'=>$cl_paid_status));
-$form->addInput(array('type'=>'checkbox','name'=>'custom_fields','value'=>$cl_custom_fields,'onchange'=>'handlePluginCheckboxes()'));
-$form->addInput(array('type'=>'checkbox','name'=>'expenses','value'=>$cl_expenses,'onchange'=>'handlePluginCheckboxes()'));
-$form->addInput(array('type'=>'checkbox','name'=>'tax_expenses','value'=>$cl_tax_expenses));
-$form->addInput(array('type'=>'checkbox','name'=>'notifications','value'=>$cl_notifications,'onchange'=>'handlePluginCheckboxes()'));
-$form->addInput(array('type'=>'checkbox','name'=>'locking','value'=>$cl_locking,'onchange'=>'handlePluginCheckboxes()'));
-$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'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
 if ($user->can('delete_group')) $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('button.delete')));
 
@@ -235,45 +189,6 @@ if ($request->isPost()) {
   // Finished validating user input.
 
   if ($err->no()) {
-    // Prepare plugins string.
-    if ($cl_charts)
-      $plugins .= ',ch';
-    if ($cl_clients)
-      $plugins .= ',cl';
-    if ($cl_client_required)
-      $plugins .= ',cm';
-    if ($cl_invoices)
-      $plugins .= ',iv';
-    if ($cl_paid_status)
-      $plugins .= ',ps';
-    if ($cl_custom_fields)
-      $plugins .= ',cf';
-    if ($cl_expenses)
-      $plugins .= ',ex';
-    if ($cl_tax_expenses)
-      $plugins .= ',et';
-    if ($cl_notifications)
-      $plugins .= ',no';
-    if ($cl_locking)
-      $plugins .= ',lk';
-    if ($cl_quotas)
-      $plugins .= ',mq';
-    if ($cl_week_view)
-      $plugins .= ',wv';
-    if ($cl_work_units)
-      $plugins .= ',wu';
-
-    // Recycle week view plugin options as they are not configured on this page.
-    $existing_plugins = explode(',', $user->plugins);
-    if (in_array('wvn', $existing_plugins))
-      $plugins .= ',wvn';
-    if (in_array('wvl', $existing_plugins))
-      $plugins .= ',wvl';
-    if (in_array('wvns', $existing_plugins))
-      $plugins .= ',wvns';
-
-    $plugins = trim($plugins, ',');
-
     // Update config.
     $config->setDefinedValue('show_holidays', $cl_show_holidays);
     $config->setDefinedValue('punch_mode', $cl_punch_mode);
@@ -296,7 +211,6 @@ if ($request->isPost()) {
       'uncompleted_indicators' => $cl_uncompleted_indicators,
       'bcc_email' => $cl_bcc_email,
       'allow_ip' => $cl_allow_ip,
-      'plugins' => $plugins,
       'config' => $config->getConfig()))) {
       header('Location: time.php');
       exit();