X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/251996aed11c648ecaa30f77383e0384bfadf7a5..62da0ed23af9ae74faf8d103bc3ce025c56b673e:/cf_custom_field_delete.php diff --git a/cf_custom_field_delete.php b/cf_custom_field_delete.php index 6f42e31f..78cd380b 100644 --- a/cf_custom_field_delete.php +++ b/cf_custom_field_delete.php @@ -41,20 +41,19 @@ $id = $request->getParameter('id'); $form = new Form('fieldDeleteForm'); if ($request->getMethod() == 'POST') { - if ($request->getParameter('btn_delete')) { - // Delete button pressed. - $res = CustomFields::deleteField($id); + if ($request->getParameter('btn_delete')) { + // Delete button pressed. + $res = CustomFields::deleteField($id); if ($res) { header('Location: cf_custom_fields.php'); exit(); - } else { + } else $errors->add($i18n->getKey('error.db')); - } } if ($request->getParameter('btn_cancel')) { - // Cancel button pressed. - header('Location: cf_custom_fields.php'); - exit(); + // Cancel button pressed. + header('Location: cf_custom_fields.php'); + exit(); } } else { $field = CustomFields::getField($id); @@ -67,11 +66,10 @@ if ($request->getMethod() == 'POST') { $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()"'); $smarty->assign('title', $i18n->getKey('title.cf_delete_custom_field')); $smarty->assign('content_page_name', 'cf_custom_field_delete.tpl'); $smarty->display('index.tpl'); -?> \ No newline at end of file