36@phan-var-force CommonObject $this
39$depth_array = $depth_array ?? array();
40$titles = $titles ?? array();
42if ($type ==
'subtotal' && empty($titles)) {
47$formquestion = array();
49if ($type ==
'title') {
50 $formquestion = array(
51 array(
'type' =>
'text',
'name' =>
'subtotallinedesc',
'label' => $langs->trans(
"SubtotalLineDesc"),
'moreattr' =>
'placeholder="' . $langs->trans(
"Description") .
'"'),
52 array(
'type' =>
'select',
'name' =>
'subtotallinelevel',
'label' => $langs->trans(
"SubtotalLineLevel"),
'values' => $depth_array,
'default' => 1,
'select_show_empty' => 0),
53 array(
'type' =>
'checkbox',
'value' =>
false,
'name' =>
'titleshowuponpdf',
'label' => $langs->trans(
"ShowUPOnPDF")),
54 array(
'type' =>
'checkbox',
'value' =>
false,
'name' =>
'titleshowtotalexludingvatonpdf',
'label' => $langs->trans(
"ShowTotalExludingVATOnPDF")),
55 array(
'type' =>
'checkbox',
'value' =>
false,
'name' =>
'titleforcepagebreak',
'label' => $langs->trans(
"ForcePageBreak")),
57} elseif ($type ==
'subtotal') {
58 $formquestion = array(
59 array(
'type' =>
'select',
'name' =>
'subtotaltitleline',
'label' => $langs->trans(
"CorrespondingTitleLine"),
'values' => $titles,
'select_show_empty' => 0),
60 array(
'type' =>
'checkbox',
'value' =>
false,
'name' =>
'subtotalshowtotalexludingvatonpdf',
'label' => $langs->trans(
"ShowTotalExludingVATOnPDF")),
64$page = $_SERVER[
"PHP_SELF"];
66if (
$object->element ==
'facture') {
67 $page .=
'?facid=' .
$object->id;
68} elseif (in_array(
$object->element, array(
'propal',
'commande',
'facturerec',
'shipping'))) {
72$form_title = $type ==
'title' ? $langs->trans(
'AddTitleLine') : $langs->trans(
'AddSubtotalLine');
74print $form->formconfirm($page, $form_title,
'',
'confirm_add' . $type .
'line', $formquestion,
'yes', 1);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.