X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/3705caa8680d82736ab1a1d21e8829bed1226341..a7ba11adfecf6cb906749efe5abce688363aef07:/mobile/time_edit.php diff --git a/mobile/time_edit.php b/mobile/time_edit.php index d6dc7d1e..83e89154 100644 --- a/mobile/time_edit.php +++ b/mobile/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')); @@ -207,7 +207,7 @@ $form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // $form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save'))); $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) @@ -275,12 +275,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 == ''); @@ -294,13 +294,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),