From d6742e0f4166cb91bde28957512e4c0d801e132c Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 4 Jul 2017 15:17:54 -0700 Subject: [PATCH] CRM-20816 - CiviCase - Settings framework takes precedence over "Settings.xml" CiviCase was originally developed before the creation of the "Settings" framework (aka `$civicrm_settings`, `Settings API`, `civicrm_settings`, `*.setting.php`). At the time, it stored some settings in a special file named "Settings.xml". Today, this file is an anomaly which supports fewer dataflows. With this revision: * For backward compatibility, the default setting is `auto`, which reads the setting from XML. * For maximum compliance with the Settings framework, the value from `Civi::settings()->get()` takes precedence (if defined). --- CRM/Case/XMLProcessor/Process.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index fe1469bfac..8f881a65ed 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -634,6 +634,10 @@ AND a.is_deleted = 0 * @return int */ public function getRedactActivityEmail() { + $setting = Civi::settings()->get('civicaseRedactActivityEmail'); + if ($setting !== 'auto') { + return (int) $setting; + } $xml = $this->retrieve("Settings"); return ( string ) $xml->RedactActivityEmail ? 1 : 0; } @@ -645,6 +649,10 @@ AND a.is_deleted = 0 * 1 if allowed, 0 if not */ public function getAllowMultipleCaseClients() { + $setting = Civi::settings()->get('civicaseAllowMultipleCaseClients'); + if ($setting !== 'auto') { + return (int) $setting; + } $xml = $this->retrieve("Settings"); if ($xml) { return ( string ) $xml->AllowMultipleCaseClients ? 1 : 0; @@ -659,6 +667,10 @@ AND a.is_deleted = 0 * 1 if natural, 0 if alphabetic */ public function getNaturalActivityTypeSort() { + $setting = Civi::settings()->get('civicaseNaturalActivityTypeSort'); + if ($setting !== 'auto') { + return (int) $setting; + } $xml = $this->retrieve("Settings"); return ( string ) $xml->NaturalActivityTypeSort ? 1 : 0; } -- 2.25.1