36@phan-var-force Propal|Commande|Facture|FactureRec|Expedition|SupplierProposal|CommandeFournisseur|FactureFournisseur $this
37@phan-var-force ?array<int,string> $depth_array
38@phan-var-force ?array<string,string> $titles
39@phan-var-force string $type
42$depth_array = $depth_array ?? array();
43$titles = $titles ?? array();
45if ($type ==
'subtotal' && empty($titles)) {
50$formquestion = array();
52if ($type ==
'title') {
53 $formquestion = array(
54 array(
'type' =>
'text',
'name' =>
'subtotallinedesc',
'label' => $langs->trans(
"SubtotalLineDesc"),
'moreattr' =>
'placeholder="' . $langs->trans(
"Description") .
'"'),
55 array(
'type' =>
'select',
'name' =>
'subtotallinelevel',
'label' => $langs->trans(
"SubtotalLineLevel"),
'values' => $depth_array,
'default' => 1,
'select_show_empty' => 0),
56 array(
'type' =>
'checkbox',
'value' =>
true,
'name' =>
'titleshowuponpdf',
'label' => $langs->trans(
"ShowUPOnPDF")),
57 array(
'type' =>
'checkbox',
'value' =>
true,
'name' =>
'titleshowtotalexludingvatonpdf',
'label' => $langs->trans(
"ShowTotalExludingVATOnPDF")),
58 array(
'type' =>
'checkbox',
'value' =>
false,
'name' =>
'titleforcepagebreak',
'label' => $langs->trans(
"ForcePageBreak")),
60} elseif ($type ==
'subtotal') {
61 $formquestion = array(
62 array(
'type' =>
'select',
'name' =>
'subtotaltitleline',
'label' => $langs->trans(
"CorrespondingTitleLine"),
'values' => $titles,
'select_show_empty' => 0),
63 array(
'type' =>
'checkbox',
'value' =>
true,
'name' =>
'subtotalshowtotalexludingvatonpdf',
'label' => $langs->trans(
"ShowTotalExludingVATOnPDF")),
67$page = $_SERVER[
"PHP_SELF"];
69if (
$object->element ==
'facture') {
70 $page .=
'?facid=' .
$object->id;
71} elseif (in_array(
$object->element, $object::$ALLOWED_TYPES)) {
75$form_title = $type ==
'title' ? $langs->trans(
'AddTitleLine') : $langs->trans(
'AddSubtotalLine');
77print $form->formconfirm($page, $form_title,
'',
'confirm_add' . $type .
'line', $formquestion,
'yes', 1);
if(! $sortfield) if(! $sortorder) $object
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.