Added configure link for the roles option.
authorNik Okuntseff <support@anuko.com>
Thu, 22 Feb 2018 17:01:54 +0000 (17:01 +0000)
committerNik Okuntseff <support@anuko.com>
Thu, 22 Feb 2018 17:01:54 +0000 (17:01 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/profile_edit.tpl
profile_edit.php

index c60a07a..069beb9 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.29.4012 | 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.29.4013 | 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 3dc8bc9..5bb5080 100644 (file)
@@ -1,4 +1,19 @@
 <script>
+// handleRolesCheckbox - controls visibility of the Configure and What is it? links on the right.
+function handleRolesCheckbox() {
+  var rolesCheckbox = document.getElementById("roles");
+  var configureLabel = document.getElementById("roles_config");
+  var whatIsItLabel = document.getElementById("roles_what_is_it");
+  if (rolesCheckbox.checked) {
+    configureLabel.style.display = "inline";
+    whatIsItLabel.style.display = "none";
+  } else {
+    configureLabel.style.display = "none";
+    whatIsItLabel.style.display = "inline";
+  }
+}
+
+
 // handleTaskRequiredCheckbox - controls visibility of the Task Required checkbox.
 function handleTaskRequiredCheckbox() {
   var taskRequiredCheckbox = document.getElementById("task_required");
@@ -144,7 +159,7 @@ function handlePluginCheckboxes() {
   {if defined(DEBUG_ROLES)}
           <tr>
             <td align="right" nowrap>{$i18n.label.roles}:</td>
-            <td>{$forms.profileForm.roles.control} <a href="https://www.anuko.com/lp/tt_19.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+            <td>{$forms.profileForm.roles.control} <span id="roles_config"><a href="roles.php">{$i18n.label.configure}</a></span> <span id="roles_what_is_it"><a href="https://www.anuko.com/lp/tt_19.htm" target="_blank">{$i18n.label.what_is_it}</a></span></td>
           </tr>
   {/if}
           <tr>
index ec8e1d8..412dc62 100644 (file)
@@ -136,7 +136,7 @@ if ($user->canManageTeam()) {
   $form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'team_name','value'=>$cl_team));
   $form->addInput(array('type'=>'text','maxlength'=>'7','name'=>'currency','value'=>$cl_currency));
   // Roles checkbox.
-  $form->addInput(array('type'=>'checkbox','name'=>'roles','value'=>$cl_roles));
+  $form->addInput(array('type'=>'checkbox','name'=>'roles','value'=>$cl_roles,'onchange'=>'handleRolesCheckbox()'));
 
   // Prepare an array of available languages.
   $lang_files = I18n::getLangFileList();
@@ -349,7 +349,7 @@ if ($request->isPost()) {
 
 $smarty->assign('auth_external', $auth->isPasswordExternal());
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('onload', 'onLoad="handleTaskRequiredCheckbox(); handlePluginCheckboxes();"');
+$smarty->assign('onload', 'onLoad="handleRolesCheckbox(); handleTaskRequiredCheckbox(); handlePluginCheckboxes();"');
 $smarty->assign('title', $i18n->getKey('title.profile'));
 $smarty->assign('content_page_name', 'profile_edit.tpl');
 $smarty->display('index.tpl');