More modern picto for switch on/off

Work on website module
This commit is contained in:
Laurent Destailleur
2017-10-20 21:39:19 +02:00
parent 0e397b3e81
commit 3bca0ad07d
15 changed files with 752 additions and 168 deletions

View File

@@ -254,6 +254,15 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
$texttoinsert.= "\t".$key." ".$val['type'];
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
else
{
if ($val['default'] != '')
{
if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL";
else if (preg_match('/varchar/', $val['type'])) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:'');
}
}
$texttoinsert.= (($val['notnull'] > 0)?' NOT NULL':'');
if ($i < count($object->fields)) $texttoinsert.=", ";
$texttoinsert.= "\n";