From a1288c9b7f6f914bf2bb878a9c1c3df6f11cf33c Mon Sep 17 00:00:00 2001
From: Uma <uma.s@vtiger.com>
Date: Tue, 13 Oct 2020 13:08:59 +0530
Subject: [PATCH] Max scheduled workflow limit configured as Globals

---
 config.template.php                               | 3 ---
 modules/com_vtiger_workflow/VTWorkflowManager.inc | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/config.template.php b/config.template.php
index fe88d5134..5c8fe7c9c 100644
--- a/config.template.php
+++ b/config.template.php
@@ -175,8 +175,5 @@ if(isset($default_timezone) && function_exists('date_default_timezone_set')) {
 //Set the default layout 
 $default_layout = 'v7';
 
-//Maximiun scheduled workflows default value set to 10
-$max_scheduled_workflows = 10;
-
 include_once 'config.security.php';
 ?>
diff --git a/modules/com_vtiger_workflow/VTWorkflowManager.inc b/modules/com_vtiger_workflow/VTWorkflowManager.inc
index e5c9d972b..0ea8f1235 100644
--- a/modules/com_vtiger_workflow/VTWorkflowManager.inc
+++ b/modules/com_vtiger_workflow/VTWorkflowManager.inc
@@ -111,8 +111,8 @@ class VTWorkflowManager{
 	 * @return int
 	 */
 	function getMaxAllowedScheduledWorkflows() {
-        global $max_scheduled_workflows;
-		return $max_scheduled_workflows;
+            vglobal('max_scheduled_workflows', 10);
+            return vglobal('max_scheduled_workflows');
 	}
 
 	function getWorkflowsForModule($moduleName){
-- 
GitLab