Fix modulebuilder

This commit is contained in:
Laurent Destailleur 2017-12-09 20:40:11 +01:00
parent cc813df2a5
commit e270295f5c
3 changed files with 10 additions and 15 deletions

View File

@ -19,6 +19,8 @@
* $action
* $conf
* $langs
*
* $keyforbreak may be defined to key to switch on second column
*/
?>
<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
@ -37,6 +39,7 @@ foreach($object->fields as $key => $val)
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';
@ -45,7 +48,7 @@ foreach($object->fields as $key => $val)
print '</td>';
print '</tr>';
//if ($key == 'targetsrcfile3') break; // key used for break on second column
if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column
}
print '</table>';
@ -60,7 +63,7 @@ foreach($object->fields as $key => $val)
{
if ($alreadyoutput)
{
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column
continue;
}
@ -73,6 +76,7 @@ foreach($object->fields as $key => $val)
print '<tr><td';
print ' class="titlefield';
if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
print '"';
print '>'.$langs->trans($val['label']).'</td>';
print '<td>';

View File

@ -88,7 +88,7 @@ class MyObject extends CommonObject
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
);
public $rowid;

View File

@ -322,6 +322,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent">'."\n";
// Common attributes
//$keyforbreak='fieldkeytoswithonsecondcolumn';
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes
@ -329,16 +330,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</table>';
print '</div>';
/* Second column
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '</table>';
print '</div>';*/
print '</div>';
print '</div>';
@ -439,13 +430,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
//Select mail models is same action as presend
/*
if (GETPOST('modelselected')) $action = 'presend';
// Presend form
$modelmail='inventory';
$defaulttopic='InformationMessage';
$diroutput = $conf->product->dir_output.'/inventory';
$trackid = 'stockinv'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
*/
}