From 059657f4494c9079727a7dd35575fcf7bf05e879 Mon Sep 17 00:00:00 2001
From: prasad <prasad@vtiger.com>
Date: Wed, 15 May 2024 19:32:31 +0530
Subject: [PATCH] E_ALL - fixes for User Preferences

---
 includes/runtime/Controller.php | 4 ++++
 includes/runtime/Viewer.php     | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/includes/runtime/Controller.php b/includes/runtime/Controller.php
index 760ca75ff..a2d8efe07 100644
--- a/includes/runtime/Controller.php
+++ b/includes/runtime/Controller.php
@@ -182,7 +182,10 @@ abstract class Vtiger_View_Controller extends Vtiger_Action_Controller {
 			$viewer->assign('PARENT_MODULE', '');
 			$viewer->assign('EXTENSION_MODULE', '');
 			$viewer->assign('moduleName', '');
+			$viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel());
 			$viewer->assign('CURRENT_USER_ID', $current_user ? $current_user->id : "");
+			$viewer->assign('USER_CURRENCY_SYMBOL', ''); // will be initialized later
+			$viewer->assign('INVENTORY_MODULES', array());
 
 			$viewer->assign('NOTIFIER_URL', '');
 			$viewer->assign('GLOBAL_SEARCH_VALUE', '');
@@ -205,6 +208,7 @@ abstract class Vtiger_View_Controller extends Vtiger_Action_Controller {
 			$viewer->assign('PRINT_TEMPLATE', '');
 			$viewer->assign('CLASS_VIEW_ACTION', '');
 			$viewer->assign('RELATED_MODULE_NAME', '');
+			$viewer->assign('MODULE_BASIC_ACTIONS', array());
 
 			// Editview
 			$viewer->assign('LEFTPANELHIDE', false);
diff --git a/includes/runtime/Viewer.php b/includes/runtime/Viewer.php
index 9c64e39d3..023499373 100644
--- a/includes/runtime/Viewer.php
+++ b/includes/runtime/Viewer.php
@@ -71,12 +71,13 @@ class Vtiger_Viewer extends Smarty {
 			$this->log("URI: $debugViewerURI, TYPE: " . $_SERVER['REQUEST_METHOD']);
 		}
 
+		// TODO: Refactor to specific module dependency.
 		$classes = array('Vtiger_MenuStructure_Model', 'Users_Privileges_Model', 
 			'Vtiger_Module_Model', 'Settings_MenuEditor_Module_Model', 'Vtiger_Util_Helper', 
 			'ZEND_JSON', 'Zend_Json', 'Zend_JSON', 'ZEND_json',
 			'Vtiger_Theme', 'Users_Record_Model', 'Vtiger_Module_Model', 'Vtiger_Field_Model', 
 			'Settings_Picklist_Module_Model', 'CustomView_Record_Model', 'Vtiger_Extension_View',
-			'Vtiger_Tag_Model',
+			'Vtiger_Tag_Model', 'Settings_Vtiger_Module_Model', 'PBXManager_Server_Model',
 			'Vtiger_Functions', 'Users', 'CurrencyField');
 		foreach ($classes as $clazz) {
 			if (class_exists($clazz)) {
@@ -88,7 +89,8 @@ class Vtiger_Viewer extends Smarty {
 			'decode_html', 'vtlib_purify', 'php7_count', 'getUserFullName', 'array_flip', 'explode', 'trim', 'array_push',
 			'array_map', 'array_key_exists', 'get_class', 'vtlib_array', 'getDuplicatesPreventionMessage', 'htmlentities',
 			'getCurrencySymbolandCRate', 'mb_substr', 'isPermitted', 'getEntityName', 'function_exists', 'php7_trim', 'php7_htmlentities',
-			'strtolower', 'strtoupper', 'str_replace', 'urlencode', 'getTranslatedCurrencyString', 'getTranslatedString', 'is_object', 'is_numeric');
+			'strtolower', 'strtoupper', 'str_replace', 'urlencode', 'getTranslatedCurrencyString', 'getTranslatedString', 'is_object', 'is_numeric',
+			'php7_sizeof', 'method_exists');
 		foreach ($modifiers as $modifier) {
 			if (function_exists($modifier)) {
 				$this->registerPlugin('modifier', $modifier, $modifier);
-- 
GitLab