Switched to using shorter ActionErrors functions
[timetracker.git] / mobile / time_edit.php
index d6dc7d1..87dc587 100644 (file)
@@ -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),