mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 03:28:18 +01:00
Merge remote-tracking branch 'upstream/develop' into nospaceaftercomma
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
* @return int|object <=0 if KO, Object if OK
|
||||
* @see rebuildObjectSql
|
||||
*/
|
||||
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='', $addfieldentry=array() ,$delfieldentry='')
|
||||
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '')
|
||||
{
|
||||
global $db, $langs;
|
||||
|
||||
@@ -210,7 +210,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @see rebuildObjectClass
|
||||
*/
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='', $object=null)
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null)
|
||||
{
|
||||
global $db, $langs;
|
||||
|
||||
@@ -263,8 +263,8 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
|
||||
$type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php'
|
||||
|
||||
if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database
|
||||
else if ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
|
||||
else if ($type == 'link' || $type == 'sellist') $type = 'integer';
|
||||
elseif ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
|
||||
elseif ($type == 'link' || $type == 'sellist') $type = 'integer';
|
||||
$texttoinsert.= "\t".$key." ".$type;
|
||||
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
|
||||
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
|
||||
@@ -273,7 +273,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
|
||||
if ($val['default'] != '')
|
||||
{
|
||||
if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL";
|
||||
else if (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
|
||||
elseif (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
|
||||
else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:'');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user