Removed group selector from time.php to keep things simple.
authorNik Okuntseff <support@anuko.com>
Thu, 13 Dec 2018 21:06:08 +0000 (21:06 +0000)
committerNik Okuntseff <support@anuko.com>
Thu, 13 Dec 2018 21:06:08 +0000 (21:06 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/time.tpl
time.php

index ce84ca0..f550c35 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.30.4649 | 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.30.4650 | 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 bb86287..7633870 100644 (file)
   <tr>
     <td valign="top">
       <table>
-{if $group_dropdown}
-        <tr>
-          <td align="right">{$i18n.label.group}:</td>
-          <td>{$forms.timeRecordForm.group.control}</td>
-        </tr>
-{/if}
 {if $user_dropdown}
         <tr>
           <td align="right">{$i18n.label.user}:</td>
@@ -72,7 +66,7 @@
 {if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
         <tr>
           <td align="right">{$i18n.label.duration}:</td>
-          <td>{$forms.timeRecordForm.duration.control}&nbsp;{if $user->decimal_mark == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}</td>
+          <td>{$forms.timeRecordForm.duration.control}&nbsp;{if $user->getDecimalMark() == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}</td>
         </tr>
 {/if}
       </table>
index 7e4e8ad..013f15c 100644 (file)
--- a/time.php
+++ b/time.php
@@ -48,11 +48,6 @@ if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId
   exit();
 }
 if ($request->isPost()) {
-  $groupChanged = $request->getParameter('group_changed'); // Reused in multiple places below.
-  if ($groupChanged && !($user->can('manage_subgroups') && $user->isGroupValid($request->getParameter('group')))) {
-    header('Location: access_denied.php'); // Group changed, but no rght or wrong group id.
-    exit();
-  }
   $userChanged = $request->getParameter('user_changed'); // Reused in multiple places below.
   if ($userChanged && !($user->can('track_time') && $user->isUserValid($request->getParameter('user')))) {
     header('Location: access_denied.php'); // Group changed, but no rght or wrong user id.
@@ -61,13 +56,6 @@ if ($request->isPost()) {
 }
 // End of access checks.
 
-// Determine group for which we display this page.
-if ($request->isPost() && $groupChanged) {
-  $group_id = $request->getParameter('group');
-  $user->setOnBehalfGroup($group_id);
-} else {
-  $group_id = $user->getGroup();
-}
 // Determine user for which we display this page.
 if ($request->isPost() && $userChanged) {
   $user_id = $request->getParameter('user');
@@ -76,6 +64,8 @@ if ($request->isPost() && $userChanged) {
   $user_id = $user->getUser();
 }
 
+$group_id = $user->getGroup();
+
 // Initialize and store date in session.
 $cl_date = $request->getParameter('date', @$_SESSION['date']);
 $selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date);
@@ -132,21 +122,6 @@ $_SESSION['task'] = $cl_task;
 
 // Elements of timeRecordForm.
 $form = new Form('timeRecordForm');
-// Group dropdown.
-if ($user->can('manage_subgroups')) {
-  $groups = $user->getGroupsForDropdown();
-  if (count($groups) > 1) {
-    $form->addInput(array('type'=>'combobox',
-      'onchange'=>'document.timeRecordForm.group_changed.value=1;document.timeRecordForm.submit();',
-      'name'=>'group',
-      'style'=>'width: 250px;',
-      'value'=>$group_id,
-      'data'=>$groups,
-      'datakeys'=>array('id','name')));
-    $form->addInput(array('type'=>'hidden','name'=>'group_changed'));
-    $smarty->assign('group_dropdown', 1);
-  }
-}
 if ($user->can('track_time')) {
   $rank = $user->getMaxRankForGroup($group_id);
   if ($user->can('track_own_time'))
@@ -405,7 +380,7 @@ $smarty->assign('project_list', $project_list);
 $smarty->assign('task_list', $task_list);
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="fillDropdowns()"');
-$smarty->assign('timestring', $selected_date->toString($user->date_format));
+$smarty->assign('timestring', $selected_date->toString($user->getDateFormat()));
 $smarty->assign('title', $i18n->get('title.time'));
 $smarty->assign('content_page_name', 'time.tpl');
 $smarty->display('index.tpl');