]> wagnertech.de Git - timetracker.git/blobdiff - time.php
Siwtched to using isPost() function
[timetracker.git] / time.php
index 9b20578a416a0f0b75f836208adac81d7303d113..b7ea572604878616ca9c90032ed1a87f4fb15fcc 100644 (file)
--- a/time.php
+++ b/time.php
@@ -73,7 +73,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))) {
-  if ($request->getMethod() == 'POST') {
+  if ($request->isPost()) {
     $cl_billable = $request->getParameter('billable');
     $_SESSION['billable'] = (int) $cl_billable;
   } else 
@@ -213,7 +213,7 @@ if ($lock_interval > 0) {
 }
 
 // Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   if ($request->getParameter('btn_submit')) {
 
     // Validate user input.
@@ -267,19 +267,19 @@ if ($request->getMethod() == 'POST') {
       $errors->add($i18n->getKey('error.period_locked'));
 
     // Prohibit creating another uncompleted record.
-    if ($errors->isEmpty()) {
+    if ($errors->no()) {
       if (($not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser())) && (($cl_finish == '') && ($cl_duration == '')))
         $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'));
     }
 
     // Insert record.
-    if ($errors->isEmpty()) {
+    if ($errors->no()) {
       $id = ttTimeHelper::insert(array(
         'date' => $cl_date,
         'user_id' => $user->getActiveUser(),