dolibarr 21.0.0-beta
tables.php
1<?php
2/*
3 * Copyright (C) 2024 Anthony Damhet <a.damhet@progiseize.fr>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
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 */
19
20// Load Dolibarr environment
21require '../../../../main.inc.php';
22
30// Protection if external user
31if ($user->socid > 0) {
33}
34
35// Includes
36require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php';
37
38// Load documentation translations
39$langs->load('uxdocumentation');
40
41// Hooks
42$hookmanager->initHooks(array('uidocumentation'));
43
44//
45$documentation = new Documentation($db);
46
47// Output html head + body - Param is Title
48$documentation->docHeader('Tables');
49
50// Set view for menu and breadcrumb
51// Menu must be set in constructor of documentation class
52$documentation->view = array('Content','Tables');
53
54// Output sidebar
55$documentation->showSidebar(); ?>
56
57<div class="doc-wrapper">
58
59 <?php $documentation->showBreadCrumb(); ?>
60
61 <div class="doc-content-wrapper">
62
63 <h1 class="documentation-title"><?php echo $langs->trans('DocTableTitle'); ?></h1>
64 <p class="documentation-text"><?php echo $langs->trans('Description'); ?></p>
65
66 <!-- Summary -->
67 <?php $documentation->showSummary(); ?>
68
69 <!-- Basic usage -->
70 <div class="documentation-section" id="tablesection-basicusage">
71
72 <h2 class="documentation-title">Table with a title line</h2>
73
74 <p class="documentation-text"><?php echo $langs->trans('DocTableBasicDescription'); ?></p>
75 <div class="documentation-example">
76 <div class="div-table-responsive">
77 <table class="tagtable noborder liste nobottomiftotal">
78 <tr class="liste_titre">
79 <th class="wrapcolumntitle left liste_titre" title="First Name">First Name</th>
80 <th class="wrapcolumntitle left liste_titre" title="Last Name">Last Name</th>
81 <th class="wrapcolumntitle center liste_titre" title="Age">Age</th>
82 <th class="wrapcolumntitle right liste_titre" title="Country">Country</th>
83 </tr>
84 <tr class="oddeven">
85 <td class="left">John</td>
86 <td class="left">Doe</td>
87 <td class="center">37</td>
88 <td class="right">U.S.A</td>
89 </tr>
90 <tr class="oddeven">
91 <td class="left">Jack</td>
92 <td class="left">Sparrow</td>
93 <td class="center">29</td>
94 <td class="right">Caribbean</td>
95 </tr>
96 <tr class="oddeven">
97 <td class="left">Sacha</td>
98 <td class="left">Ketchum</td>
99 <td class="center">16</td>
100 <td class="right">Kanto</td>
101 </tr>
102 <tr class="oddeven">
103 <td class="left">Albert</td>
104 <td class="left">Einstein</td>
105 <td class="center">72</td>
106 <td class="right">Germany</td>
107 </tr>
108 </table>
109 </div>
110 </div>
111 <?php
112 $lines = array(
113 );
114 echo $documentation->showCode($lines); ?>
115 </div>
116
117 <!-- Table with filters -->
118 <div class="documentation-section" id="tablesection-withfilters">
119
120 <h2 class="documentation-title">Table with a filter line and title line</h2>
121
122 <p class="documentation-text"><?php echo $langs->trans('DocTableWithFiltersDescription'); ?></p>
123 <div class="documentation-example">
124 <div class="div-table-responsive">
125 <table class="tagtable noborder nobottomiftotal liste">
126 <tr class="liste_titre_filter">
127 <td><input></td>
128 <td></td>
129 <td></td>
130 <td></td>
131 </tr>
132 <tr class="liste_titre">
133 <th class="wrapcolumntitle left liste_titre" title="First Name">First Name</th>
134 <th class="wrapcolumntitle left liste_titre" title="Last Name">Last Name</th>
135 <th class="wrapcolumntitle center liste_titre" title="Age">Age</th>
136 <th class="wrapcolumntitle right liste_titre" title="Country">Country</th>
137 </tr>
138 <tr class="oddeven">
139 <td class="left">John</td>
140 <td class="left">Doe</td>
141 <td class="center">37</td>
142 <td class="right">U.S.A</td>
143 </tr>
144 <tr class="oddeven">
145 <td class="left">Jack</td>
146 <td class="left">Sparrow</td>
147 <td class="center">29</td>
148 <td class="right">Caribbean</td>
149 </tr>
150 <tr class="oddeven">
151 <td class="left">Sacha</td>
152 <td class="left">Ketchum</td>
153 <td class="center">16</td>
154 <td class="right">Kanto</td>
155 </tr>
156 <tr class="oddeven">
157 <td class="left">Albert</td>
158 <td class="left">Einstein</td>
159 <td class="center">72</td>
160 <td class="right">Germany</td>
161 </tr>
162 </table>
163 </div>
164 </div>
165 <?php
166 $lines = array(
167 );
168 echo $documentation->showCode($lines); ?>
169 </div>
170
171
172 <!-- Table with no filter and no title line -->
173 <div class="documentation-section" id="tablesection-withfilters">
174
175 <h2 class="documentation-title">Table with no filter, no title line</h2>
176
177 <p class="documentation-text"><?php echo $langs->trans('Description'); ?></p>
178 <div class="documentation-example">
179 <div class="div-table-responsive">
180 <table class="tagtable noborder nobottomiftotal liste">
181 <tr class="oddeven trfirstline">
182 <td class="left">John</td>
183 <td class="left">Doe</td>
184 <td class="center">37</td>
185 <td class="right">U.S.A</td>
186 </tr>
187 <tr class="oddeven">
188 <td class="left">Jack</td>
189 <td class="left">Sparrow</td>
190 <td class="center">29</td>
191 <td class="right">Caribbean</td>
192 </tr>
193 <tr class="oddeven">
194 <td class="left">Sacha</td>
195 <td class="left">Ketchum</td>
196 <td class="center">16</td>
197 <td class="right">Kanto</td>
198 </tr>
199 <tr class="oddeven trlastline">
200 <td class="left">Albert</td>
201 <td class="left">Einstein</td>
202 <td class="center">72</td>
203 <td class="right">Germany</td>
204 </tr>
205 </table>
206 </div>
207 </div>
208 <?php
209 $lines = array(
210 );
211 echo $documentation->showCode($lines); ?>
212 </div>
213
214 </div>
215
216 </div>
217
218<?php
219// Output close body + html
220$documentation->docFooter();
221?>
Class to manage UI documentation.
treeview li table
No Email.
usage($program, $header)
Print the usage when executing scripts from install/.
Definition inc.php:94
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.