From 8ef07358aad8988844648aa9c12ceb3047fa8b2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anz=CC=8Ce=20Videnic=CC=8C?= Date: Tue, 24 May 2016 09:17:09 +0200 Subject: [PATCH] Added a redirect back to profile after monthly quota is saved. --- cf_monthly_quota.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cf_monthly_quota.php b/cf_monthly_quota.php index 02646848..14d0f3fb 100644 --- a/cf_monthly_quota.php +++ b/cf_monthly_quota.php @@ -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 -- 2.20.1