From 116cf43f7fb30cd0e6d77cac542b849975d71b29 Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Tue, 30 Apr 2013 14:18:29 +1000 Subject: [PATCH] Add quota updates to system sort process --- admin/systemsortprocess.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/admin/systemsortprocess.php b/admin/systemsortprocess.php index ae93d4b5..3c38a6f4 100644 --- a/admin/systemsortprocess.php +++ b/admin/systemsortprocess.php @@ -44,6 +44,11 @@ include (dirname(__FILE__) . "/../db.inc.php"); */ include (dirname(__FILE__) . "/../functions/functions.process.php"); +/** + * Operator functions (for quotas) + */ +include (dirname(__FILE__) . "/../functions/functions.operator.php"); + /** * Update the database with the new data from the running script * @@ -105,6 +110,17 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin $db->Execute($sql); + + //Update quotas for all enabled questionnaires + $sql = "SELECT questionnaire_id + FROM questionnaire + WHERE enabled = 1"; + + $qs = $db->GetAll($sql); + + foreach($qs as $q) + update_quotas($q['questionnaire_id']); + //Sort current cases for all enabled questionnaires