X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/0422997f99a43220229bb0fae82ce64c6bfcd7a2..a7ba11adfecf6cb906749efe5abce688363aef07:/time_edit.php diff --git a/time_edit.php b/time_edit.php index d362709e..c66ae578 100644 --- a/time_edit.php +++ b/time_edit.php @@ -59,7 +59,7 @@ $item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']); // Initialize variables. $cl_start = $cl_finish = $cl_duration = $cl_date = $cl_note = $cl_project = $cl_task = $cl_billable = null; -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { $cl_start = trim($request->getParameter('start')); $cl_finish = trim($request->getParameter('finish')); $cl_duration = trim($request->getParameter('duration')); @@ -208,7 +208,7 @@ $form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_to $form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.copy'))); $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete'))); -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { // Validate user input. if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client) @@ -276,12 +276,12 @@ if ($request->getMethod() == 'POST') { // 3) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists. // Now, step by step. - if ($errors->isEmpty()) { + if ($errors->no()) { // 1) Prohibit saving locked time entries in any form. if($lockdate && $item_date->before($lockdate)) $errors->add($i18n->getKey('error.period_locked')); // 2) Prohibit saving completed unlocked entries into locked interval. - if($errors->isEmpty() && $lockdate && $new_date->before($lockdate)) + if($errors->no() && $lockdate && $new_date->before($lockdate)) $errors->add($i18n->getKey('error.period_locked')); // 3) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists. $uncompleted = ($cl_finish == '' && $cl_duration == ''); @@ -295,13 +295,13 @@ if ($request->getMethod() == 'POST') { } // Prohibit creating an overlapping record. - if ($errors->isEmpty()) { + if ($errors->no()) { if (ttTimeHelper::overlaps($user->getActiveUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id)) $errors->add($i18n->getKey('error.overlap')); } // Now, an update. - if ($errors->isEmpty()) { + if ($errors->no()) { $res = ttTimeHelper::update(array( 'id'=>$cl_id, 'date'=>$new_date->toString(DB_DATEFORMAT), @@ -337,7 +337,7 @@ if ($request->getMethod() == 'POST') { // 2) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists. // Now, step by step. - if ($errors->isEmpty()) { + if ($errors->no()) { // 1) Prohibit saving into locked interval. if($lockdate && $new_date->before($lockdate)) $errors->add($i18n->getKey('error.period_locked')); @@ -353,13 +353,13 @@ if ($request->getMethod() == 'POST') { } // Prohibit creating an overlapping record. - if ($errors->isEmpty()) { + if ($errors->no()) { if (ttTimeHelper::overlaps($user->getActiveUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish)) $errors->add($i18n->getKey('error.overlap')); } // Now, a new insert. - if ($errors->isEmpty()) { + if ($errors->no()) { $id = ttTimeHelper::insert(array( 'date'=>$new_date->toString(DB_DATEFORMAT),