dolibarr 24.0.0-beta
report.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 * Copyright (C) 2026 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * or see https://www.gnu.org/
20 */
21
43function report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink = '', $moreparam = array(), $calcmode = '', $varlink = '')
44{
45 global $langs;
46
47 print "\n\n<!-- start banner of report -->\n";
48
49 if (!empty($varlink)) {
50 $varlink = '?'.$varlink;
51 }
52
53 $title = $langs->trans("Report");
54
55 print_barre_liste($title, 0, '', '', '', '', '', -1, '', 'generic', 0, '', '', -1, 1, 1);
56
57 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].$varlink.'">'."\n";
58 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
59
60 print dol_get_fiche_head();
61
62 foreach ($moreparam as $key => $value) {
63 print '<input type="hidden" name="'.$key.'" value="'.$value.'">'."\n";
64 }
65
66 print '<table class="border tableforfield centpercent">'."\n";
67
68 $variant = ($periodlink || $exportlink);
69
70 // Title line
71 print '<tr>';
72 print '<td width="150">'.$langs->trans("ReportName").'</td>';
73 print '<td>';
74 print $reportname;
75 print '</td>';
76 if ($variant) {
77 print '<td></td>';
78 }
79 print '</tr>'."\n";
80
81 // Calculation mode
82 if ($calcmode) {
83 print '<tr>';
84 print '<td width="150">'.$langs->trans("CalculationMode").'</td>';
85 print '<td>';
86 print $calcmode;
87 if ($variant) {
88 print '<td></td>';
89 }
90 print '</td>';
91 print '</tr>'."\n";
92 }
93
94 // Report analysis period row
95 print '<tr>';
96 print '<td>'.$langs->trans("ReportPeriod").'</td>';
97 print '<td>';
98 if ($period) {
99 print $period;
100 }
101 if ($variant) {
102 print '<td class="nowraponall">'.$periodlink.'</td>';
103 }
104 print '</td>';
105 print '</tr>'."\n";
106
107 // Description row
108 print '<tr>';
109 print '<td>'.$langs->trans("ReportDescription").'</td>';
110 print '<td>'.$description.'</td>';
111 if ($variant) {
112 print '<td></td>';
113 }
114 print '</tr>'."\n";
115
116 // Export row
117 print '<tr>';
118 print '<td>'.$langs->trans("GeneratedOn").'</td>';
119 print '<td>';
120 print dol_print_date($builddate, 'dayhour');
121 print '</td>';
122 if ($variant) {
123 print '<td>'.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'</td>';
124 }
125 print '</tr>'."\n";
126
127 print '</table>'."\n";
128
129 print dol_get_fiche_end();
130
131 print '<div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
132
133 print '</form>';
134 print '<br>';
135
136 print "\n<!-- end banner of report -->\n\n";
137}
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.