From a079c840acbc147af950bff07ba7b7dac0de6131 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 13 Dec 2018 21:06:08 +0000 Subject: [PATCH] Removed group selector from time.php to keep things simple. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/time.tpl | 8 +------- time.php | 31 +++---------------------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ce84ca07..f550c35f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.30.4649 | Copyright © Anuko | +  Anuko Time Tracker 1.18.30.4650 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/time.tpl b/WEB-INF/templates/time.tpl index bb862871..76338706 100644 --- a/WEB-INF/templates/time.tpl +++ b/WEB-INF/templates/time.tpl @@ -18,12 +18,6 @@
-{if $group_dropdown} - - - - -{/if} {if $user_dropdown} @@ -72,7 +66,7 @@ {if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))} - + {/if}
{$i18n.label.group}:{$forms.timeRecordForm.group.control}
{$i18n.label.user}:
{$i18n.label.duration}:{$forms.timeRecordForm.duration.control} {if $user->decimal_mark == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}{$forms.timeRecordForm.duration.control} {if $user->getDecimalMark() == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}
diff --git a/time.php b/time.php index 7e4e8adc..013f15ca 100644 --- 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'); -- 2.20.1