Added a redirect back to profile after monthly quota is saved.
authorAnže Videnič <anze.videnic@gmail.com>
Tue, 24 May 2016 07:17:09 +0000 (09:17 +0200)
committerAnže Videnič <anze.videnic@gmail.com>
Tue, 24 May 2016 07:17:09 +0000 (09:17 +0200)
cf_monthly_quota.php

index 0264684..14d0f3f 100644 (file)
@@ -30,9 +30,15 @@ $quota = new MonthlyQuota();
 if ($request->isPost()){
   $postedYear = $request->getParameter("years");
   $year = intval($postedYear);
+  $res = false;
   for ($i=0; $i < count($months); $i++){
-    $quota->update($postedYear, $i+1, $request->getParameter($months[$i]));
+    $res = $quota->update($postedYear, $i+1, $request->getParameter($months[$i]));
   }
+  if ($res){
+    header('Location: profile_edit.php');
+    exit();
+  } else
+      $err->add($i18n->getKey('error.db'));
 }
 
 // returns months where January is month 1, not 0