Conditionally showing Work plugin depending on WORK_DEBUG constant.
[timetracker.git] / WEB-INF / templates / plugins.tpl
index 005c2e5..56868a6 100644 (file)
@@ -28,7 +28,8 @@ function handlePluginCheckboxes() {
     taxCheckbox.style.visibility = "hidden";
     taxLabel.style.visibility = "hidden";
   }
-  var configureLabel = document.getElementById("expenses_config");
+  var configureLabel = document.getElementById("expenses_conf");
+  var docLabel = null;
   if (expensesCheckbox.checked) {
     configureLabel.style.visibility = "visible";
   } else {
@@ -36,7 +37,7 @@ function handlePluginCheckboxes() {
   }
 
   var customFieldsCheckbox = document.getElementById("custom_fields");
-  configureLabel = document.getElementById("cf_config");
+  configureLabel = document.getElementById("cf_conf");
   if (customFieldsCheckbox.checked) {
     configureLabel.style.visibility = "visible";
   } else {
@@ -44,7 +45,7 @@ function handlePluginCheckboxes() {
   }
 
   var notificationsCheckbox = document.getElementById("notifications");
-  configureLabel = document.getElementById("notifications_config");
+  configureLabel = document.getElementById("notifications_conf");
   if (notificationsCheckbox.checked) {
     configureLabel.style.visibility = "visible";
   } else {
@@ -52,7 +53,7 @@ function handlePluginCheckboxes() {
   }
 
   var lockingCheckbox = document.getElementById("locking");
-  configureLabel = document.getElementById("locking_config");
+  configureLabel = document.getElementById("locking_conf");
   if (lockingCheckbox.checked) {
     configureLabel.style.visibility = "visible";
   } else {
@@ -60,7 +61,7 @@ function handlePluginCheckboxes() {
   }
 
   var quotasCheckbox = document.getElementById("quotas");
-  configureLabel = document.getElementById("quotas_config");
+  configureLabel = document.getElementById("quotas_conf");
   if (quotasCheckbox.checked){
     configureLabel.style.visibility = "visible";
   } else {
@@ -68,7 +69,7 @@ function handlePluginCheckboxes() {
   }
 
   var weekViewCheckbox = document.getElementById("week_view");
-  configureLabel = document.getElementById("week_view_config");
+  configureLabel = document.getElementById("week_view_conf");
   if (weekViewCheckbox.checked){
     configureLabel.style.visibility = "visible";
   } else {
@@ -76,12 +77,23 @@ function handlePluginCheckboxes() {
   }
 
   var workUnitsCheckbox = document.getElementById("work_units");
-  configureLabel = document.getElementById("work_units_config");
+  configureLabel = document.getElementById("work_units_conf");
   if (workUnitsCheckbox.checked){
     configureLabel.style.visibility = "visible";
   } else {
     configureLabel.style.visibility = "hidden";
   }
+
+  var templatesCheckbox = document.getElementById("templates");
+  configureLabel = document.getElementById("templates_conf");
+  docLabel = document.getElementById("templates_doc");
+  if (templatesCheckbox.checked){
+    configureLabel.style.display = "";
+    docLabel.style.display = "none";
+  } else {
+    configureLabel.style.display = "none";
+    docLabel.style.display = "";
+  }
 }
 </script>
 
@@ -108,31 +120,31 @@ function handlePluginCheckboxes() {
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.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>
+            <td><label for="custom_fields">{$i18n.label.custom_fields}</label> <span id="cf_conf"><a href="cf_custom_fields.php">{$i18n.label.configure}</a></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.expenses.control}</td>
-            <td><label for="expenses">{$i18n.title.expenses}</label> {$forms.pluginsForm.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>
+            <td><label for="expenses">{$i18n.title.expenses}</label> {$forms.pluginsForm.tax_expenses.control} <span id="tax_label"><label for="tax_expenses">{$i18n.label.tax}</label></span> <span id="expenses_conf"><a href="predefined_expenses.php">{$i18n.label.configure}</a></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.notifications.control}</td>
-            <td><label for="notifications">{$i18n.title.notifications}</label> <span id="notifications_config">{if $user_exists}<a href="notifications.php">{$i18n.label.configure}</a>{/if}</span></td>
+            <td><label for="notifications">{$i18n.title.notifications}</label> <span id="notifications_conf">{if $user_exists}<a href="notifications.php">{$i18n.label.configure}</a>{/if}</span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.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>
+            <td><label for="locking">{$i18n.title.locking}</label> <span id="locking_conf"><a href="locking.php">{$i18n.label.configure}</a></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.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>
+            <td><label for="quotas">{$i18n.label.monthly_quotas}</label> <span id="quotas_conf"><a href="quotas.php">{$i18n.label.configure}</a></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.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>
+            <td><label for="week_view">{$i18n.label.week_view}</label> <span id="week_view_conf"><a href="week_view.php">{$i18n.label.configure}</a></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.work_units.control}</td>
-            <td><label for="work_units">{$i18n.label.work_units}</label> <span id="work_units_config"><a href="work_units.php">{$i18n.label.configure}</a></span></td>
+            <td><label for="work_units">{$i18n.label.work_units}</label> <span id="work_units_conf"><a href="work_units.php">{$i18n.label.configure}</a></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.approval.control}</td>
@@ -140,12 +152,20 @@ function handlePluginCheckboxes() {
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.timesheets.control}</td>
-            <td><label for="timesheets">{$i18n.title.timesheets}</label></td>
+            <td><label for="timesheets">{$i18n.title.timesheets}</label> <a href="https://www.anuko.com/lp/tt_30.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
           </tr>
-{if isTrue('TEMPLATES_DEBUG')}
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.templates.control}</td>
-            <td><label for="templates">{$i18n.title.templates}</label> <a href="https://www.anuko.com/lp/tt_29.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+            <td><label for="templates">{$i18n.title.templates}</label> <span id="templates_conf"><a href="templates.php">{$i18n.label.configure}</a></span> <span id="templates_doc"><a href="https://www.anuko.com/lp/tt_29.htm" target="_blank">{$i18n.label.what_is_it}</a></span></td>
+          </tr>
+          <tr>
+            <td align="right" nowrap>{$forms.pluginsForm.attachments.control}</td>
+            <td><label for="attachments">{$i18n.label.attachments}</label> <span id="attachments_doc"><a href="https://www.anuko.com/lp/tt_31.htm" target="_blank">{$i18n.label.what_is_it}</a></span></td>
+          </tr>
+{if isTrue('WORK_DEBUG')}
+          <tr>
+            <td align="right" nowrap>{$forms.pluginsForm.work.control}</td>
+            <td><label for="work">{$i18n.title.work}</label> <span id="work_doc"><a href="https://www.anuko.com/lp/tt_34.htm" target="_blank">{$i18n.label.what_is_it}</a></span></td>
           </tr>
 {/if}
           <tr>