dolibarr 21.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 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 * or see https://www.gnu.org/
19 */
20
42function report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink = '', $moreparam = array(), $calcmode = '', $varlink = '')
43{
44 global $langs;
45
46 print "\n\n<!-- start banner of report -->\n";
47
48 if (!empty($varlink)) {
49 $varlink = '?'.$varlink;
50 }
51
52 $title = $langs->trans("Report");
53
54 print_barre_liste($title, 0, '', '', '', '', '', -1, '', 'generic', 0, '', '', -1, 1, 1);
55
56 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].$varlink.'">'."\n";
57 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
58
59 print dol_get_fiche_head();
60
61 foreach ($moreparam as $key => $value) {
62 print '<input type="hidden" name="'.$key.'" value="'.$value.'">'."\n";
63 }
64
65 print '<table class="border tableforfield centpercent">'."\n";
66
67 $variant = ($periodlink || $exportlink);
68
69 // Ligne de titre
70 print '<tr>';
71 print '<td width="150">'.$langs->trans("ReportName").'</td>';
72 print '<td>';
73 print $reportname;
74 print '</td>';
75 if ($variant) {
76 print '<td></td>';
77 }
78 print '</tr>'."\n";
79
80 // Calculation mode
81 if ($calcmode) {
82 print '<tr>';
83 print '<td width="150">'.$langs->trans("CalculationMode").'</td>';
84 print '<td>';
85 print $calcmode;
86 if ($variant) {
87 print '<td></td>';
88 }
89 print '</td>';
90 print '</tr>'."\n";
91 }
92
93 // Ligne de la periode d'analyse du rapport
94 print '<tr>';
95 print '<td>'.$langs->trans("ReportPeriod").'</td>';
96 print '<td>';
97 if ($period) {
98 print $period;
99 }
100 if ($variant) {
101 print '<td class="nowraponall">'.$periodlink.'</td>';
102 }
103 print '</td>';
104 print '</tr>'."\n";
105
106 // Ligne de description
107 print '<tr>';
108 print '<td>'.$langs->trans("ReportDescription").'</td>';
109 print '<td>'.$description.'</td>';
110 if ($variant) {
111 print '<td></td>';
112 }
113 print '</tr>'."\n";
114
115 // Ligne d'export
116 print '<tr>';
117 print '<td>'.$langs->trans("GeneratedOn").'</td>';
118 print '<td>';
119 print dol_print_date($builddate, 'dayhour');
120 print '</td>';
121 if ($variant) {
122 print '<td>'.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'</td>';
123 }
124 print '</tr>'."\n";
125
126 print '</table>'."\n";
127
128 print dol_get_fiche_end();
129
130 print '<div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
131
132 print '</form>';
133 print '<br>';
134
135 print "\n<!-- end banner of report -->\n\n";
136}
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)
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)
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.