]> wagnertech.de Git - timetracker.git/blobdiff - mobile/time_edit.php
Siwtched to using isPost() function
[timetracker.git] / mobile / time_edit.php
index d6dc7d1ef770785b86f88098148fe0b6212fbdf4..83e8915464913699132524879d3dede81cacd9e0 100644 (file)
@@ -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),