Optimized a bit more for uncompleted indicators option.
authorNik Okuntseff <support@anuko.com>
Sat, 1 Dec 2018 16:25:54 +0000 (16:25 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 1 Dec 2018 16:25:54 +0000 (16:25 +0000)
WEB-INF/lib/ttGroup.class.php
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/mobile/users.tpl
WEB-INF/templates/users.tpl
mobile/users.php
users.php

index 44e225b..b7e78f9 100644 (file)
@@ -49,7 +49,6 @@ class ttGroup {
   var $punch_mode = 0;          // Whether punch mode is enabled for user.
   var $allow_overlap = 0;       // Whether to allow overlapping time entries.
   var $future_entries = 0;      // Whether to allow creating future entries.
-  var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
   var $bcc_email = null;        // Bcc email.
   var $allow_ip = null;         // Specification from where user is allowed access.
   var $password_complexity = null; // Password complexity example.
@@ -110,7 +109,6 @@ class ttGroup {
       $this->punch_mode = $config->getDefinedValue('punch_mode');
       $this->allow_overlap = $config->getDefinedValue('allow_overlap');
       $this->future_entries = $config->getDefinedValue('future_entries');
-      $this->uncompleted_indicators = $config->getDefinedValue('uncompleted_indicators');
       /*
       if ($this->isPluginEnabled('wu')) {
         $minutes_in_unit = $config->getIntValue('minutes_in_unit');
index 60f4f98..0db272f 100644 (file)
@@ -59,7 +59,6 @@ class ttUser {
   var $punch_mode = 0;          // Whether punch mode is enabled for user.
   var $allow_overlap = 0;       // Whether to allow overlapping time entries.
   var $future_entries = 0;      // Whether to allow creating future entries.
-  var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
   var $bcc_email = null;        // Bcc email.
   var $allow_ip = null;         // Specification from where user is allowed access.
   var $password_complexity = null; // Password complexity example.
@@ -142,7 +141,6 @@ class ttUser {
       $this->punch_mode = $config->getDefinedValue('punch_mode');
       $this->allow_overlap = $config->getDefinedValue('allow_overlap');
       $this->future_entries = $config->getDefinedValue('future_entries');
-      $this->uncompleted_indicators = $config->getDefinedValue('uncompleted_indicators');
       if ($this->isPluginEnabled('wu')) {
         $minutes_in_unit = $config->getIntValue('minutes_in_unit');
         if ($minutes_in_unit) $this->minutes_in_unit = $minutes_in_unit;
index b17fa67..071a29a 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.29.4555 | 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.29.4556 | 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 e2b815f..ae04bd4 100644 (file)
@@ -19,7 +19,7 @@
     {foreach $active_users as $u}
         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
           <td>
-            {if $user->uncompleted_indicators}
+            {if $uncompleted_indicators}
               <span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
             {/if}
             {if $u.rank < $user->rank || ($u.rank == $user->rank && $u.id == $user->id)}
index fb46c96..4faf124 100644 (file)
@@ -31,7 +31,7 @@
     {foreach $active_users as $u}
         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
           <td>
-          {if $user->uncompleted_indicators}
+          {if $uncompleted_indicators}
             <span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
           {/if}
             {$u.name|escape}
index d0b5d21..874b076 100644 (file)
@@ -38,6 +38,8 @@ if (!(ttAccessAllowed('view_users') || ttAccessAllowed('manage_users'))) {
 }
 // End of access checks.
 
+$uncompleted_indicators = $user->getConfigOption('uncompleted_indicators');
+
 // Get users.
 $active_users = ttTeamHelper::getActiveUsers(array('getAllFields'=>true));
 if($user->can('manage_users')) {
@@ -45,12 +47,12 @@ if($user->can('manage_users')) {
   $inactive_users = ttTeamHelper::getInactiveUsers($user->group_id, true);
 }
 
-// Check if the group is set to show indicators for uncompleted time entries.
-if ($user->uncompleted_indicators) {
+if ($uncompleted_indicators) {
   // Check each active user if they have an uncompleted time entry.
   foreach ($active_users as $key => $user) {
     $active_users[$key]['has_uncompleted_entry'] = (bool) ttTimeHelper::getUncompleted($user['id']);
   }
+  $smarty->assign('uncompleted_indicators', true);
 }
 
 $smarty->assign('active_users', $active_users);
index fe0e92d..47ec014 100644 (file)
--- a/users.php
+++ b/users.php
@@ -50,6 +50,7 @@ if ($request->isPost()) {
 } else {
   $group_id = $user->getGroup();
 }
+$uncompleted_indicators = $user->getConfigOption('uncompleted_indicators');
 
 $form = new Form('usersForm');
 if ($user->can('manage_subgroups')) {
@@ -79,12 +80,12 @@ if($user->can('manage_users')) {
   $inactive_users = $user->getUsers($options);
 }
 
-// Check if the group is set to show indicators for uncompleted time entries.
-if ($user->uncompleted_indicators) {
+if ($uncompleted_indicators) {
   // Check each active user if they have an uncompleted time entry.
   foreach ($active_users as $key => $user) {
     $active_users[$key]['has_uncompleted_entry'] = (bool) ttTimeHelper::getUncompleted($user['id']);
   }
+  $smarty->assign('uncompleted_indicators', true);
 }
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));