Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts: htdocs/core/modules/DolibarrModules.class.php
This commit is contained in:
commit
8b793a261f
@ -3947,7 +3947,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
// Now we add first model found in directories scanned
|
// Now we add first model found in directories scanned
|
||||||
$listofdir=explode(',',$dirtoscan);
|
$listofdir=explode(',',$dirtoscan);
|
||||||
foreach($listofdir as $key=>$tmpdir)
|
foreach($listofdir as $key => $tmpdir)
|
||||||
{
|
{
|
||||||
$tmpdir=trim($tmpdir);
|
$tmpdir=trim($tmpdir);
|
||||||
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
|
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
|
||||||
|
|||||||
@ -1255,55 +1255,55 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
*
|
*
|
||||||
* @return int Error count (0 if ok)
|
* @return int Error count (0 if ok)
|
||||||
*/
|
*/
|
||||||
function insert_tabs()
|
function insert_tabs()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$err=0;
|
$err=0;
|
||||||
|
|
||||||
if (! empty($this->tabs))
|
if (! empty($this->tabs))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach ($this->tabs as $key => $value)
|
foreach ($this->tabs as $key => $value)
|
||||||
{
|
{
|
||||||
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
|
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
|
||||||
|
|
||||||
$entity=$conf->entity;
|
$entity=$conf->entity;
|
||||||
$newvalue = $value;
|
$newvalue = $value;
|
||||||
|
|
||||||
if (is_array($value))
|
if (is_array($value))
|
||||||
{
|
{
|
||||||
$newvalue = $value['data'];
|
$newvalue = $value['data'];
|
||||||
if (isset($value['entity'])) $entity = $value['entity'];
|
if (isset($value['entity'])) $entity = $value['entity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newvalue)
|
if ($newvalue)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
|
||||||
$sql.= "name";
|
$sql.= "name";
|
||||||
$sql.= ", type";
|
$sql.= ", type";
|
||||||
$sql.= ", value";
|
$sql.= ", value";
|
||||||
$sql.= ", note";
|
$sql.= ", note";
|
||||||
$sql.= ", visible";
|
$sql.= ", visible";
|
||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " VALUES (";
|
$sql.= " VALUES (";
|
||||||
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
|
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
|
||||||
$sql.= ", 'chaine'";
|
$sql.= ", 'chaine'";
|
||||||
$sql.= ", ".$this->db->encrypt($value,1);
|
$sql.= ", ".$this->db->encrypt($newvalue,1);
|
||||||
$sql.= ", null";
|
$sql.= ", null";
|
||||||
$sql.= ", '0'";
|
$sql.= ", '0'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds constants
|
* Adds constants
|
||||||
|
|||||||
@ -611,3 +611,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14
|
|||||||
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
|
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
||||||
|
|
||||||
|
-- Negative buying prices
|
||||||
|
|
||||||
|
UPDATE llx_facturedet SET buy_price_ht = ABS(buy_price_ht)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user