Add log if trigger not launched

Rename property ->workflow of a trigger by property ->disabled_if_workflow. This make code easier to understand.
This commit is contained in:
Laurent Destailleur 2010-04-22 20:55:28 +00:00
parent d881cfafd7
commit f43baaddf5

View File

@ -107,14 +107,19 @@ class Interfaces
continue; continue;
} }
dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
include_once($dir."/".$file); include_once($dir."/".$file);
$objMod = new $modName($this->db); $objMod = new $modName($this->db);
$i=0; $i=0;
if ($objMod) if ($objMod)
{ {
// Bypass if workflow module is enabled and if the trigger is compatible // Bypass if workflow module is enabled and if the trigger asked to be disable in such case
if ($conf->workflow->enabled && $objMod->workflow) continue; if ($conf->workflow->enabled && ! empty($objMod->disabled_if_workflow))
{
dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
continue;
}
dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
$modules[$i] = $modName; $modules[$i] = $modName;
//dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO); //dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
@ -139,6 +144,10 @@ class Interfaces
} }
$i++; $i++;
} }
else
{
dol_syslog("Interfaces::run_triggers Failed to instantiate trigger for file '".$file."'",LOG_ERROR);
}
} }
} }
closedir($handle); closedir($handle);