Work on multicompany module with smarty integration

This commit is contained in:
Regis Houssin 2009-10-31 07:01:37 +00:00
parent 8d41d43385
commit 4d52c1525e

View File

@ -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);
}