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