]> wagnertech.de Git - timetracker.git/blobdiff - client_edit.php
Siwtched to using isPost() function
[timetracker.git] / client_edit.php
index 747ed2b8a68593294fc10c3ee27830adb072bcad..a106cf94c6a9ec1f83a42b992649f17e07fe2b10 100644 (file)
@@ -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) {