X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/b5d95bbf6e8ce2b60c6640cdee5571025524e1a6..a7ba11adfecf6cb906749efe5abce688363aef07:/cf_dropdown_option_edit.php diff --git a/cf_dropdown_option_edit.php b/cf_dropdown_option_edit.php index eff95b1d..0f47e184 100644 --- a/cf_dropdown_option_edit.php +++ b/cf_dropdown_option_edit.php @@ -42,19 +42,19 @@ if (false === $cl_name) $errors->add($i18n->getKey('error.db')); $form = new Form('optionEditForm'); -if ($errors->isEmpty()) { +if ($errors->no()) { $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>$cl_name)); $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id)); $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); -} +} -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { $cl_name = trim($request->getParameter('name')); - + // 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::updateOption($cl_id, $cl_name); if ($res) { // Determine field id for redirect. @@ -64,7 +64,7 @@ if ($request->getMethod() == 'POST') { } else $errors->add($i18n->getKey('error.db')); } -} +} // POST $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.optionEditForm.name.focus()"');