X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/0e3c4d629800de449c5a1bb9da780993e5dc5277..a7ba11adfecf6cb906749efe5abce688363aef07:/client_add.php diff --git a/client_add.php b/client_add.php index b7187056..1bdb1609 100644 --- a/client_add.php +++ b/client_add.php @@ -39,7 +39,7 @@ if (!ttAccessCheck(right_manage_team)) { $projects = ttTeamHelper::getActiveProjects($user->team_id); -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { $cl_name = trim($request->getParameter('name')); $cl_address = trim($request->getParameter('address')); $cl_tax = $request->getParameter('tax'); @@ -58,13 +58,13 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t $form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'layout'=>'H','datakeys'=>array('id','name'),'value'=>$cl_projects)); $form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.add'))); -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { // Validate user input. if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_name')); if (!ttValidString($cl_address, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_address')); if (!ttValidFloat($cl_tax, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.tax')); - if ($errors->isEmpty()) { + if ($errors->no()) { if (!ttClientHelper::getClientByName($cl_name)) { if (ttClientHelper::insert(array( 'team_id' => $user->team_id, @@ -80,7 +80,7 @@ if ($request->getMethod() == 'POST') { } else $errors->add($i18n->getKey('error.client_exists')); } -} // post +} // POST $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.clientForm.name.focus()"');