From: Nik Okuntseff Date: Tue, 22 Mar 2016 00:00:09 +0000 (-0700) Subject: Started to use shorter functions of the Errors class X-Git-Tag: timetracker_1.19-1~1799 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=437925de08860894e489db00c1d2d967c18267a2;p=timetracker.git Started to use shorter functions of the Errors class --- diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 67cb9391..f9543921 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.16.3429 | Copyright © Anuko | +  Anuko Time Tracker 1.9.16.3430 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/mobile/header.tpl b/WEB-INF/templates/mobile/header.tpl index 5b4d1fd4..a2b23116 100644 --- a/WEB-INF/templates/mobile/header.tpl +++ b/WEB-INF/templates/mobile/header.tpl @@ -55,7 +55,7 @@ -{if !$errors->isEmpty()} +{if $errors->yes()}
diff --git a/admin_team_add.php b/admin_team_add.php index 3ce0e662..5ece36dc 100644 --- a/admin_team_add.php +++ b/admin_team_add.php @@ -71,7 +71,7 @@ if ($request->getMethod() == 'POST') { } if (!ttValidEmail($cl_manager_email, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.email')); - if ($errors->isEmpty()) { + if ($errors->no()) { if (!ttUserHelper::getUserByLogin($cl_manager_login)) { // Create a new team. if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$'); diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index 056ce531..a5053054 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -57,7 +57,7 @@ if ($request->getMethod() == 'POST') { // Validate user input. if (!ttValidString($cl_field_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name')); - if ($errors->isEmpty()) { + if ($errors->no()) { $res = CustomFields::insertField($cl_field_name, $cl_field_type, $cl_required); if ($res) { header('Location: cf_custom_fields.php'); diff --git a/cf_custom_field_delete.php b/cf_custom_field_delete.php index 78cd380b..139253d4 100644 --- a/cf_custom_field_delete.php +++ b/cf_custom_field_delete.php @@ -60,7 +60,7 @@ if ($request->getMethod() == 'POST') { if (false === $field) $errors->add($i18n->getKey('error.db')); - if ($errors->isEmpty()) { + if ($errors->no()) { $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$id)); $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete'))); $form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel'))); diff --git a/cf_custom_field_edit.php b/cf_custom_field_edit.php index 15146db6..b6a1f461 100644 --- a/cf_custom_field_edit.php +++ b/cf_custom_field_edit.php @@ -42,7 +42,7 @@ if (false === $field) $errors->add($i18n->getKey('error.db')); $form = new Form('fieldForm'); -if ($errors->isEmpty()) { +if ($errors->no()) { $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>$field['label'])); $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id)); $form->addInput(array('type'=>'checkbox','name'=>'required','data'=>1,'value'=>$field['required'])); @@ -62,7 +62,7 @@ if ($request->getMethod() == 'POST') { // Validate user input. if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name')); - if ($errors->isEmpty()) { + if ($errors->no()) { $res = CustomFields::updateField($cl_id, $cl_name, $cl_type, $cl_required); if ($res) { header('Location: cf_custom_fields.php');