Added a capability to add new records from week view.
[timetracker.git] / WEB-INF / templates / profile_edit.tpl
index 032cc5f..c4e0f58 100644 (file)
@@ -1,21 +1,36 @@
 <script>
+// handleTaskRequiredCheckbox - controls visibility of the Task Required checkbox.
+function handleTaskRequiredCheckbox() {
+  var taskRequiredCheckbox = document.getElementById("task_required");
+  var taskRequiredLabel = document.getElementById("task_required_label");
+  var trackingModeDropdown = document.getElementById("tracking_mode");
+  if (trackingModeDropdown.value == 2) {
+    taskRequiredCheckbox.style.visibility = "visible";
+    taskRequiredLabel.style.visibility = "visible";
+  } else {
+    taskRequiredCheckbox.style.visibility = "hidden";
+    taskRequiredLabel.style.visibility = "hidden";
+  }
+}
+
+
 // handleControls - 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("required_label");
+  var requiredLabel = document.getElementById("client_required_label");
   if (clientsCheckbox.checked) {
     requiredCheckbox.style.visibility = "visible";
-       requiredLabel.style.visibility = "visible";
-       invoicesCheckbox.disabled = false;
+    requiredLabel.style.visibility = "visible";
+    invoicesCheckbox.disabled = false;
   } else {
-       requiredCheckbox.checked = false;
-       requiredCheckbox.style.visibility = "hidden";
-       requiredLabel.style.visibility = "hidden";
-       invoicesCheckbox.checked = false;
+    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");
@@ -24,13 +39,19 @@ function handlePluginCheckboxes() {
     taxCheckbox.style.visibility = "visible";
     taxLabel.style.visibility = "visible";
   } else {
-       taxCheckbox.checked = false;
+    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");
-  var configureLabel = document.getElementById("cf_config");
+  configureLabel = document.getElementById("cf_config");
   if (customFieldsCheckbox.checked) {
     configureLabel.style.visibility = "visible";
   } else {
@@ -44,6 +65,22 @@ function handlePluginCheckboxes() {
   } 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";
+  }
 }
 </script>
 
@@ -65,7 +102,6 @@ function handlePluginCheckboxes() {
             <td align="right" nowrap>{$i18n.label.login} (*):</td>
             <td>{$forms.profileForm.login.control}</td>
           </tr>
-
 {if !$auth_external}
           <tr>
             <td align="right" nowrap>{$i18n.label.password} (*):</td>
@@ -76,7 +112,6 @@ function handlePluginCheckboxes() {
             <td>{$forms.profileForm.password2.control}</td>
           </tr>
 {/if}
-
           <tr>
             <td align="right" nowrap>{$i18n.label.email}:</td>
             <td>{$forms.profileForm.email.control}</td>
@@ -94,18 +129,10 @@ function handlePluginCheckboxes() {
             <td align="right" nowrap>{$i18n.label.team_name}:</td>
             <td>{$forms.profileForm.team_name.control}</td>
           </tr>
-          <!-- <tr>
-            <td align="right">{$i18n.label.address}:</td>
-            <td>{$forms.profileForm.address.control}</td>
-          </tr> -->
           <tr>
             <td align="right">{$i18n.label.currency}:</td>
             <td>{$forms.profileForm.currency.control}</td>
           </tr>
-          <tr>
-            <td align="right" nowrap>{$i18n.label.lock_interval}:</td>
-            <td>{$forms.profileForm.lock_interval.control}</td>
-          </tr>
           <tr>
            <td align="right" nowrap>{$i18n.label.language}:</td>
            <td>{$forms.profileForm.lang.control}</td>
@@ -127,18 +154,27 @@ function handlePluginCheckboxes() {
           </tr>
           <tr>
             <td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
-            <td>{$forms.profileForm.tracking_mode.control}</td>
+            <td>{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} <span id="task_required_label"><label for="task_required">{$i18n.label.required}</label></span></td></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
             <td>{$forms.profileForm.record_type.control}</td>
           </tr>
-
+          <tr>
+            <td align="right" nowrap>{$i18n.form.profile.uncompleted_indicators}:</td>
+            <td>{$forms.profileForm.uncompleted_indicators.control}</td>
+          </tr>
+{if $user->isManager()}
+          <tr>
+            <td align="right" nowrap>{$i18n.label.bcc}:</td>
+            <td>{$forms.profileForm.bcc_email.control} <a href="https://www.anuko.com/lp/tt_10.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+          </tr>
+{/if}
           {* initialize preview text *}
           <script>
             MakeFormatPreview("date_format_preview", document.getElementById("format_date"));
             MakeFormatPreview("time_format_preview", document.getElementById("format_time"));
-            
+
             function adjustDecimalPreview()
             {
               var mark = document.getElementById("decimal_mark").value;
@@ -163,7 +199,7 @@ function handlePluginCheckboxes() {
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.profileForm.clients.control}</td>
-            <td><label for="clients">{$i18n.title.clients}</label> {$forms.profileForm.client_required.control} <span id="required_label"><label for="client_required">{$i18n.label.required}</label></span></td>
+            <td><label for="clients">{$i18n.title.clients}</label> {$forms.profileForm.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.profileForm.invoices.control}</td>
@@ -175,12 +211,20 @@ function handlePluginCheckboxes() {
           </tr>
           <tr>
             <td align="right" nowrap>{$forms.profileForm.expenses.control}</td>
-            <td><label for="expenses">{$i18n.title.expenses}</label> {$forms.profileForm.tax_expenses.control} <span id="tax_label"><label for="tax_expenses">{$i18n.label.tax}</label></span></td>
+            <td><label for="expenses">{$i18n.title.expenses}</label> {$forms.profileForm.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.profileForm.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.profileForm.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.profileForm.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>
 {/if}
 
           <tr>
@@ -193,4 +237,4 @@ function handlePluginCheckboxes() {
       </td>
     </tr>
 </table>
-{$forms.profileForm.close}
\ No newline at end of file
+{$forms.profileForm.close}