2
0
forked from Wavyzz/dolibarr

Enhance modulebuilder

This commit is contained in:
Laurent Destailleur
2019-11-01 17:54:17 +01:00
parent a1b2130247
commit 2af23aa658
10 changed files with 159 additions and 70 deletions

View File

@@ -128,17 +128,19 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
$i++;
$texttoinsert.= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',";
$texttoinsert.= " 'enabled'=>".($val['enabled']!=''?$val['enabled']:1).",";
$texttoinsert.= " 'visible'=>".($val['visible']!=''?$val['visible']:-1).",";
$texttoinsert.= " 'position'=>".($val['position']!=''?$val['position']:50).",";
$texttoinsert.= " 'notnull'=>".($val['notnull']!=''?$val['notnull']:-1).",";
$texttoinsert.= " 'notnull'=>".(empty($val['notnull'])?0:$val['notnull']).",";
$texttoinsert.= " 'visible'=>".($val['visible']!=''?$val['visible']:-1).",";
if ($val['noteditable']) $texttoinsert.= " 'noteditable'=>'".$val['noteditable']."',";
if ($val['default']) $texttoinsert.= " 'default'=>'".$val['default']."',";
if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].",";
if ($val['foreignkey']) $texttoinsert.= " 'foreignkey'=>'".$val['foreignkey']."',";
if ($val['searchall']) $texttoinsert.= " 'searchall'=>".$val['searchall'].",";
if ($val['isameasure']) $texttoinsert.= " 'isameasure'=>'".$val['isameasure']."',";
if ($val['foreignkey']) $texttoinsert.= " 'foreignkey'=>'".$val['foreignkey']."',";
if ($val['css']) $texttoinsert.= " 'css'=>'".$val['css']."',";
if ($val['help']) $texttoinsert.= " 'help'=>\"".preg_replace('/"/', '', $val['help'])."\",";
if ($val['comment']) $texttoinsert.= " 'comment'=>\"".preg_replace('/"/', '', $val['comment'])."\",";
if ($val['showoncombobox']) $texttoinsert.= " 'showoncombobox'=>'".$val['showoncombobox']."',";
if ($val['disabled']) $texttoinsert.= " 'disabled'=>'".$val['disabled']."',";
if ($val['arrayofkeyval'])
{
$texttoinsert.= " 'arrayofkeyval'=>array(";
@@ -149,8 +151,10 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
$texttoinsert.="'".$key2."'=>'".$val2."'";
$i++;
}
$texttoinsert.= ")";
$texttoinsert.= "),";
}
if ($val['comment']) $texttoinsert.= " 'comment'=>\"".preg_replace('/"/', '', $val['comment'])."\"";
$texttoinsert.= "),\n";
}
}