X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/e457063f931911a1e9fc0917767dc07f92d24f02..a7ba11adfecf6cb906749efe5abce688363aef07:/cf_custom_field_delete.php diff --git a/cf_custom_field_delete.php b/cf_custom_field_delete.php index 4e17cd03..162ddeb1 100644 --- a/cf_custom_field_delete.php +++ b/cf_custom_field_delete.php @@ -40,7 +40,7 @@ $id = $request->getParameter('id'); $form = new Form('fieldDeleteForm'); -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { if ($request->getParameter('btn_delete')) { // Delete button pressed. $res = CustomFields::deleteField($id); @@ -60,13 +60,13 @@ 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'))); } } - + $smarty->assign('field', $field['label']); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fieldDeleteForm.btn_cancel.focus()"');