X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=time_delete.php;h=273cba3534b8a69c4aae36420eae708a60e64abb;hb=05b0f8e4762b8a2ca2002a8f7545b7ff68cc3925;hp=e07d1d3390f434b1529e62b121a77fbfeb9f6d57;hpb=b027832862272283d9203c994ec8fd39f6196887;p=timetracker.git diff --git a/time_delete.php b/time_delete.php index e07d1d33..273cba35 100644 --- a/time_delete.php +++ b/time_delete.php @@ -38,12 +38,6 @@ if (!ttAccessCheck(right_data_entry)) { exit(); } -// Use Custom Fields plugin if we have one. -// if (file_exists("plugins/CustomFields.class.php")) { -// require_once("plugins/CustomFields.class.php"); -// $custom_fields = new CustomFields($user->team_id); -// } - $cl_id = $request->getParameter('id'); $time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser()); @@ -53,7 +47,7 @@ if ($time_rec['invoice_id']) die($i18n->getKey('error.sys')); // 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. @@ -69,10 +63,10 @@ if ($request->getMethod() == 'POST') { $uncompleted = ($time_rec['duration'] == '0:00'); if($lockdate && $item_date->before($lockdate) && !$uncompleted) { - $errors->add($i18n->getKey('error.period_locked')); + $err->add($i18n->getKey('error.period_locked')); } - if ($errors->isEmpty()) { + if ($err->no()) { // Delete the record. $result = ttTimeHelper::delete($cl_id, $user->getActiveUser()); @@ -81,7 +75,7 @@ if ($request->getMethod() == 'POST') { header('Location: time.php'); exit(); } else { - $errors->add($i18n->getKey('error.db')); + $err->add($i18n->getKey('error.db')); } } } @@ -89,7 +83,7 @@ if ($request->getMethod() == 'POST') { header('Location: time.php'); exit(); } -} // POST +} // isPost $form = new Form('timeRecordForm'); $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));