2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'upstream/develop' into nospaceaftercomma

This commit is contained in:
Frédéric FRANCE
2019-01-27 23:23:38 +01:00
759 changed files with 4357 additions and 4160 deletions

View File

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