X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/0e3c4d629800de449c5a1bb9da780993e5dc5277..a7ba11adfecf6cb906749efe5abce688363aef07:/client_edit.php diff --git a/client_edit.php b/client_edit.php index c24a427e..a106cf94 100644 --- a/client_edit.php +++ b/client_edit.php @@ -41,7 +41,7 @@ $cl_id = (int) $request->getParameter('id'); $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 = trim($request->getParameter('tax')); @@ -71,13 +71,13 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); $form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy'))); -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 ($request->getParameter('btn_save')) { $client = ttClientHelper::getClientByName($cl_name); if (($client && ($cl_id == $client['id'])) || !$client) { @@ -113,7 +113,7 @@ if ($request->getMethod() == 'POST') { $errors->add($i18n->getKey('error.client_exists')); } } -} // post +} // POST $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->getKey('title.edit_client'));