Squashed 'public/legacy/' changes from bb959a145..4f401678f

4f401678f SuiteCRM 7.12.2 Release
647fd6ad5 Fix #9382 - Outbound Emails editview Unsupported operand types fatal in php8
2b116b8a8 Fix #9374 - OAuth password creation Unsupported operand types fatal in php8
97fe07b7a Allow changing text colors when composing an email
eed4acacd Fix #9376 - allow workflows on import
5ca4e3e7f Fix Campaign Email settings removes Email settings
4b0dc4ffb fix #9383 - upgrade existing php code using each() function
0590b3690 Fix #8602 - Fix email view action return_action
2bf8e17cf Fix #8602 - Fix email message modal displayed buttons

git-subtree-dir: public/legacy
git-subtree-split: 4f401678fdb1f769ea897c82d4504ab8380ff9af
This commit is contained in:
Clemente Raposo 2021-12-15 16:20:24 +00:00
parent d075ac6581
commit 41c2374a54
28 changed files with 389 additions and 290 deletions

View file

@ -217,13 +217,14 @@ class AOW_WorkFlow extends Basic
*/
public function run_bean_flows(SugarBean $bean)
{
if (!defined('SUGARCRM_IS_INSTALLING') && (!isset($_REQUEST['module']) || $_REQUEST['module'] != 'Import')) {
$query = "SELECT id FROM aow_workflow WHERE aow_workflow.flow_module = '" . $bean->module_dir . "' AND aow_workflow.status = 'Active' AND (aow_workflow.run_when = 'Always' OR aow_workflow.run_when = 'On_Save' OR aow_workflow.run_when = 'Create') AND aow_workflow.deleted = 0 ";
$query = "SELECT id FROM aow_workflow WHERE aow_workflow.flow_module = '" . $bean->module_dir . "' AND aow_workflow.status = 'Active' AND (aow_workflow.run_when = 'Always' OR aow_workflow.run_when = 'On_Save' OR aow_workflow.run_when = 'Create') AND aow_workflow.deleted = 0 ";
$result = $this->db->query($query, false);
$flow = BeanFactory::newBean('AOW_WorkFlow');
while (($row = $bean->db->fetchByAssoc($result)) != null) {
$flow->retrieve($row['id']);
$result = $this->db->query($query, false);
$flow = BeanFactory::newBean('AOW_WorkFlow');
while (($row = $bean->db->fetchByAssoc($result)) != null) {
$flow->retrieve($row['id']);
if ((!defined('SUGARCRM_IS_INSTALLING') && (!isset($_REQUEST['module'])) || $_REQUEST['module'] != 'Import') || $flow->run_on_import) {
if ($flow->check_valid_bean($bean)) {
$flow->run_actions($bean, true);
}

View file

@ -76,5 +76,6 @@ $mod_strings = array(
'LBL_ACTION_LINES' => 'Actions',
'LBL_ADD_ACTION' => 'Add Action',
'LBL_MULTIPLE_RUNS' => 'Repeated Runs',
'LBL_RUN_WHEN' => 'Run'
'LBL_RUN_WHEN' => 'Run',
'LBL_RUN_ON_IMPORT' => 'Run on Import'
);

View file

@ -117,6 +117,11 @@ $viewdefs ['AOW_WorkFlow'] =
'name' => 'multiple_runs',
'label' => 'LBL_MULTIPLE_RUNS',
),
1 =>
array(
'name' => 'run_on_import',
'label' => 'LBL_RUN_ON_IMPORT',
),
),
4 =>
array(

View file

@ -108,6 +108,11 @@ $viewdefs ['AOW_WorkFlow'] =
'name' => 'multiple_runs',
'label' => 'LBL_MULTIPLE_RUNS',
),
1 =>
array(
'name' => 'run_on_import',
'label' => 'LBL_RUN_ON_IMPORT',
),
),
4 =>
array(

View file

@ -213,6 +213,14 @@ $dictionary['AOW_WorkFlow'] = array(
'bean_name' => 'AOW_Processed',
'source' => 'non-db',
),
'run_on_import' =>
array(
'name' => 'run_on_import',
'vname' => 'LBL_RUN_ON_IMPORT',
'type' => 'bool',
'default' => '0',
'reportable' => false,
),
),
'relationships' => array(
'aow_workflow_aow_conditions' =>