projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split data_entry right into track_time and track_expenses.
[timetracker.git]
/
week.php
diff --git
a/week.php
b/week.php
index
44a05bd
..
6bd2d49
100644
(file)
--- a/
week.php
+++ b/
week.php
@@
-39,7
+39,7
@@
import('ttTimeHelper');
import('DateAndTime');
// Access check.
import('DateAndTime');
// Access check.
-if (!ttAccess
Check(right_data_entry
) || !$user->isPluginEnabled('wv')) {
+if (!ttAccess
Allowed('track_own_time'
) || !$user->isPluginEnabled('wv')) {
header('Location: access_denied.php');
exit();
}
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) {
$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.
$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.
}
}
// Do not process if value has not changed.