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

View File

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