Switched to using shorter ActionErrors functions
[timetracker.git] / client_edit.php
index 373263c..d594222 100644 (file)
@@ -77,7 +77,7 @@ if ($request->getMethod() == 'POST') {
   if (!ttValidString($cl_address, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_address'));
   if (!ttValidFloat($cl_tax, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.tax'));
 
-  if ($errors->isEmpty()) {
+  if ($errors->no()) {
     if ($request->getParameter('btn_save')) {
       $client = ttClientHelper::getClientByName($cl_name);
       if (($client && ($cl_id == $client['id'])) || !$client) {
@@ -91,7 +91,7 @@ if ($request->getMethod() == 'POST') {
           header('Location: clients.php');
           exit();
         } else
-          $errors->add($i18n->getKey('error.db'));     
+          $errors->add($i18n->getKey('error.db'));
       } else
         $errors->add($i18n->getKey('error.client_exists'));
     }
@@ -113,7 +113,7 @@ if ($request->getMethod() == 'POST') {
         $errors->add($i18n->getKey('error.client_exists'));
     }
   }
-} // post
+} // POST
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('title', $i18n->getKey('title.edit_client'));