projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reorganized code a bit.
[timetracker.git]
/
mobile
/
time_delete.php
diff --git
a/mobile/time_delete.php
b/mobile/time_delete.php
index
be9d498
..
9e818e7
100644
(file)
--- a/
mobile/time_delete.php
+++ b/
mobile/time_delete.php
@@
-53,7
+53,7
@@
if ($time_rec['invoice_id']) die($i18n->getKey('error.sys'));
// Escape comment for presentation.
$time_rec['comment'] = htmlspecialchars($time_rec['comment']);
// Escape comment for presentation.
$time_rec['comment'] = htmlspecialchars($time_rec['comment']);
-if ($request->
getMethod() == 'POST'
) {
+if ($request->
isPost()
) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it's okay to delete the record.
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it's okay to delete the record.
@@
-70,10
+70,10
@@
if ($request->getMethod() == 'POST') {
$uncompleted = ($time_rec['duration'] == '0:00');
if($lockdate && $item_date->before($lockdate) && !$uncompleted) {
$uncompleted = ($time_rec['duration'] == '0:00');
if($lockdate && $item_date->before($lockdate) && !$uncompleted) {
- $err
ors
->add($i18n->getKey('error.period_locked'));
+ $err->add($i18n->getKey('error.period_locked'));
}
}
- if ($err
ors->isEmpty
()) {
+ if ($err
->no
()) {
// Delete the record.
$result = ttTimeHelper::delete($cl_id, $user->getActiveUser());
// Delete the record.
$result = ttTimeHelper::delete($cl_id, $user->getActiveUser());
@@
-82,7
+82,7
@@
if ($request->getMethod() == 'POST') {
header('Location: time.php');
exit();
} else {
header('Location: time.php');
exit();
} else {
- $err
ors
->add($i18n->getKey('error.db'));
+ $err->add($i18n->getKey('error.db'));
}
}
}
}
}
}
@@
-90,7
+90,7
@@
if ($request->getMethod() == 'POST') {
header('Location: time.php');
exit();
}
header('Location: time.php');
exit();
}
-} //
POST
+} //
isPost
$form = new Form('timeRecordForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
$form = new Form('timeRecordForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));