forked from Wavyzz/dolibarr
Debug modulebuilder
This commit is contained in:
@@ -77,8 +77,8 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
|
||||
$i++;
|
||||
$typephp='';
|
||||
$texttoinsert.= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',";
|
||||
$texttoinsert.= " 'visible'=>".$val['visible'].",";
|
||||
$texttoinsert.= " 'enabled'=>".$val['enabled'].",";
|
||||
$texttoinsert.= " 'visible'=>".($val['visible']?$val['visible']:0).",";
|
||||
$texttoinsert.= " 'enabled'=>".($val['enabled']?$val['enabled']:0).",";
|
||||
if ($val['position']) $texttoinsert.= " 'position'=>".$val['position'].",";
|
||||
if ($val['notnull']) $texttoinsert.= " 'notnull'=>".$val['notnull'].",";
|
||||
if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].",";
|
||||
|
||||
@@ -78,9 +78,13 @@ class MyObject extends CommonObject
|
||||
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>true, 'index'=>true, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>true, 'index'=>true, 'position'=>20),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1),
|
||||
'qty' =>array('type'=>'double(24,8)', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValid', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'index'=>true, 'position'=>1000, 'nullifempty'=>1),
|
||||
);
|
||||
|
||||
@@ -306,9 +306,10 @@ foreach ($search_array_options as $key => $val)
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->mymodule->delete) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
@@ -324,7 +325,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
@@ -366,6 +367,7 @@ foreach($object->fields as $key => $val)
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
||||
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
||||
}
|
||||
// Extra fields
|
||||
@@ -421,6 +423,7 @@ foreach($object->fields as $key => $val)
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.='nowrap';
|
||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
||||
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
|
||||
}
|
||||
// Extra fields
|
||||
|
||||
Reference in New Issue
Block a user