From 4d52c1525e21246b1a3ac977d5507d022a61b730 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 31 Oct 2009 07:01:37 +0000 Subject: [PATCH] Work on multicompany module with smarty integration --- htdocs/lib/admin.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/admin.lib.php b/htdocs/lib/admin.lib.php index 56b48160a77..afda9cb8ea3 100644 --- a/htdocs/lib/admin.lib.php +++ b/htdocs/lib/admin.lib.php @@ -91,7 +91,7 @@ function versiondolibarrarray() * \param sqlfile Full path to sql file * \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; @@ -228,7 +228,7 @@ function run_sql($sqlfile,$silent=1) while (preg_match('/(__ENTITY__)/i',$newsql,$reg)) { $from = $reg[1]; - $to = $conf->entity; + $to = (!empty($entity)?$entity:$conf->entity); $newsql = str_replace($from,$to,$newsql); dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); }