X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=cf_custom_field_edit.php;h=15146db67b00db3665c2a6b5d6320455bb87cbef;hb=b027832862272283d9203c994ec8fd39f6196887;hp=71ffd39cd9fb8238f5b4d6400b4d54dbc8fd547f;hpb=5ef582473f6b329be18ad83c61e053fdcd9c6ed5;p=timetracker.git diff --git a/cf_custom_field_edit.php b/cf_custom_field_edit.php index 71ffd39c..15146db6 100644 --- a/cf_custom_field_edit.php +++ b/cf_custom_field_edit.php @@ -48,10 +48,9 @@ if ($errors->isEmpty()) { $form->addInput(array('type'=>'checkbox','name'=>'required','data'=>1,'value'=>$field['required'])); $form->addInput(array('type'=>'combobox','name'=>'type','value'=>$field['type'], 'data'=>array(CustomFields::TYPE_TEXT=>$i18n->getKey('label.type_text'), - CustomFields::TYPE_DROPDOWN=>$i18n->getKey('label.type_dropdown')) - )); - $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); -} + CustomFields::TYPE_DROPDOWN=>$i18n->getKey('label.type_dropdown')))); + $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); +} if ($request->getMethod() == 'POST') { $cl_name = trim($request->getParameter('name')); @@ -59,7 +58,7 @@ if ($request->getMethod() == 'POST') { $cl_required = $request->getParameter('required'); if (!$cl_required) $cl_required = 0; - + // Validate user input. if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name')); @@ -68,11 +67,10 @@ if ($request->getMethod() == 'POST') { if ($res) { header('Location: cf_custom_fields.php'); exit(); - } else { + } else $errors->add($i18n->getKey('error.db')); - } } -} +} // POST $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fieldForm.name.focus()"');