From 3f8414e3e35a61fe6732f0b0e392c055cf740ad3 Mon Sep 17 00:00:00 2001
From: Uma <uma.s@vtiger.com>
Date: Thu, 26 Mar 2020 18:32:00 +0530
Subject: [PATCH] Fixes #66 Scheduled workflow count defined globally

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

diff --git a/config.template.php b/config.template.php
index 5c8fe7c9c..fe88d5134 100644
--- a/config.template.php
+++ b/config.template.php
@@ -175,5 +175,8 @@ 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 4d90b272a..e5c9d972b 100644
--- a/modules/com_vtiger_workflow/VTWorkflowManager.inc
+++ b/modules/com_vtiger_workflow/VTWorkflowManager.inc
@@ -111,7 +111,8 @@ class VTWorkflowManager{
 	 * @return int
 	 */
 	function getMaxAllowedScheduledWorkflows() {
-		return 10;
+        global $max_scheduled_workflows;
+		return $max_scheduled_workflows;
 	}
 
 	function getWorkflowsForModule($moduleName){
-- 
GitLab