Skip to content
Snippets Groups Projects
Commit 4d52c152 authored by Regis Houssin's avatar Regis Houssin
Browse files

Work on multicompany module with smarty integration

parent 8d41d433
Branches
Tags
No related merge requests found
...@@ -91,7 +91,7 @@ function versiondolibarrarray() ...@@ -91,7 +91,7 @@ function versiondolibarrarray()
* \param sqlfile Full path to sql file * \param sqlfile Full path to sql file
* \return int <=0 if KO, >0 if OK * \return int <=0 if KO, >0 if OK
*/ */
function run_sql($sqlfile,$silent=1) function run_sql($sqlfile,$silent=1,$entity='')
{ {
global $db, $conf, $langs, $user; global $db, $conf, $langs, $user;
...@@ -228,7 +228,7 @@ function run_sql($sqlfile,$silent=1) ...@@ -228,7 +228,7 @@ function run_sql($sqlfile,$silent=1)
while (preg_match('/(__ENTITY__)/i',$newsql,$reg)) while (preg_match('/(__ENTITY__)/i',$newsql,$reg))
{ {
$from = $reg[1]; $from = $reg[1];
$to = $conf->entity; $to = (!empty($entity)?$entity:$conf->entity);
$newsql = str_replace($from,$to,$newsql); $newsql = str_replace($from,$to,$newsql);
dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment