X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/16cbd33bec16854f1b6a4caf4ac24ededc8326f3..c138ab042a599beb780895e5a5f54a1b287d67ae:/week.php diff --git a/week.php b/week.php index 44a05bdc..6bd2d492 100644 --- a/week.php +++ b/week.php @@ -39,7 +39,7 @@ import('ttTimeHelper'); import('DateAndTime'); // Access check. -if (!ttAccessCheck(right_data_entry) || !$user->isPluginEnabled('wv')) { +if (!ttAccessAllowed('track_own_time') || !$user->isPluginEnabled('wv')) { header('Location: access_denied.php'); exit(); } @@ -368,11 +368,12 @@ if ($request->isPost()) { $existingDuration = $dataArray[$rowNumber][$dayHeader]['duration']; // If posted value is not null, check and normalize it. if ($postedDuration) { - if (ttTimeHelper::isValidDuration($postedDuration)) { - $postedDuration = ttTimeHelper::normalizeDuration($postedDuration, false); // No leading zero. - } else { + if (false === ttTimeHelper::postedDurationToMinutes($postedDuration)) { $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); $result = false; break; // Break out. Stop any further processing. + } else { + $minutes = ttTimeHelper::postedDurationToMinutes($postedDuration); + $postedDuration = ttTimeHelper::minutesToDuration($minutes); } } // Do not process if value has not changed.