X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=cf_custom_field_delete.php;h=86fa7d87100be6f8cec838418bca37d4d16aca50;hb=a07b6f8bccda226991ced6fe25f1c9c508e423e5;hp=78cd380bb404d3bcdb4c763f3dba89623a890ef0;hpb=0e3c4d629800de449c5a1bb9da780993e5dc5277;p=timetracker.git diff --git a/cf_custom_field_delete.php b/cf_custom_field_delete.php index 78cd380b..86fa7d87 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); @@ -48,7 +48,7 @@ if ($request->getMethod() == 'POST') { header('Location: cf_custom_fields.php'); exit(); } else - $errors->add($i18n->getKey('error.db')); + $err->add($i18n->getKey('error.db')); } if ($request->getParameter('btn_cancel')) { // Cancel button pressed. @@ -58,9 +58,9 @@ if ($request->getMethod() == 'POST') { } else { $field = CustomFields::getField($id); if (false === $field) - $errors->add($i18n->getKey('error.db')); + $err->add($i18n->getKey('error.db')); - if ($errors->isEmpty()) { + if ($err->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')));