|
1
|
|
|
<?php |
|
2
|
|
|
/* <one line to give the program's name and a brief idea of what it does.> |
|
3
|
|
|
* Copyright (C) <year> <name of author> |
|
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 <http://www.gnu.org/licenses/>. |
|
17
|
|
|
*/ |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* \file core/boxes/mybox.php |
|
21
|
|
|
* \ingroup intracommreport |
|
22
|
|
|
* \brief This file is a sample box definition file |
|
23
|
|
|
* Put some comments here |
|
24
|
|
|
*/ |
|
25
|
|
|
include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php"; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Class to manage the box |
|
29
|
|
|
*/ |
|
30
|
|
|
class intracommreportbox extends ModeleBoxes |
|
31
|
|
|
{ |
|
32
|
|
|
|
|
33
|
|
|
public $boxcode = "mybox"; |
|
34
|
|
|
public $boximg = "intracommreport"; |
|
35
|
|
|
public $boxlabel; |
|
36
|
|
|
public $depends = array("intracommreport"); |
|
37
|
|
|
public $db; |
|
38
|
|
|
public $param; |
|
39
|
|
|
public $info_box_head = array(); |
|
40
|
|
|
public $info_box_contents = array(); |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Constructor |
|
44
|
|
|
*/ |
|
45
|
|
|
public function __construct() |
|
46
|
|
|
{ |
|
47
|
|
|
global $langs; |
|
48
|
|
|
$langs->load("boxes"); |
|
49
|
|
|
|
|
50
|
|
|
$this->boxlabel = $langs->transnoentitiesnoconv("MyBox"); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Load data into info_box_contents array to show array later. |
|
55
|
|
|
* |
|
56
|
|
|
* @param int $max Maximum number of records to load |
|
57
|
|
|
* @return void |
|
58
|
|
|
*/ |
|
59
|
|
|
public function loadBox($max = 5) |
|
60
|
|
|
{ |
|
61
|
|
|
global $conf, $user, $langs, $db; |
|
62
|
|
|
|
|
63
|
|
|
$this->max = $max; |
|
64
|
|
|
|
|
65
|
|
|
//include_once DOL_DOCUMENT_ROOT . "/intracommreport/class/intracommreport.class.php"; |
|
66
|
|
|
|
|
67
|
|
|
$text = $langs->trans("MyBoxDescription", $max); |
|
68
|
|
|
$this->info_box_head = array( |
|
69
|
|
|
'text' => $text, |
|
70
|
|
|
'limit' => dol_strlen($text) |
|
71
|
|
|
); |
|
72
|
|
|
|
|
73
|
|
|
$this->info_box_contents[0][0] = array('td' => 'align="left"', |
|
74
|
|
|
'text' => $langs->trans("MyBoxContent")); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Method to show box |
|
79
|
|
|
* |
|
80
|
|
|
* @param array $head Array with properties of box title |
|
81
|
|
|
* @param array $contents Array with properties of box lines |
|
82
|
|
|
* @return void |
|
83
|
|
|
*/ |
|
84
|
|
|
public function showBox($head = null, $contents = null) |
|
85
|
|
|
{ |
|
86
|
|
|
parent::showBox($this->info_box_head, $this->info_box_contents); |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|