diff --git a/modules/com_vtiger_workflow/VTWorkflowManager.inc b/modules/com_vtiger_workflow/VTWorkflowManager.inc index 0ea8f1235af3b2a4337ded33ab62b9e1dc936f2f..bfd394c5dc3b3ce68bd9279379c3013ea0ee85a7 100644 --- a/modules/com_vtiger_workflow/VTWorkflowManager.inc +++ b/modules/com_vtiger_workflow/VTWorkflowManager.inc @@ -24,6 +24,7 @@ class VTWorkflowManager{ function __construct($adb){ $this->adb = $adb; + $this->setMaxAllowedScheduledWorkflows(); } function save($workflow){ @@ -105,13 +106,24 @@ class VTWorkflowManager{ $result = $adb->pquery($query, $params); return $adb->query_result($result, 0, 'count'); } + + /** + * Function to set max allowed scheduled workflow count as per global defaults + */ + function setMaxAllowedScheduledWorkflows(){ + global $max_scheduled_workflows; + if(!empty($max_scheduled_workflows)){ + vglobal('max_scheduled_workflows', $max_scheduled_workflows); + }else{ + vglobal('max_scheduled_workflows', 10); + } + } /** * Function returns the maximum allowed scheduled workflows * @return int */ function getMaxAllowedScheduledWorkflows() { - vglobal('max_scheduled_workflows', 10); return vglobal('max_scheduled_workflows'); }