From 5eaa2d34683260962453108f71617bddefc21012 Mon Sep 17 00:00:00 2001 From: willcast Date: Fri, 31 Oct 2003 13:40:34 +0000 Subject: [PATCH] Bug fixed: - Updating a Default Approval Status from NO to YES in a glossary, now approve automatically all entries waiting for approval. --- mod/glossary/lib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 1d4d25c5e0..09f70b0f95 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -41,7 +41,7 @@ function glossary_update_instance($glossary) { /// Given an object containing all the necessary data, /// (defined by the form in mod.html) this function /// will update an existing instance with new data. - +global $CFG; if ( !isadmin() ) { unset($glossary->globalglossary); } @@ -49,9 +49,12 @@ function glossary_update_instance($glossary) { $glossary->timemodified = time(); $glossary->id = $glossary->instance; - # May have to add extra stuff in here # + $return = update_record("glossary", $glossary); + if ($return and $glossary->defaultapproval) { + execute_sql("update {$CFG->prefix}glossary_entries SET approved = 1 where approved != 1 and glossaryid = " . $glossary->id,false); + } - return update_record("glossary", $glossary); + return $return; } -- 2.39.5