]> wagnertech.de Git - timetracker.git/blobdiff - mobile/timer.php
Siwtched to using isPost() function
[timetracker.git] / mobile / timer.php
index fa00ced228f947a4e59f60686bfb9c1bfb638afc..99a8852624f611d93d9c57cc24f6d404306105bf 100644 (file)
@@ -65,7 +65,7 @@ $cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? n
 $_SESSION['cf_1'] = $cl_cf_1;
 $cl_billable = 1;
 if (in_array('iv', explode(',', $user->plugins))) {
 $_SESSION['cf_1'] = $cl_cf_1;
 $cl_billable = 1;
 if (in_array('iv', explode(',', $user->plugins))) {
-  if ($request->getMethod() == 'POST') {
+  if ($request->isPost()) {
     $cl_billable = $request->getParameter('billable');
     $_SESSION['billable'] = (int) $cl_billable;
   } else 
     $cl_billable = $request->getParameter('billable');
     $_SESSION['billable'] = (int) $cl_billable;
   } else 
@@ -188,7 +188,7 @@ if ($lock_interval > 0) {
 }
 
 // Submit.
 }
 
 // Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   if ($request->getParameter('btn_start')) {
     // Start button clicked. We need to create a new uncompleted record with only the start time.
     $cl_finish = null;
   if ($request->getParameter('btn_start')) {
     // Start button clicked. We need to create a new uncompleted record with only the start time.
     $cl_finish = null;
@@ -219,17 +219,17 @@ if ($request->getMethod() == 'POST') {
       $errors->add($i18n->getKey('error.period_locked'));
 
     // Prohibit creating another uncompleted record.
       $errors->add($i18n->getKey('error.period_locked'));
 
     // Prohibit creating another uncompleted record.
-    if ($errors->isEmpty() && $uncompleted) {
+    if ($errors->no() && $uncompleted) {
       $errors->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
     }
 
     // Prohibit creating an overlapping record.
       $errors->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
     }
 
     // Prohibit creating an overlapping record.
-    if ($errors->isEmpty()) {
+    if ($errors->no()) {
       if (ttTimeHelper::overlaps($user->getActiveUser(), $cl_date, $cl_start, $cl_finish))
         $errors->add($i18n->getKey('error.overlap'));
     }
 
       if (ttTimeHelper::overlaps($user->getActiveUser(), $cl_date, $cl_start, $cl_finish))
         $errors->add($i18n->getKey('error.overlap'));
     }
 
-    if ($errors->isEmpty()) {
+    if ($errors->no()) {
       $id = ttTimeHelper::insert(array(
         'date' => $cl_date,
         'user_id' => $user->getActiveUser(),
       $id = ttTimeHelper::insert(array(
         'date' => $cl_date,
         'user_id' => $user->getActiveUser(),