Usability improvements - conditional display of controls.
authorNik Okuntseff <support@anuko.com>
Mon, 26 Nov 2018 16:35:25 +0000 (16:35 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 26 Nov 2018 16:35:25 +0000 (16:35 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/project_add.tpl
WEB-INF/templates/project_edit.tpl
WEB-INF/templates/task_add.tpl
WEB-INF/templates/task_edit.tpl
project_add.php
project_edit.php
task_add.php

index 443e586..fe920a0 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.28.4523 | 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.28.4524 | 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 3aad22c..2f2fb99 100644 (file)
           <td align = "right">{$i18n.label.description}:</td>
           <td>{$forms.projectForm.description.control}</td>
         </tr>
+{if $show_users}
         <tr><td>&nbsp;</td></tr>
         <tr>
           <td align="right">{$i18n.label.users}:</td>
           <td>{$forms.projectForm.users.control}</td>
         </tr>
-{if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{/if}
+{if $smarty.const.MODE_PROJECTS_AND_TASKS == $user->getTrackingMode() && $show_tasks}
         <tr><td>&nbsp;</td></tr>
         <tr>
           <td align="right">{$i18n.label.tasks}:</td>
index 8faf675..bcabc37 100644 (file)
           <td align="right">{$i18n.label.status}:</td>
           <td>{$forms.projectForm.status.control}</td>
         </tr>
+{if $show_users}
         <tr><td>&nbsp;</td></tr>
         <tr>
           <td align="right">{$i18n.label.users}:</td>
           <td>{$forms.projectForm.users.control}</td>
         </tr>
-{if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{/if}
+{if $smarty.const.MODE_PROJECTS_AND_TASKS == $user->getTrackingMode() && $show_tasks}
         <tr><td>&nbsp;</td></tr>
         <tr>
           <td align="right">{$i18n.label.tasks}:</td>
index 53ce483..8e7f788 100644 (file)
           <td align = "right">{$i18n.label.description}:</td>
           <td>{$forms.taskForm.description.control}</td>
         </tr>
+{if $show_projects}
+        <tr><td>&nbsp;</td></tr>
         <tr valign="top">
           <td align="right">{$i18n.label.projects}:</td>
           <td>{$forms.taskForm.projects.control}</td>
         </tr>
+{/if}
         <tr>
           <td></td>
           <td>{$i18n.label.required_fields}</td>
index f8b45a3..0bf189b 100644 (file)
@@ -16,6 +16,7 @@
           <td>{$forms.taskForm.status.control}</td>
         </tr>
 {if $show_projects}
+        <tr><td>&nbsp;</td></tr>
         <tr valign="top">
           <td align="right">{$i18n.label.projects}:</td>
           <td>{$forms.taskForm.projects.control}</td>
index 6b41c15..9800b72 100644 (file)
@@ -36,7 +36,7 @@ if (!ttAccessAllowed('manage_projects')) {
   header('Location: access_denied.php');
   exit();
 }
-if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) {
   header('Location: feature_disabled.php');
   exit();
 }
@@ -66,7 +66,7 @@ $form = new Form('projectForm');
 $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','style'=>'width: 250px;','value'=>$cl_name));
 $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
 $form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users));
-if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
+if (MODE_PROJECTS_AND_TASKS == $user->getTrackingMode())
   $form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
 $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
 
@@ -95,6 +95,8 @@ if ($request->isPost()) {
 } // isPost
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_users', count($users) > 0);
+$smarty->assign('show_tasks', count($tasks) > 0);
 $smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"');
 $smarty->assign('title', $i18n->get('title.add_project'));
 $smarty->assign('content_page_name', 'project_add.tpl');
index 29c0d51..542fb46 100644 (file)
@@ -36,7 +36,7 @@ if (!ttAccessAllowed('manage_projects')) {
   header('Location: access_denied.php');
   exit();
 }
-if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) {
   header('Location: feature_disabled.php');
   exit();
 }
@@ -85,7 +85,7 @@ $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width:
 $form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
   'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
 $form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users));
-if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
+if (MODE_PROJECTS_AND_TASKS == $user->getTrackingMode())
   $form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
 $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
 $form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy')));
@@ -136,6 +136,8 @@ if ($request->isPost()) {
 } // isPost
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_users', count($users) > 0);
+$smarty->assign('show_tasks', count($tasks) > 0);
 $smarty->assign('onload', 'onLoad="document.projectForm.name.focus()"');
 $smarty->assign('title', $i18n->get('title.edit_project'));
 $smarty->assign('content_page_name', 'project_edit.tpl');
index b1ad08a..91f0e4f 100644 (file)
@@ -84,6 +84,7 @@ if ($request->isPost()) {
 } // isPost
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_projects', count($projects) > 0);
 $smarty->assign('onload', 'onLoad="document.taskForm.name.focus()"');
 $smarty->assign('title', $i18n->get('title.add_task'));
 $smarty->assign('content_page_name', 'task_add.tpl');