Fix: Postgres compatibility
This commit is contained in:
parent
d9334847d8
commit
49600d1423
@ -40,7 +40,7 @@ $def = array();
|
||||
$lastexternalrss=0;
|
||||
|
||||
// positionne la variable pour le nombre de rss externes
|
||||
$sql ="select MAX(name) name from ".MAIN_DB_PREFIX."const";
|
||||
$sql ="select MAX(name) as name from ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE name like 'EXTERNAL_RSS_URLRSS_%'";
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -35,7 +35,7 @@ $def = array();
|
||||
$lastftpentry=0;
|
||||
|
||||
// Positionne la variable pour le nombre de rss externes
|
||||
$sql ="select MAX(name) name from ".MAIN_DB_PREFIX."const";
|
||||
$sql ="select MAX(name) as name from ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE name like 'FTP_SERVER_%'";
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -264,6 +264,8 @@ class modSociete extends DolibarrModules
|
||||
*/
|
||||
function init($options='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
|
||||
// Prevent pb of modules not correctly disabled
|
||||
@ -273,9 +275,13 @@ class modSociete extends DolibarrModules
|
||||
create_exdir($dirodt);
|
||||
dol_copy(DOL_DOCUMENT_ROOT.'/install/odttemplates/thirdparties/template_thirdparty.odt',$dirodt,0,0);
|
||||
|
||||
$sql = array(
|
||||
array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."const set name='COMPANY_ADDON_PDF_ODT_PATH', value='DOL_DATA_ROOT/odttemplates/thirdparties'",'ignoreerror'=>1)
|
||||
);
|
||||
$sql = array();
|
||||
if ($this->db->type != 'pgsql') // TODO For the moment, we can't execute SQL that may fail with Postgres
|
||||
{
|
||||
$sql=array(
|
||||
array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible,entity) VALUES ('COMPANY_ADDON_PDF_ODT_PATH', 'DOL_DATA_ROOT/odttemplates/thirdparties', 0, '".$conf->entity."')",'ignoreerror'=>1)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_init($sql,$options);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user