Module builder
This commit is contained in:
parent
abc86d72f6
commit
d2d77d4625
@ -79,7 +79,7 @@ $formfile->form_attach_new_file(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$disablemove=1;
|
$disablemove=1;
|
||||||
if ($modulepart == 'produit') $disablemove=0;
|
if ($modulepart == 'product' || $modulepart == 'produit') $disablemove=0; // Drag and drop for up and down allowed on product
|
||||||
|
|
||||||
// List of document
|
// List of document
|
||||||
$formfile->list_of_documents(
|
$formfile->list_of_documents(
|
||||||
|
|||||||
@ -478,13 +478,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '"';
|
print '"';
|
||||||
print '>'.$langs->trans($val['label']).'</td>';
|
print '>'.$langs->trans($val['label']).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $object->$key;
|
print dol_escape_htmltag($object->$key, 1, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
|
||||||
|
|
||||||
// Other attributes
|
//if ($key == 'targetsrcfile3') break; // key used for break on second column
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -493,7 +492,30 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// ...
|
$alreadyoutput = 1;
|
||||||
|
foreach($object->fields as $key => $val)
|
||||||
|
{
|
||||||
|
if ($alreadyoutput)
|
||||||
|
{
|
||||||
|
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($key, array('rowid', 'ref', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
|
||||||
|
|
||||||
|
print '<tr><td';
|
||||||
|
print ' class="titlefield';
|
||||||
|
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||||
|
print '"';
|
||||||
|
print '>'.$langs->trans($val['label']).'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print dol_escape_htmltag($object->$key, 1, 1);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -79,7 +79,9 @@ $extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
|||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id;
|
|
||||||
|
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->id);
|
||||||
|
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -167,10 +169,16 @@ if ($object->id)
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
$modulepart = 'societe';
|
$modulepart = 'mymodule';
|
||||||
$permission = $user->rights->societe->creer;
|
//$permission = $user->rights->mymodule->create;
|
||||||
$permtoedit = $user->rights->societe->creer;
|
$permission = 1;
|
||||||
|
//$permtoedit = $user->rights->mymodule->create;
|
||||||
|
$permtoedit = 1;
|
||||||
$param = '&id=' . $object->id;
|
$param = '&id=' . $object->id;
|
||||||
|
|
||||||
|
//$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->id).'/';
|
||||||
|
$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->ref).'/';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user