Fix: Triggers path should be relative to allow usage of alternate search.
This commit is contained in:
parent
53d0704350
commit
c4bb69b7bf
@ -82,16 +82,16 @@ class Conf
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load setup values into conf object (read llx_const)
|
* Load setup values into conf object (read llx_const)
|
||||||
* \param $db Handler d'acces base
|
* @param $db Handler d'acces base
|
||||||
* \return int < 0 if KO, >= 0 if OK
|
* @return int < 0 if KO, >= 0 if OK
|
||||||
*/
|
*/
|
||||||
function setValues($db)
|
function setValues($db)
|
||||||
{
|
{
|
||||||
dol_syslog("Conf::setValues");
|
dol_syslog("Conf::setValues");
|
||||||
|
|
||||||
// Directory of core triggers
|
// Directory of core triggers
|
||||||
$this->triggers_modules[] = DOL_DOCUMENT_ROOT . "/includes/triggers";
|
$this->triggers_modules[] = "/includes/triggers"; // Relative path
|
||||||
|
|
||||||
// Avoid warning if not defined
|
// Avoid warning if not defined
|
||||||
if (empty($this->db->dolibarr_main_db_encryption)) $this->db->dolibarr_main_db_encryption=0;
|
if (empty($this->db->dolibarr_main_db_encryption)) $this->db->dolibarr_main_db_encryption=0;
|
||||||
@ -142,8 +142,7 @@ class Conf
|
|||||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg))
|
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg))
|
||||||
{
|
{
|
||||||
$modulename = strtolower($reg[1]);
|
$modulename = strtolower($reg[1]);
|
||||||
if ($value == 1) $this->triggers_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/inc/triggers/';
|
$this->triggers_modules[] = '/'.$modulename.'/inc/triggers/';
|
||||||
else if ($value == 2) $this->triggers_modules[] = DOL_DOCUMENT_ROOT_ALT.'/'.$modulename.'/inc/triggers/';
|
|
||||||
}
|
}
|
||||||
// If this is constant for login method activated by a module
|
// If this is constant for login method activated by a module
|
||||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg))
|
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg))
|
||||||
|
|||||||
@ -68,8 +68,11 @@ class Interfaces
|
|||||||
dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
|
dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($conf->triggers_modules as $dir)
|
foreach($conf->triggers_modules as $reldir)
|
||||||
{
|
{
|
||||||
|
$dir=dol_buildpath($reldir,0);
|
||||||
|
//print "xx".$dir;exit;
|
||||||
|
|
||||||
// Check if directory exists
|
// Check if directory exists
|
||||||
if (!is_dir($dir)) continue;
|
if (!is_dir($dir)) continue;
|
||||||
|
|
||||||
@ -173,8 +176,9 @@ class Interfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return list of triggers.
|
* Return list of triggers. Function used by admin page htdoc/admin/triggers
|
||||||
* \param workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated
|
* @param workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated
|
||||||
|
* @return array Array list of triggers
|
||||||
*/
|
*/
|
||||||
function getTriggersList($workflow=0)
|
function getTriggersList($workflow=0)
|
||||||
{
|
{
|
||||||
@ -187,8 +191,11 @@ class Interfaces
|
|||||||
$orders = array();
|
$orders = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
foreach($conf->triggers_modules as $dir)
|
foreach($conf->triggers_modules as $reldir)
|
||||||
{
|
{
|
||||||
|
$dir=dol_buildpath($reldir,0);
|
||||||
|
//print "xx".$dir;exit;
|
||||||
|
|
||||||
// Check if directory exists
|
// Check if directory exists
|
||||||
if (!is_dir($dir)) continue;
|
if (!is_dir($dir)) continue;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user