Clean code
This commit is contained in:
parent
6b5c0769b8
commit
0e8b7ef656
@ -180,7 +180,7 @@ function delivery_prepare_head($object)
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
$upload_dir = $conf->commande->dir_output."/".dol_sanitizeFileName($tmpobject->ref);
|
$upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref);
|
||||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||||
$nbLinks = Link::count($db, $tmpobject->element, $tmpobject->id);
|
$nbLinks = Link::count($db, $tmpobject->element, $tmpobject->id);
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$tmpobject->id;
|
$head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$tmpobject->id;
|
||||||
|
|||||||
@ -110,11 +110,9 @@ print '</table>';
|
|||||||
|
|
||||||
// We close div and reopen for second column
|
// We close div and reopen for second column
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
print '<table class="border centpercent tableforfield">';
|
|
||||||
|
|
||||||
|
$rightpart = '';
|
||||||
$alreadyoutput = 1;
|
$alreadyoutput = 1;
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
if ($alreadyoutput) {
|
if ($alreadyoutput) {
|
||||||
@ -139,38 +137,46 @@ foreach ($object->fields as $key => $val) {
|
|||||||
|
|
||||||
$value = $object->$key;
|
$value = $object->$key;
|
||||||
|
|
||||||
print '<tr><td';
|
$rightpart .= '<tr><td';
|
||||||
print ' class="'.(empty($val['tdcss']) ? 'titlefield' : $val['tdcss']).' fieldname_'.$key;
|
$rightpart .= ' class="'.(empty($val['tdcss']) ? 'titlefield' : $val['tdcss']).' fieldname_'.$key;
|
||||||
//if ($val['notnull'] > 0) print ' fieldrequired'; // No fieldrequired inthe view output
|
//if ($val['notnull'] > 0) $rightpart .= ' fieldrequired'; // No fieldrequired inthe view output
|
||||||
if ($val['type'] == 'text' || $val['type'] == 'html') {
|
if ($val['type'] == 'text' || $val['type'] == 'html') {
|
||||||
print ' tdtop';
|
$rightpart .= ' tdtop';
|
||||||
}
|
}
|
||||||
print '">';
|
$rightpart.= '">';
|
||||||
if (!empty($val['help'])) {
|
if (!empty($val['help'])) {
|
||||||
print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
$rightpart .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans($val['label']);
|
$rightpart .= $langs->trans($val['label']);
|
||||||
}
|
}
|
||||||
print '</td>';
|
$rightpart .= '</td>';
|
||||||
print '<td class="valuefield fieldname_'.$key;
|
$rightpart .= '<td class="valuefield fieldname_'.$key;
|
||||||
if ($val['type'] == 'text') {
|
if ($val['type'] == 'text') {
|
||||||
print ' wordbreak';
|
$rightpart .= ' wordbreak';
|
||||||
}
|
}
|
||||||
if (!empty($val['cssview'])) {
|
if (!empty($val['cssview'])) {
|
||||||
print ' '.$val['cssview'];
|
$rightpart .= ' '.$val['cssview'];
|
||||||
}
|
}
|
||||||
print '">';
|
$rightpart .= '">';
|
||||||
if (in_array($val['type'], array('text', 'html'))) {
|
if (in_array($val['type'], array('text', 'html'))) {
|
||||||
print '<div class="longmessagecut">';
|
$rightpart .= '<div class="longmessagecut">';
|
||||||
}
|
}
|
||||||
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
$rightpart .= $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||||
//print dol_escape_htmltag($object->$key, 1, 1);
|
//$rightpart .= dol_escape_htmltag($object->$key, 1, 1);
|
||||||
if (in_array($val['type'], array('text', 'html'))) {
|
if (in_array($val['type'], array('text', 'html'))) {
|
||||||
print '</div>';
|
$rightpart .= '</div>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
$rightpart .= '</td>';
|
||||||
print '</tr>';
|
$rightpart .= '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichehalfright">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
|
print $rightpart;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- END PHP TEMPLATE commonfields_view.tpl.php -->
|
<!-- END PHP TEMPLATE commonfields_view.tpl.php -->
|
||||||
|
|||||||
@ -101,7 +101,7 @@ if ($action == 'add') {
|
|||||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||||
|
|
||||||
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) {
|
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) {
|
||||||
$expedition->entrepot_id = GETPOST('entrepot_id');
|
$expedition->entrepot_id = GETPOST('entrepot_id', 'int');
|
||||||
}
|
}
|
||||||
|
|
||||||
// We loop on each line of order to complete object delivery with qty to delivery
|
// We loop on each line of order to complete object delivery with qty to delivery
|
||||||
@ -282,7 +282,7 @@ if ($action == 'create') { // Create. Seems to no be used
|
|||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="ref" value="'.$object->ref.'">';
|
print '<input type="hidden" name="ref" value="'.$object->ref.'">';
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'delivery', $langs->trans("Shipment"), -1, 'sending');
|
print dol_get_fiche_head($head, 'delivery', $langs->trans("Shipment"), -1, 'dolly');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression
|
* Confirmation de la suppression
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user