21require
'../../../../main.inc.php';
31if ($user->socid > 0) {
36require_once DOL_DOCUMENT_ROOT .
'/admin/tools/ui/class/documentation.class.php';
37require_once DOL_DOCUMENT_ROOT .
'/core/class/html.form.class.php';
40$langs->load(
'uxdocumentation');
43$hookmanager->initHooks(array(
'uidocumentation'));
50 '/includes/ace/src/ace.js',
51 '/includes/ace/src/ext-statusbar.js',
52 '/includes/ace/src/ext-language_tools.js',
55$documentation->docHeader(
'Tables', $morejs);
59$documentation->view = array(
'Content',
'Tables');
62$documentation->showSidebar(); ?>
64<div
class=
"doc-wrapper">
66 <?php $documentation->showBreadCrumb(); ?>
68 <div
class=
"doc-content-wrapper">
70 <h1
class=
"documentation-title"><?php echo $langs->trans(
'DocTableTitle'); ?></h1>
71 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTableMainDescription'); ?></p>
72 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTableMainDescriptionNote'); ?></p>
75 <?php $documentation->showSummary(); ?>
78 <div
class=
"documentation-section" id=
"tablesection-basicusage">
80 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocTableBasic'); ?></h2>
82 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTableBasicDescription'); ?></p>
83 <div
class=
"documentation-example">
84 <div
class=
"div-table-responsive">
85 <
table class=
"tagtable liste" id=
"we-recommend-always-adding-a-unique-identifier">
87 <tr
class=
"liste_titre">
88 <th
class=
"wrapcolumntitle left liste_titre" data-col=
"ProductRef" title=
"<?php echo dol_escape_htmltag($langs->trans('ProductRef')); ?>"><?php echo $langs->trans(
'ProductRef'); ?></th>
89 <th
class=
"wrapcolumntitle center liste_titre" data-col=
"qty" title=
"<?php echo dol_escape_htmltag($langs->trans('Qty')); ?>"><?php echo $langs->trans(
'Qty'); ?></th>
90 <th
class=
"wrapcolumntitle right liste_titre" data-col=
"amount-no-tax" title=
"<?php echo dol_escape_htmltag($langs->trans('AmountHT')); ?>"><?php echo $langs->trans(
'AmountHT'); ?></th>
91 <th
class=
"wrapcolumntitle right liste_titre" data-col=
"total-no-tax" title=
"<?php echo dol_escape_htmltag($langs->trans('TotalHT')); ?>"><?php echo $langs->trans(
'TotalHT'); ?></th>
96 <td
class=
"left" data-col=
"ProductRef" >My
Product A</td>
97 <td
class=
"center" data-col=
"qty" >13</td>
98 <td
class=
"right amount" data-col=
"amount-no-tax" ><?php echo
price(9.99, 0,
'', 1, -1, -1,
'auto'); ?></td>
99 <td
class=
"right amount" data-col=
"total-no-tax" ><?php echo
price(129.87, 0,
'', 1, -1, -1,
'auto'); ?></td>
102 <td
class=
"left" data-col=
"ProductRef" >My
Product B</td>
103 <td
class=
"center" data-col=
"qty" >21</td>
104 <td
class=
"right amount" data-col=
"amount-no-tax" ><?php echo
price(13.37, 0,
'', 1, -1, -1,
'auto'); ?></td>
105 <td
class=
"right amount" data-col=
"total-no-tax" ><?php echo
price(280.77, 0,
'', 1, -1, -1,
'auto'); ?></td>
108 <td
class=
"left" data-col=
"ProductRef" >My
Product C</td>
109 <td
class=
"center" data-col=
"qty" >7</td>
110 <td
class=
"right amount" data-col=
"amount-no-tax" ><?php echo
price(16.66, 0,
'', 1, -1, -1,
'auto'); ?></td>
111 <td
class=
"right amount" data-col=
"total-no-tax" ><?php echo
price(116.62, 0,
'', 1, -1, -1,
'auto'); ?></td>
115 <tr
class=
"liste_total">
116 <td
class=
"left" data-col=
"ProductRef" >Total</td>
117 <td
class=
"center" data-col=
"qty" >41</td>
118 <td
class=
"right amount" data-col=
"amount-no-tax" >--</td>
119 <td
class=
"right amount" data-col=
"total-no-tax" ><?php echo
price(527.26, 0,
'', 1, -1, -1,
'auto'); ?></td>
127 '<table class="tagtable liste" id="we-recommend-always-adding-a-unique-identifier" >',
129 ' <!-- Table header -->',
131 ' <tr class="liste_titre">',
132 ' <th class="wrapcolumntitle left liste_titre" data-col="ProductRef" title="<?php echo dol_escape_htmltag($langs->trans(\'ProductRef\')); ?>"><?php echo $langs->trans(\'ProductRef\'); ?></th>',
133 ' <th class="wrapcolumntitle left liste_titre" data-col="qty" title="<?php echo dol_escape_htmltag($langs->trans(\'Qty\')); ?>"><?php echo $langs->trans(\'Qty\'); ?></th>',
134 ' <th class="wrapcolumntitle center liste_titre" data-col="amount-no-tax" title="<?php echo dol_escape_htmltag($langs->trans(\'AmountHT\')); ?>"><?php echo $langs->trans(\'AmountHT\'); ?></th>',
135 ' <th class="wrapcolumntitle right liste_titre" data-col="total-no-tax" title="<?php echo dol_escape_htmltag($langs->trans(\'TotalHT\')); ?>"><?php echo $langs->trans(\'TotalHT\'); ?></th>',
140 ' <!-- Data lines -->',
141 ' <tr class="oddeven">',
142 ' <td class="left" data-col="ProductRef" >My Product A</td>',
143 ' <td class="left" data-col="qty" >13</td>',
144 ' <td class="center amount" data-col="amount-no-tax" >9,99 €</td>',
145 ' <td class="right amount" data-col="total-no-tax" >129,87 €</td>',
147 ' <tr class="oddeven">',
148 ' <td class="left" data-col="ProductRef" >My Product B</td>',
149 ' <td class="left" data-col="qty" >21</td>',
150 ' <td class="center amount" data-col="amount-no-tax" >13,37 €</td>',
151 ' <td class="right amount" data-col="total-no-tax" >280,77 €</td>',
157 ' <tr class="liste_total">',
158 ' <td class="left" data-col="ProductRef" >Total</td>',
159 ' <td class="left" data-col="qty" >58</td>',
160 ' <td class="center amount" data-col="amount-no-tax" >--</td>',
161 ' <td class="right amount" data-col="total-no-tax" >1178,87 €</td>',
167 $documentation->showCode($lines,
'php'); ?>
170 <!-- Table with filters -->
171 <div
class=
"documentation-section" id=
"tablesection-withfilters">
173 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocTableWithFilters'); ?></h2>
175 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTableWithFiltersDescription',
dol_buildpath(
'admin/tools/ui/components/inputs.php', 1)); ?></p>
176 <div
class=
"documentation-example">
177 <div
class=
"div-table-responsive">
178 <
table class=
"tagtable liste">
179 <tr
class=
"liste_titre_filter">
180 <td
class=
"liste_titre center maxwidthsearch">
181 <div
class=
"nowraponall">
182 <
button type=
"submit" class=
"liste_titre button_search reposition" name=
"button_search_x" value=
"x">
183 <span
class=
"fas fa-search"></span>
185 <
button type=
"submit" class=
"liste_titre button_removefilter reposition" name=
"button_removefilter_x" value=
"x">
186 <span
class=
"fas fa-times"></span>
190 <td><input
class=
"flat" type=
"text" name=
"search_firstname" value=
""></td>
191 <td><input
class=
"flat" type=
"text" name=
"search_lasttname" value=
""></td>
192 <td
class=
"center"><input
class=
"maxwidth50 flat" type=
"text" name=
"search_age" value=
""></td>
193 <td
class=
"right"><input
class=
"flat" type=
"text" name=
"search_country" value=
""></td>
195 <tr
class=
"liste_titre">
197 <dl
class=
"dropdown" style=
"opacity: 0.5;">
198 <dt><span
class=
"fas fa-list" style=
""></span></dt>
199 <dd
class=
"dropdowndd">
200 <div
class=
"multiselectcheckboxselectedfields">
201 <ul
class=
"selectedfieldsleft"></ul>
205 <div
class=
"inline-block checkallactions"><input
type=
"checkbox" id=
"checkforselects" name=
"checkforselects" class=
"checkallactions" disabled></div>
207 <th
class=
"wrapcolumntitle left liste_titre" title=
"First Name">First Name</th>
208 <th
class=
"wrapcolumntitle left liste_titre" title=
"Last Name">Last Name</th>
209 <th
class=
"wrapcolumntitle center liste_titre" title=
"Age">Age</th>
210 <th
class=
"wrapcolumntitle right liste_titre" title=
"Country">Country</th>
214 <td
class=
"left">John</td>
215 <td
class=
"left">Doe</td>
216 <td
class=
"center">37</td>
217 <td
class=
"right">U.S.A</td>
221 <td
class=
"left">Jack</td>
222 <td
class=
"left">Sparrow</td>
223 <td
class=
"center">29</td>
224 <td
class=
"right">Caribbean</td>
228 <td
class=
"left">Sacha</td>
229 <td
class=
"left">Ketchum</td>
230 <td
class=
"center">16</td>
231 <td
class=
"right">Kanto</td>
235 <td
class=
"left">Albert</td>
236 <td
class=
"left">Einstein</td>
237 <td
class=
"center">72</td>
238 <td
class=
"right">Germany</td>
245 '<form method="POST" id="FORMID" action="ACTION_URL">',
247 ' <input type="hidden" name="token" value="TOKEN_VALUE">',
248 ' <input type="hidden" name="action" value="ACTION_VALUE">',
249 ' <!-- other hidden fields like sortfield, sortorder, page, ... -->',
251 ' <table class="tagtable liste" id="we-recommend-always-adding-a-unique-identifier">',
253 ' <!-- Filters row -->',
254 ' <tr class="liste_titre_filter">',
255 ' <td class="liste_titre center maxwidthsearch">',
256 ' <div class="nowraponall">',
257 ' <button type="submit" class="liste_titre button_search reposition" name="button_search_x" value="x">',
258 ' <span class="fas fa-search"></span>',
260 ' <button type="submit" class="liste_titre button_removefilter reposition" name="button_removefilter_x" value="x">',
261 ' <span class="fas fa-times"></span>',
266 ' <input class="flat" type="text" name="search_firstname" value="">',
269 ' <input class="flat" type="text" name="search_lasttname" value="">',
271 ' <td class="center">',
272 ' <input class="maxwidth50 flat" type="text" name="search_age" value="">',
274 ' <td class="right">',
275 ' <input class="flat" type="text" name="search_country" value="">',
279 ' <!-- Table header -->',
280 ' <!-- Data lines -->',
286 $documentation->showCode($lines); ?>
289 <!-- Add a row before filters -->
290 <div
class=
"documentation-section" id=
"tablesection-beforefilters">
292 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocTableBeforeFilters'); ?></h2>
294 <p
class=
"documentation-text"><?php echo $langs->trans(
'DocTableBeforeFiltersDescription'); ?></p>
295 <div
class=
"documentation-example">
296 <div
class=
"div-table-responsive">
297 <div
class=
"liste_titre liste_titre_bydiv centpercent">
298 <div
class=
"divsearchfield">
299 <span
class=
"fas fa-tag pictofixedwidth" style=
"" title=
"TitleOfMySelectBeforeFilter"></span>
300 <?php echo $form->selectarray(
'myselectbeforefilter', array(
'ValueFilterA',
'ValueFilterB',
'ValueFilterC'),
'', 1); ?>
303 <
table class=
"tagtable liste listwithfilterbefore">
304 <tr
class=
"liste_titre_filter">
305 <td
class=
"liste_titre center maxwidthsearch">
306 <div
class=
"nowraponall">
307 <
button type=
"submit" class=
"liste_titre button_search reposition" name=
"button_search_x" value=
"x">
308 <span
class=
"fas fa-search"></span>
310 <
button type=
"submit" class=
"liste_titre button_removefilter reposition" name=
"button_removefilter_x" value=
"x">
311 <span
class=
"fas fa-times"></span>
315 <td><input
class=
"flat" type=
"text" name=
"search_firstname" value=
""></td>
316 <td><input
class=
"flat" type=
"text" name=
"search_lasttname" value=
""></td>
317 <td
class=
"center"><input
class=
"maxwidth50 flat" type=
"text" name=
"search_age" value=
""></td>
318 <td
class=
"right"><input
class=
"flat" type=
"text" name=
"search_country" value=
""></td>
320 <tr
class=
"liste_titre">
322 <dl
class=
"dropdown" style=
"opacity: 0.5;">
323 <dt><span
class=
"fas fa-list" style=
""></span></dt>
324 <dd
class=
"dropdowndd">
325 <div
class=
"multiselectcheckboxselectedfields">
326 <ul
class=
"selectedfieldsleft"></ul>
330 <div
class=
"inline-block checkallactions"><input
type=
"checkbox" id=
"checkforselects" name=
"checkforselects" class=
"checkallactions" disabled></div>
332 <th
class=
"wrapcolumntitle left liste_titre" title=
"First Name">First Name</th>
333 <th
class=
"wrapcolumntitle left liste_titre" title=
"Last Name">Last Name</th>
334 <th
class=
"wrapcolumntitle center liste_titre" title=
"Age">Age</th>
335 <th
class=
"wrapcolumntitle right liste_titre" title=
"Country">Country</th>
339 <td
class=
"left">John</td>
340 <td
class=
"left">Doe</td>
341 <td
class=
"center">37</td>
342 <td
class=
"right">U.S.A</td>
346 <td
class=
"left">Jack</td>
347 <td
class=
"left">Sparrow</td>
348 <td
class=
"center">29</td>
349 <td
class=
"right">Caribbean</td>
353 <td
class=
"left">Sacha</td>
354 <td
class=
"left">Ketchum</td>
355 <td
class=
"center">16</td>
356 <td
class=
"right">Kanto</td>
360 <td
class=
"left">Albert</td>
361 <td
class=
"left">Einstein</td>
362 <td
class=
"center">72</td>
363 <td
class=
"right">Germany</td>
370 '<div class="liste_titre liste_titre_bydiv centpercent">',
371 ' <div class="divsearchfield">',
372 ' <span class="fas fa-tag pictofixedwidth" style="" title="TitleOfMySelectBeforeFilter"></span>',
373 ' <!-- Use Form Class to show a select, see Inputs section. Select below is for example -->',
374 ' <select name="myselectbeforefilter">',
375 ' <option value="-1"></option>',
376 ' <option value="ValueFilterA">ValueFilterA</option>',
377 ' <option value="ValueFilterB">ValueFilterB</option>',
378 ' <option value="ValueFilterC">ValueFilterC</option>',
382 '<table class="tagtable liste listwithfilterbefore" id="we-recommend-always-adding-a-unique-identifier">',
383 ' <!-- Filters row -->',
384 ' <!-- Table header -->',
385 ' <!-- Data lines -->',
389 $documentation->showCode($lines); ?>
392 <!-- CSS classes
for tables -->
393 <div
class=
"documentation-section" id=
"tablesection-cssclasses">
395 <h2
class=
"documentation-title"><?php echo $langs->trans(
'DocTableCSSClass'); ?></h2>
397 <p
class=
"documentation-text"><?php echo $langs->transnoentities(
'DocTableCSSClassDescription'); ?></p>
399 <p
class=
"documentation-text"><?php echo $langs->transnoentities(
'DocTableTABLECSSClassDescription'); ?></p>
401 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_tagtable'); ?></li>
402 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_liste'); ?></li>
403 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_listwithfilterbefore'); ?></li>
406 <p
class=
"documentation-text"><?php echo $langs->transnoentities(
'DocTableTRCSSClassDescription'); ?></p>
408 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_liste_titre'); ?></li>
409 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_liste_titre_filter'); ?></li>
410 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_liste_total'); ?></li>
411 <li><?php echo $langs->transnoentities(
'DocTableCSSClass_oddeven'); ?></li>
421$documentation->docFooter();
Class to manage UI documentation.
Class to manage products or services.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
treeview li table
No Email.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.