Siwtched to using isPost() function
[timetracker.git] / cf_custom_field_add.php
index a505305..d6766ef 100644 (file)
@@ -36,7 +36,7 @@ if (!ttAccessCheck(right_manage_team)) {
   exit();
 }
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   $cl_field_name = trim($request->getParameter('name'));
   $cl_field_type = $request->getParameter('type');
   $cl_required = $request->getParameter('required');
@@ -53,7 +53,7 @@ $form->addInput(array('type'=>'combobox','name'=>'type',
 $form->addInput(array('type'=>'checkbox','name'=>'required','data'=>1,'value'=>'0'));
 $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));       
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   // Validate user input.
   if (!ttValidString($cl_field_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));