21if (!defined(
'NOREQUIRESOC')) {
22 define(
'NOREQUIRESOC',
'1');
25if (!defined(
'NOSTYLECHECK')) {
26 define(
'NOSTYLECHECK',
'1');
31if (!defined(
"NOLOGIN")) {
32 define(
"NOLOGIN",
'1');
35@include
'../../main.inc.php';
46if (!empty($dolibarr_main_prod) || empty($dolibarr_main_test)) {
47 accessforbidden(
'Access forbidden when $dolibarr_main_prod is set to 1 or $dolibarr_main_test is NOT set to 1 into conf.php');
50$optioncss =
GETPOST(
'optioncss',
'alpha');
64if (empty($usedolheader)) {
65 header(
"Content-type: text/html; charset=UTF8");
68 header(
"X-Content-Type-Options: nosniff");
69 header(
"X-Frame-Options: SAMEORIGIN");
71 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
74 <meta
name=
"robots" content=
"noindex,nofollow" />
75 <meta
name=
"author" content=
"Dolibarr Development Team">
76 <title>Test page</title>
77 <!-- Includes
for JQuery (Ajax library) -->
78 <link rel=
"stylesheet" type=
"text/css" href=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/css/base/jquery-ui.css" />
79 <!-- <link rel=
"stylesheet" type=
"text/css" href=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css" /> -->
80 <link rel=
"stylesheet" type=
"text/css" title=
"default" href=
"<?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php<?php echo (GETPOST("dol_use_jmobile
") == 1) ? '?dol_use_jmobile=1&dol_optimize_smallscreen=1' : ''; ?>" />
81 <!-- Includes JS
for JQuery -->
82 <script
type=
"text/javascript" src=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/js/jquery.min.js"></script>
83 <!-- migration fixes
for removed Jquery functions -->
84 <script
type=
"text/javascript" src=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/js/jquery-migrate.min.js"></script>
85 <script
type=
"text/javascript" src=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js"></script>
86 <!-- <script
type=
"text/javascript" src=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js"></script> -->
87 <script
type=
"text/javascript" src=
"<?php echo DOL_URL_ROOT ?>/public/includes/jquery/plugins/select2/select2.min.js?version=4.0.0-beta"></script>
90 <body style=
"padding: 10px;">
98 llxHeader(
'',
'',
'',
'', 0, 0, $arrayjs, $arraycss);
107This page is a sample of page
using tables. It is designed to make test with<br>
109<div
class=
"wordbreak">
110- css (add parameter &theme=newtheme to test another theme or edit css of current theme)<br>
111- jmobile (add parameter <a href=
"<?php echo $_SERVER["PHP_SELF
"].'?dol_use_jmobile=1&dol_optimize_smallscreen=1'; ?>">dol_use_jmobile=1&dol_optimize_smallscreen=1</a> and
switch to small screen < 570 to enable with emulated jmobile)<br>
112- no javascript / usage
for blind people (add parameter <a href=
"<?php echo $_SERVER["PHP_SELF
"].'?nojs=1'; ?>">nojs=1</a> to force disable javascript)<br>
117<br><hr><br>Example 0a : Table with div+div+div containing a select that should be overflowed and truncated => Use
this to align text or form<br>
119<div
class=
"tagtable centpercent">
121 <div
class=
"tagtd maxwidthonsmartphone" style=
"overflow: hidden; white-space: nowrap;"> <!-- If you
remove max-width, the jmobile overflow does not work -->
122 <select
name=
"hidedetails" class=
"centpercentonsmartphone"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
124 <div
class=
"tagtd maxwidthonsmartphone" style=
"overflow: hidden; white-space: nowrap;"> <!-- If you
remove max-width, the jmobile overflow does not work -->
125 <select
name=
"hidedetails" class=
"centpercentonsmartphone"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
130<br><hr><br>Example 0b: Table with div+form+div containing a select that should be overflowed and truncated => Use
this to align text or form<br>
132<div
class=
"tagtable centpercent">
133 <form action=
"xxx" method=
"POST" class=
"tagtr">
134 <div
class=
"tagtd maxwidthonsmartphone" style=
"overflow: hidden; white-space: nowrap;"> <!-- If you
remove max-width, the jmobile overflow does not work -->
135 <select
name=
"hidedetails" class=
"centpercentonsmartphone"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
137 <div
class=
"tagtd maxwidthonsmartphone" style=
"overflow: hidden; white-space: nowrap;"> <!-- If you
remove max-width, the jmobile overflow does not work -->
138 <select
name=
"hidedetails" class=
"centpercentonsmartphone"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
143<br><hr><br>Example 0c: Table with
table+tr+td containing a select that should be overflowed and truncated => Use
this to align text or form<br>
145<
table class=
"centpercent">
147 <td
class=
"tagtd maxwidthonsmartphone" style=
"overflow: hidden; white-space: nowrap;"> <!-- If you
remove max-width, the jmobile overflow does not work -->
148 <select
name=
"hidedetails" class=
"centpercentonsmartphone"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
150 <td
class=
"tagtd maxwidthonsmartphone" style=
"overflow: hidden; white-space: nowrap;"> <!-- If you
remove max-width, the jmobile overflow does not work -->
151 <select
name=
"hidedetails" class=
"centpercentonsmartphone"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
159<br><hr><br>Example 1 : Standard
table/thead/tbody/tr/th-td (no
class pair/impair on td) => Use
this if you need the drag and drop
for lines or
for long result tables<br>
162<script
type=
"text/javascript">
181include_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
183$productspecimen->initAsSpecimen();
188$tasksarray = array(1, 2, 3);
189$tagidfortablednd =
'tablelines3';
190if (!isset($moreforfilter)) {
193if (!empty(
$conf->use_javascript_ajax)) {
194 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
198$nav .=
'<form name="dateselect" action="'.$_SERVER[
"PHP_SELF"].
'?mode=show_peruser'.$param.
'">';
199if ($actioncode || GETPOSTISSET(
'actioncode')) {
200 $nav .=
'<input type="hidden" name="actioncode" value="'.$actioncode.
'">';
202if ($status || GETPOSTISSET(
'status')) {
203 $nav .=
'<input type="hidden" name="status" value="'.$status.
'">';
206 $nav .=
'<input type="hidden" name="filter" value="'.$filter.
'">';
209 $nav .=
'<input type="hidden" name="filtert" value="'.$filtert.
'">';
212 $nav .=
'<input type="hidden" name="socid" value="'.$socid.
'">';
214if (isset($showbirthday) && $showbirthday) {
215 $nav .=
'<input type="hidden" name="showbirthday" value="1">';
217if (isset($pid) && $pid) {
218 $nav .=
'<input type="hidden" name="projectid" value="'.$pid.
'">';
221 $nav .=
'<input type="hidden" name="type" value="'.$type.
'">';
224 $nav .=
'<input type="hidden" name="usergroup" value="'.$usergroup.
'">';
226$nav .= $form->selectDate($dateselect ??
'',
'dateselect', 0, 0, 1,
'', 1, 0);
227$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
231print_barre_liste(
'Title of my list', 12, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'Text in middle', 20, 500,
'', 0, $nav,
'', $limit, 0, 0, 1);
233$moreforfilter .=
'<div class="divsearchfield">';
234$moreforfilter .= $langs->trans(
'This is a select list for a filter A (no combo forced)').
': ';
235$cate_arbo = array(
'field1' =>
'value1a into the select list A',
'field2' =>
'value2a');
236$moreforfilter .= $form->selectarray(
'search_aaa', $cate_arbo,
'', 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth300', 0);
237$moreforfilter .=
'</div>';
239$moreforfilter .=
'<div class="divsearchfield">';
240$moreforfilter .= $langs->trans(
'This is a select list for a filter B (auto combo)').
': ';
241$cate_arbo = array(
'field1' =>
'value1b into the select list B',
'field2' =>
'value2b');
242$moreforfilter .= $form->selectarray(
'search_bbb', $cate_arbo,
'', 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth300', -1);
243$moreforfilter .=
'</div>';
245$moreforfilter .=
'<div class="divsearchfield">';
246$moreforfilter .= $langs->trans(
'This is a select list for a filter C (combo forced)').
': ';
247$cate_arbo = array(
'field1' =>
'value1c into the select list C',
'field2' =>
'value2c');
248$moreforfilter .= $form->selectarray(
'search_ccc', $cate_arbo,
'', 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth300', 1);
249$moreforfilter .=
'</div>';
251$moreforfilter .=
'<div class="divsearchfield">';
252$moreforfilter .= $langs->trans(
'This is a select list for a filter D (combo forced)').
': ';
253$cate_arbo = array(
'field1' =>
'value1d into the select list D',
'field2' =>
'value2d');
254$moreforfilter .= $form->selectarray(
'search_ddd', $cate_arbo,
'', 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth300', 1);
255$moreforfilter .=
'</div>';
257if (!empty($moreforfilter)) {
258 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
259 print $moreforfilter;
260 $parameters = array();
261 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
262 print $hookmanager->resPrint;
268<
table class=
"stripe row-border order-column centpercent tagtable liste<?php echo $moreforfilter ? " listwithfilterbefore
" : ""; ?>" id=
"tablelines3">
270<tr
class=
"liste_titre">
271<?php print
getTitleFieldOfList($langs->trans(
'title1'), 0, $_SERVER[
"PHP_SELF"],
'aaa',
'',
'',
'align="left"', $sortfield, $sortorder); ?>
272<?php print
getTitleFieldOfList($langs->trans(
'title2'), 0, $_SERVER[
"PHP_SELF"],
'bbb',
'',
'',
'align="center"', $sortfield, $sortorder); ?>
273<?php print
getTitleFieldOfList($langs->trans(
'title3'), 0, $_SERVER[
"PHP_SELF"],
'ccc',
'',
'',
'align="right"', $sortfield, $sortorder); ?>
277<tr
class=
"pair"><td><?php echo $productspecimen->getNomUrl(1); ?></td><td
class=
"center">b1</td><td
class=
"tdlineupdown right">c1</td></tr>
278<tr
class=
"impair nowrap"><td>a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2</td><td align=
"center">b2</td><td
class=
"tdlineupdown right">c2</td></tr>
279<tr
class=
"pair"><td>a3</td><td
class=
"center">b3</td><td
class=
"tdlineupdown right">c3</td></tr>
288<br><hr><br>Example 1b : Table
using tags:
table/thead/tbody/tr/th-td + dataTable => Use
this for short result tables<br>
290<script
type=
"text/javascript">
291$(document).ready(
function(){
292 $(
'#idtableexample2').dataTable( {
294 if ($optioncss ==
'print') {
295 print
'\'dom\
': \'lfrtip\',';
297 print
'\'dom\
': \'Blfrtip\',';
302 'colvis',
'copy',
'csv',
'excel',
'pdf',
'print'
304 "sPaginationType":
"full_numbers",
305 "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100,
"<?php echo $langs->trans('All'); ?>"]],
307 "sLengthMenu":
"<?php echo $langs->trans('Show'); ?> _MENU_ <?php echo $langs->trans('Entries'); ?>",
308 "sSearch":
"<?php echo $langs->trans('Search'); ?>:",
309 "sZeroRecords":
"<?php echo $langs->trans('NoRecordsToDisplay'); ?>",
310 "sInfoEmpty":
"<?php echo $langs->trans('NoEntriesToShow'); ?>",
311 "sInfoFiltered":
"(<?php echo $langs->trans('FilteredFrom'); ?> _MAX_ <?php echo $langs->trans('TotalEntries'); ?>)",
312 "sInfo":
"<?php echo $langs->trans('Showing'); ?> _START_ <?php echo $langs->trans('To'); ?> _END_ <?php echo $langs->trans('WTOf'); ?> _TOTAL_ <?php echo $langs->trans('Entries'); ?>",
314 "sFirst":
"<?php echo $langs->transnoentities('First'); ?>",
315 "sLast":
"<?php echo $langs->transnoentities('Last'); ?>",
316 "sPrevious":
"<?php echo $langs->transnoentities('Previous'); ?>",
317 "sNext":
"<?php echo $langs->transnoentities('Next'); ?>"
320 "aaSorting": [[0,
'desc']],
336<br><hr><br>Example 2 : Table
using tags: div.tagtable+(div|form).tagtr+div[.tagtd] => Use
this for tables that need to have a different form
for each line, but AVOID IT
if possible (drag and drop of lines does not work
for this case, also height of title can
't be forced to a minimum)<br><br>
340 $tasksarray = array(1, 2, 3); // To force having several lines
341$tagidfortablednd = 'tablelines
';
342if (!empty($conf->use_javascript_ajax)) {
343 include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php
';
346<div class="tagtable centpercent liste_titre_bydiv" id="tablelines">
347 <div class="tagtr liste_titre">
348 <div class="tagtd">Title A<input type="hidden" name="cartitem" value="3"></div>
349 <div class="tagtd">title B</div>
350 <div class="tagtd">title C</div>
351 <div class="tagtd">title D</div>
353 <div class="pair tagtr">
354 <div class="tagtd">line4<input type="hidden" name="cartitem" value="3"></div>
355 <div class="tagtd">dfsdf</div>
356 <div class="tagtd"><input name="count" value="4" class="maxwidth50"></div>
357 <div class="tagtd tdlineupdown">bbbb</div>
359 <div class="impair tagtr">
360 <div class="tagtd">line5<input type="hidden" name="cartitemb" value="3"></div>
361 <div class="tagtd">dfsdf</div>
362 <div class="tagtd"><input name="countb" value="4" class="maxwidth50"></div>
363 <div class="tagtd tdlineupdown">bbbb</div>
365 <div class="pair tagtr">
366 <div class="tagtd">line6<input type="hidden" name="cartitem" value="3"></div>
367 <div class="tagtd">jghjgh</div>
368 <div class="tagtd">5</div>
369 <div class="tagtd tdlineupdown">lll</div>
371<!-- Using form into div make Firefox crazy (page loading does not end) -->
372<!-- <form class="liste_titre" method="POST" action="1.php">
373 <div>line1<input type="hidden" name="cartitem" value="1"></div>
374 <div><label><input type="checkbox" name="hidedetails" value="2"> A checkbox inside a cell</label></div>
375 <div><input name="count" value="4"></div>
376 <div><input type="submit" name="count2" class="button noshadow" value="aaa"></div>
378 <form class="impair" method="POST" action="2.php">
379 <div>line2<input type="hidden" name="cartitem" value="2"></div>
380 <div><select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select></div>
381 <div><input name="countb" value="4"></div>
382 <div class="tdlineupdown"><input type="submit" value="xxx" class="button"></div>
390if (!empty($usedolheader)) {
if(! $sortfield) if(! $sortorder) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage products or services.
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.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.