]> wagnertech.de Git - timetracker.git/commitdiff
A bit of cleanup with ongoing timesheet redesign.
authorNik Okuntseff <support@anuko.com>
Wed, 27 Feb 2019 21:02:28 +0000 (21:02 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 27 Feb 2019 21:02:28 +0000 (21:02 +0000)
33 files changed:
WEB-INF/resources/ca.lang.php
WEB-INF/resources/cs.lang.php
WEB-INF/resources/da.lang.php
WEB-INF/resources/de.lang.php
WEB-INF/resources/en.lang.php
WEB-INF/resources/es.lang.php
WEB-INF/resources/et.lang.php
WEB-INF/resources/fa.lang.php
WEB-INF/resources/fi.lang.php
WEB-INF/resources/fr.lang.php
WEB-INF/resources/gr.lang.php
WEB-INF/resources/he.lang.php
WEB-INF/resources/hu.lang.php
WEB-INF/resources/it.lang.php
WEB-INF/resources/ja.lang.php
WEB-INF/resources/ko.lang.php
WEB-INF/resources/nl.lang.php
WEB-INF/resources/no.lang.php
WEB-INF/resources/pl.lang.php
WEB-INF/resources/pt-br.lang.php
WEB-INF/resources/pt.lang.php
WEB-INF/resources/ro.lang.php
WEB-INF/resources/ru.lang.php
WEB-INF/resources/sk.lang.php
WEB-INF/resources/sl.lang.php
WEB-INF/resources/sr.lang.php
WEB-INF/resources/sv.lang.php
WEB-INF/resources/tr.lang.php
WEB-INF/resources/zh-cn.lang.php
WEB-INF/resources/zh-tw.lang.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/timesheets.tpl
timesheets.php

index 29347170090bf6ae9633163102f4e60d635cecc8..d4d24c728bec1718da705278aa01aa1d0da181d0 100644 (file)
@@ -467,7 +467,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index c85cb6867314c3a950994298684c4727791a817a..2ca15cc9a84cdda455987e3aa409ba12efdd2968 100644 (file)
@@ -477,7 +477,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 3dfb41c870505a65ab13554dc29ee97558395e40..de4813f65f665b0ec85db0bf9ff29d8342a01d71 100644 (file)
@@ -441,7 +441,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index c787f6d87dbcbda707ecebf86f381dc94e86748c..a14e345277a82f4f7eb695c1627519805cb6335b 100644 (file)
@@ -420,7 +420,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 5c91c3ee43713a7fa36cb3e38e80b9f937c34d51..b6f0054b5a93c2200a6dbf8c879e39224ac8ba1c 100644 (file)
@@ -415,7 +415,6 @@ $i18n_key_words = array(
 'form.report.assign_to_invoice' => 'Assign to invoice',
 
  // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
-'form.timesheets.hint' => 'Use reports to add new timesheets.',
 'form.timesheets.active_timesheets' => 'Active Timesheets',
 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index c86741762e8389dca427fc9689436387fad58b28..99c4431da9e8c7ca7582eab80f81e37ccfa2599e 100644 (file)
@@ -480,7 +480,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 7f2fe8eb052511db14ca6144e4eb408c7669a46f..4f40c7e77b11fc5fc9f1d0711242c0ff25b4faab 100644 (file)
@@ -445,7 +445,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index fdbcdba5f62bae0130a22a13bb2e154a83e31e64..566b50811c5f993a7d147eeb494844c8fda621d6 100644 (file)
@@ -461,7 +461,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index bc66a226454afe109fb5e0beded8dfc4628380b4..226e8496d4ab1f8ab0ad5ac9cf3d6fadafbfce7a 100644 (file)
@@ -446,7 +446,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 840f85590ac83a336d64b8c86cb0bcf40557aac7..a90cc042b29de32b281cf5135526ef655fc9dd34 100644 (file)
@@ -438,7 +438,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 2ebdaa8f317e7c7b04d8c265e22e17837678fede..7257a33f9b3ac87564734da5c2b7e3d582df754c 100644 (file)
@@ -429,7 +429,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index cac16e9c52c5fa7d6fe51d4002a775ce8f31a438..47c06c8599be4b614e2290e4a8de369384db0801 100644 (file)
@@ -468,7 +468,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index f4d5dd1390ad91c4bee2673a868b7a0470ba1926..bd699aca0addc4cfc4369a9f5a4099c5486c8d82 100644 (file)
@@ -470,7 +470,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 3d898e2f2771691ff6e9651a442ad2cadb69208f..351c1cd66e3ff2b5551fc49fb9da857c21b4c121 100644 (file)
@@ -442,7 +442,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 7f1a841199f0f4db97fcac5960b6690de12d580b..53f1c5066830f51a271584d2057b7b2b3eda8001 100644 (file)
@@ -475,7 +475,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index c5b7e0a219468247bac4ea50e252aac54e79c301..d8da0d813da85f8895e69741d8a0aba8b3968e58 100644 (file)
@@ -473,7 +473,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 7307ec4a9db80120d573bbed92b7ed5bc7d9e32c..848e0f3499ed80757ad53359efe77299d1cb3610 100644 (file)
@@ -416,7 +416,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index a050711670fcb44d1e0dfe02ef90f4328e57a210..1474cac3128c957a77fb11e936d33fcf8c5c6180 100644 (file)
@@ -472,7 +472,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 28e8a0aceb31641502c22567a5e414a0adc99807..94a094e8f22ebe5eef322098b59035aaa12f5725 100644 (file)
@@ -449,7 +449,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 74e5822f05e5e53e9ffffb4ea1acba74d02b07c4..a10fe4c633c9f4493c1664de7db3c045439ac90c 100644 (file)
@@ -444,7 +444,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index e1e6b29d8413fe3d5e7dc3d77c5600c2e6a88d56..9da1e3588207a6fcb3bfb55b4b25ac43fc1cf726 100644 (file)
@@ -451,7 +451,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index cf701cf63ebc8ecf4925c00001a31f9e7c0640de..70fc0ac19f38d4acaeb647ced7ff06cddb3f0c79 100644 (file)
@@ -475,7 +475,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 2fec5db797a07ac54f8ab25d9574c4089d8c64c7..6c1daa2460ac533ab32ba18f8dc845cf1aa14767 100644 (file)
@@ -406,7 +406,6 @@ $i18n_key_words = array(
 'form.report.assign_to_invoice' => 'Включить в счёт',
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
-'form.timesheets.hint' => 'Используйте отчёты для добавления новых табелей.',
 'form.timesheets.active_timesheets' => 'Активные табели',
 'form.timesheets.inactive_timesheets' => 'Неактивные табели',
 
index 08999f1dec2000163ddbfe985fa1bddfff73127a..a1253d9b3c90fe612f18436896b33d2d904a68dd 100644 (file)
@@ -458,7 +458,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 95d3f85873b9684ccad4d842daac3fb5ed39897c..68e2df6a8cd275501fe2d1e8206ad534f5f004ef 100644 (file)
@@ -449,7 +449,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 170e5409f5c10f7b950c2f7d96a5320b33939848..8976bda590d9e59e23e993d02b37b2cafd32b64b 100644 (file)
@@ -447,7 +447,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index be3f4f28057fe9d31f8aef1efab16a43fe53955b..715481d3a9f2a40ae603c410bce4cbb84fd736bd 100644 (file)
@@ -445,7 +445,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index e30ddf06a902211cea1a9fbb2190c6db42a5ed9a..eb92614a9e4daa75ee567476b8504e5d2767fcc0 100644 (file)
@@ -486,7 +486,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 05fa7a88edb37d09494d148f7be296ef78a3df39..d31db325969e224db8ec71cfa2b6b70b007e7b2c 100644 (file)
@@ -458,7 +458,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 760e9acfa8ef8bd087b8ed04e12e453d3cbd54b3..ca0dad53a176812967fafbe5a759e8ca25530f38 100644 (file)
@@ -466,7 +466,6 @@ $i18n_key_words = array(
 
 // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
 // TODO: translate the following.
-// form.timesheets.hint' => 'Use reports to add new timesheets.',
 // 'form.timesheets.active_timesheets' => 'Active Timesheets',
 // 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
 
index 25f41decf6498be60e92dcf0644ab5949f409b9e..5b3b25e2004939bfcc1ed5c86c37c071656908d1 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.46.4790 | 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.46.4791 | 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 f9b89d79272f62fe7b31953273c35b1128750073..af65d14b5772263aa93ba3abaddbfc98095d8673 100644 (file)
@@ -4,9 +4,6 @@
 
 {$forms.timesheetsForm.open}
 <table cellspacing="0" cellpadding="7" border="0" width="720">
-{if $not_client}
-  <tr><td align="left">{$i18n.form.timesheets.hint}<br></td></tr>
-{/if}
 {if $user_dropdown}
   <tr><td align="center">{$i18n.label.user}: {$forms.timesheetsForm.user.control}</td></tr>
 {/if}
index 546a7b638409d6055ebcb1206ae4bac406030854..cc43f0dd3339f12bc555764b4b859b41e5aa666f 100644 (file)
@@ -41,48 +41,38 @@ if (!$user->isPluginEnabled('ts')) {
   exit();
 }
 if ($user->isClient()) {
-  $users_for_client = ttGroupHelper::getUsersForClient($user->client_id);
-  if (count($users_for_client) == 0) {
-    header('Location: access_denied.php'); // There are no users for client.
-    exit();
-  }
+  header('Location: access_denied.php'); // No timesheets for clients.
+  exit();
 }
 if ($request->isPost()) {
-  $userChanged = $request->getParameter('user_changed');
-  if ($userChanged && !(ttTimesheetHelper::isUserValid($request->getParameter('user')))) {
-    header('Location: access_denied.php'); // Wrong user id.
+  $userChanged = $request->getParameter('user_changed'); // Reused in multiple places below.
+  if ($userChanged && !($user->can('view_timesheets') && $user->isUserValid($request->getParameter('user')))) {
+    header('Location: access_denied.php'); // Group changed, but no rght or wrong user id. TODO: research relevance of this...
     exit();
   }
 }
 // End of access checks.
 
-// Determine user for whom we display this page.
-$notClient = !$user->isClient();
+// Determine user for which we display this page.
 if ($request->isPost() && $userChanged) {
   $user_id = $request->getParameter('user');
+  $user->setOnBehalfUser($user_id);
 } else {
-  if ($notClient)
-    $user_id = $user->getUser();
-  else
-    $user_id = $users_for_client[0]['id']; // First found user for a client.
+  $user_id = $user->getUser();
 }
+
 $group_id = $user->getGroup();
 
 // Elements of timesheetsForm.
 $form = new Form('timesheetsForm');
 
 if ($user->can('view_timesheets') || $user->can('view_all_timesheets')) {
-  // Prepare user list for dropdown.
-  if ($notClient) {
-    $rank = $user->can('view_all_timesheets') ? MAX_RANK : $user->getMaxRankForGroup($group_id);
-    if ($user->can('view_own_timesheets'))
-      $options = array('max_rank'=>$rank,'include_self'=>true,'self_first'=>true);
-    else
-      $options = array('max_rank'=>$rank);
-    $user_list = $user->getUsers($options);
-  } else
-    $user_list = $users_for_client; // Obtained above.
-
+  $rank = $user->getMaxRankForGroup($group_id);
+  if ($user->can('view_own_timesheets'))
+    $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_self'=>true,'self_first'=>true);
+  else
+    $options = array('status'=>ACTIVE,'max_rank'=>$rank);
+  $user_list = $user->getUsers($options);
   if (count($user_list) >= 1) {
     $form->addInput(array('type'=>'combobox',
       'onchange'=>'document.timesheetsForm.user_changed.value=1;document.timesheetsForm.submit();',
@@ -97,17 +87,14 @@ if ($user->can('view_timesheets') || $user->can('view_all_timesheets')) {
 }
 
 $active_timesheets = ttTimesheetHelper::getActiveTimesheets($user_id);
-if ($notClient)
-  $inactive_timesheets = ttTimesheetHelper::getInactiveTimesheets($user_id);
+$inactive_timesheets = ttTimesheetHelper::getInactiveTimesheets($user_id);
 
-$showClient = $user->isPluginEnabled('cl') && $notClient;
-$canEdit = $notClient && ($user->can('manage_own_timesheets') ||
-  $user->can('manage_timesheets') || $user->can('manage_all_timesheets'));
+$showClient = $user->isPluginEnabled('cl');
+$canEdit = $user->can('manage_own_timesheets') || $user->can('manage_timesheets') || $user->can('manage_all_timesheets');
 
 $smarty->assign('active_timesheets', $active_timesheets);
 $smarty->assign('inactive_timesheets', $inactive_timesheets);
 $smarty->assign('show_client', $showClient);
-$smarty->assign('not_client', $notClient);
 $smarty->assign('can_edit', $canEdit);
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('title', $i18n->get('title.timesheets'));