]> wagnertech.de Git - timetracker.git/blobdiff - cf_dropdown_option_delete.php
Siwtched to using isPost() function
[timetracker.git] / cf_dropdown_option_delete.php
index 404896fa4c16d6611d62962c3d805c4484c30af3..270d56f5a031d6cea8afe6a15d48f3df8c54d43a 100644 (file)
@@ -39,7 +39,7 @@ if (!ttAccessCheck(right_manage_team)) {
 $cl_id = $request->getParameter('id');
 $form = new Form('optionDeleteForm');
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
 
   // Determine field id for redirect.
   $field_id = CustomFields::getFieldIdForOption($cl_id);
@@ -58,17 +58,17 @@ if ($request->getMethod() == 'POST') {
     exit();
   }
 } else {
-  $option = CustomFields::getOptionName($cl_id);       
+  $option = CustomFields::getOptionName($cl_id);
   if (false === $option)
     $errors->add($i18n->getKey('error.db'));
 
-  if ($errors->isEmpty()) {
+  if ($errors->no()) {
     $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_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('option', $option);
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="document.optionDeleteForm.btn_cancel.focus()"');