]> wagnertech.de Git - timetracker.git/blobdiff - expenses.php
Siwtched to using isPost() function
[timetracker.git] / expenses.php
index 0f93b3bf91b62d488beb2b1f8b4e4e7ed92ca572..f9112e3102daea120ff561bab1aed6fbb70d6ebe 100644 (file)
@@ -142,7 +142,7 @@ if ($lock_interval > 0) {
 }
 
 // Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   if ($request->getParameter('btn_submit')) {
     // Validate user input.
     if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
@@ -166,7 +166,7 @@ if ($request->getMethod() == 'POST') {
       $errors->add($i18n->getKey('error.period_locked'));
 
     // Insert record.
-    if ($errors->isEmpty()) {
+    if ($errors->no()) {
       if (ttExpenseHelper::insert(array('date'=>$cl_date,'user_id'=>$user->getActiveUser(),
         'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) {
         header('Location: expenses.php');