dolibarr 25.0.0-alpha
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
4 * Copyright (C) 2024-2026 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
26// Load Dolibarr environment
27require '../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
38
39// Load translation files required by the page
40$langs->loadLangs(array('other', 'admin'));
41
42// Get Parameters
43$action = GETPOST('action', 'aZ09');
44$massaction = GETPOST('massaction', 'alpha');
45$show_files = GETPOSTINT('show_files');
46$confirm = GETPOST('confirm', 'alpha');
47$cancel = GETPOST('cancel', 'alpha');
48$toselect = GETPOST('toselect', 'array:int');
49$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
50$backtopage = GETPOST('backtopage', 'alpha');
51$optioncss = GETPOST('optioncss', 'alpha');
52$mode = GETPOST('mode', 'aZ');
53
54$id = GETPOSTINT("id");
55$search_title = GETPOST('search_title', 'alpha');
56
57// Load variable for pagination
58$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
59$sortfield = GETPOST('sortfield', 'aZ09comma');
60$sortorder = GETPOST('sortorder', 'aZ09comma');
61$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
62if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
63 // If $page is not defined, or '' or -1 or if we click on clear filters
64 $page = 0;
65}
66$offset = $limit * $page;
67$pageprev = $page - 1;
68$pagenext = $page + 1;
69if (!$sortfield) {
70 $sortfield = 'b.position';
71}
72if (!$sortorder) {
73 $sortorder = 'ASC';
74}
75
76// Initialize Objects
77$object = new Bookmark($db);
78
79$arrayfields = array();
80// Add hook to complete $arrayfield
81$parameters = array('arrayfields' => &$arrayfields);
82$reshook = $hookmanager->executeHooks('completeArrayFields', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
83$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
84
85if ($id > 0) {
86 $object->fetch($id);
87}
88
89$object->fields = dol_sort_array($object->fields, 'position');
90$arrayfields = dol_sort_array($arrayfields, 'position');
91
92// Security check
93restrictedArea($user, 'bookmark', $object);
94
95// Permissions
96$permissiontoread = $user->hasRight('bookmark', 'lire');
97$permissiontoadd = $user->hasRight('bookmark', 'creer');
98$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id));
99
100
101/*
102 * Actions
103 */
104
105if (GETPOST('cancel', 'alpha')) {
106 $action = 'list';
107 $massaction = '';
108}
109if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
110 $massaction = '';
111}
112
113$parameters = array();
114$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
115if ($reshook < 0) {
116 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
117}
118
119if (empty($reshook)) {
120 // Selection of new fields
121 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
122
123 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
124 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
125 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
126 }
127
128 // Without the permission to delete all bookmarks, a user can only delete his own bookmarks: the mass action must
129 // not delete other records than these, whatever the list of ids received.
130 if (!$user->hasRight('bookmark', 'supprimer') && is_array($toselect) && count($toselect) > 0) {
131 $ownbookmarks = array();
132 $sqlown = "SELECT rowid FROM ".MAIN_DB_PREFIX."bookmark";
133 $sqlown .= " WHERE rowid IN (".$db->sanitize(implode(',', array_map('intval', $toselect))).")";
134 $sqlown .= " AND fk_user = ".((int) $user->id);
135 $sqlown .= " AND entity IN (".getEntity('bookmark').")";
136 $resqlown = $db->query($sqlown);
137 if ($resqlown) {
138 while ($objown = $db->fetch_object($resqlown)) {
139 $ownbookmarks[] = (int) $objown->rowid;
140 }
141 }
142 $toselect = $ownbookmarks;
143 }
144
145 // Mass actions
146 $objectclass = 'Bookmark';
147 $objectlabel = 'Bookmark';
148 $uploaddir = $conf->bookmark->dir_output;
149 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
150
151 if ($action == 'delete' && $permissiontodelete) {
152 $object->fetch($id);
153 $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
154 $res = $object->delete($user);
155 if ($res > 0) {
156 header("Location: ".$_SERVER["PHP_SELF"]);
157 exit;
158 } else {
159 setEventMessages($object->error, $object->errors, 'errors');
160 $action = '';
161 }
162 }
163}
164
165
166/*
167 * View
168 */
169
170$form = new Form($db);
171
172$now = dol_now();
173
174//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
175$help_url = '';
176$title = $langs->trans("Bookmarks");
177$morejs = array();
178$morecss = array();
179
180
181// Build and execute select
182// --------------------------------------------------------------------
183$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
184$sql .= " u.login, u.lastname, u.firstname";
185// Add fields from extrafields
186if (!empty($extrafields->attributes[$object->table_element]['label'])) {
187 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
188 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
189 }
190}
191// Add fields from hooks
192$parameters = array();
193$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
194$sql .= $hookmanager->resPrint;
195$sql = preg_replace('/,\s*$/', '', $sql);
196
197$sqlfields = $sql; // $sql fields to remove for count total
198
199$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
200$sql .= " WHERE 1=1";
201if ($search_title) {
202 $sql .= natural_search('title', $search_title);
203}
204$sql .= " AND b.entity IN (".getEntity('bookmark').")";
205if (!$user->admin) {
206 $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
207}
208
209// Count total nb of records
210$nbtotalofrecords = '';
211if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
212 /* The fast and low memory method to get and count full list converts the sql into a sql count */
213 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
214 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
215 $resql = $db->query($sqlforcount);
216 if ($resql) {
217 $objforcount = $db->fetch_object($resql);
218 $nbtotalofrecords = $objforcount->nbtotalofrecords;
219 } else {
220 dol_print_error($db);
221 }
222
223 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
224 $page = 0;
225 $offset = 0;
226 }
227 $db->free($resql);
228}
229
230// Complete request and execute it with limit
231$sql .= $db->order($sortfield.", position", $sortorder);
232if ($limit) {
233 $sql .= $db->plimit($limit + 1, $offset);
234}
235
236$resql = $db->query($sql);
237if (!$resql) {
238 dol_print_error($db);
239 exit;
240}
241
242$num = $db->num_rows($resql);
243
244
245// Output page
246// --------------------------------------------------------------------
247
248llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist mod-bookmarks page-list');
249
250$arrayofselected = is_array($toselect) ? $toselect : array();
251
252$param = '';
253if (!empty($mode)) {
254 $param .= '&mode='.urlencode($mode);
255}
256if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
257 $param .= '&contextpage='.urlencode($contextpage);
258}
259if ($limit > 0 && $limit != $conf->liste_limit) {
260 $param .= '&limit='.((int) $limit);
261}
262if ($optioncss != '') {
263 $param .= '&optioncss='.urlencode($optioncss);
264}
265// Add $param from extra fields
266include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
267// Add $param from hooks
268$parameters = array('param' => &$param);
269$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
270$param .= $hookmanager->resPrint;
271
272// List of mass actions available
273$arrayofmassactions = array(
274 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
275 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
276 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
277 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
278);
279if (!empty($permissiontodelete)) {
280 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
281}
282if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
283 $arrayofmassactions = array();
284}
285$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
286
287print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
288if ($optioncss != '') {
289 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
290}
291print '<input type="hidden" name="token" value="'.newToken().'">';
292print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
293print '<input type="hidden" name="action" value="list">';
294print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
295print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
296print '<input type="hidden" name="page" value="'.$page.'">';
297print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
298print '<input type="hidden" name="page_y" value="">';
299print '<input type="hidden" name="mode" value="'.$mode.'">';
300
301
302$newcardbutton = '';
303$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', $permissiontoadd);
304
305print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
306
307// Add code for pre mass action (confirmation or email presend form)
308$topicmail = "SendBookmarkRef";
309$modelmail = "bookmark";
310$objecttmp = new Bookmark($db);
311$trackid = 'bookmark'.$object->id;
312include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
313
314$moreforfilter = '';
315
316$parameters = array();
317$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
318if (empty($reshook)) {
319 $moreforfilter .= $hookmanager->resPrint;
320} else {
321 $moreforfilter = $hookmanager->resPrint;
322}
323
324if (!empty($moreforfilter)) {
325 print '<div class="liste_titre liste_titre_bydiv centpercent">';
326 print $moreforfilter;
327 print '</div>';
328}
329
330$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
331$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields
332$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
333
334print '<div class="div-table-responsive">';
335print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
336
337// Fields title search
338// --------------------------------------------------------------------
339// TODO
340
341$totalarray = array();
342$totalarray['nbfield'] = 0;
343
344// Fields title label
345// --------------------------------------------------------------------
346print '<tr class="liste_titre">';
347if ($conf->main_checkbox_left_column) {
348 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
349 $totalarray['nbfield']++;
350}
351print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
352$totalarray['nbfield']++;
353print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
354$totalarray['nbfield']++;
355print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
356$totalarray['nbfield']++;
357print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
358$totalarray['nbfield']++;
359print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
360$totalarray['nbfield']++;
361print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
362$totalarray['nbfield']++;
363print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
364$totalarray['nbfield']++;
365if (!$conf->main_checkbox_left_column) {
366 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
367 $totalarray['nbfield']++;
368}
369print '</tr>'."\n";
370
371// Loop on record
372// --------------------------------------------------------------------
373$i = 0;
374$savnbfield = $totalarray['nbfield'];
375$totalarray = array();
376$totalarray['nbfield'] = 0;
377$imaxinloop = ($limit ? min($num, $limit) : $num);
378while ($i < $imaxinloop) {
379 $obj = $db->fetch_object($resql);
380 if (empty($obj)) {
381 break; // Should not happen
382 }
383
384 $object->id = $obj->rowid;
385 $object->ref = $obj->rowid;
386
387 if ($mode == 'kanban') {
388 if ($i == 0) {
389 print '<tr><td colspan="'.$savnbfield.'">';
390 print '<div class="box-flex-container">';
391 }
392 // Output Kanban
393 $selected = -1;
394 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
395 $selected = 0;
396 if (in_array($object->id, $arrayofselected)) {
397 $selected = 1;
398 }
399 }
400 print $object->getKanbanView('', array('selected' => $selected));
401 if ($i == ($imaxinloop - 1)) {
402 print '</div>';
403 print '</td></tr>';
404 }
405 } else {
406 // Show here line of result
407 $j = 0;
408 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
409 // Action column
410 if ($conf->main_checkbox_left_column) {
411 print '<td class="nowrap center">';
412 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
413 $selected = 0;
414 if (in_array($object->id, $arrayofselected)) {
415 $selected = 1;
416 }
417 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
418 }
419 print '</td>';
420 if (!$i) {
421 $totalarray['nbfield']++;
422 }
423 }
424
425 // Id
426 print '<td class="nowraponall">';
427 print $object->getNomUrl(1);
428 print '</td>';
429
430 $linkintern = 1;
431 if (preg_match('/^http/i', $obj->url)) {
432 $linkintern = 0;
433 }
434 $title = $obj->title;
435 $link = $obj->url;
436 $canedit = $permissiontoadd;
437 $candelete = $permissiontodelete;
438
439 // Title
440 print '<td class="tdoverflowmax250" alt="'.dol_escape_htmltag($title).'">';
441 print dol_escape_htmltag($title);
442 print "</td>\n";
443
444 // Url
445 print '<td class="tdoverflowmax250">';
446 if (empty($linkintern)) {
447 print img_picto('', 'url', 'class="pictofixedwidth"');
448 print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
449 } else {
450 print '<a class="" href="'.$obj->url.'">';
451 }
452 print $link;
453 print '</a>';
454 print "</td>\n";
455
456 // Target
457 print '<td class="tdoverflowmax125 center">';
458 if ($obj->target == 0) {
459 print $langs->trans("BookmarkTargetReplaceWindowShort");
460 }
461 if ($obj->target == 1) {
462 print $langs->trans("BookmarkTargetNewWindowShort");
463 }
464 print "</td>\n";
465
466 // Author
467 print '<td class="tdoverflowmax125 center">';
468 if ($obj->fk_user > 0) {
469 if (empty($conf->cache['users'][$obj->fk_user])) {
470 $tmpuser = new User($db);
471 $tmpuser->fetch($obj->fk_user);
472 $conf->cache['users'][$obj->fk_user] = $tmpuser;
473 }
474 $tmpuser = $conf->cache['users'][$obj->fk_user];
475 print $tmpuser->getNomUrl(-1);
476 } else {
477 print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
478 if (!$user->admin) {
479 $candelete = false;
480 $canedit = false;
481 }
482 }
483 print "</td>\n";
484
485 // Date creation
486 print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
487
488 // Position
489 print '<td class="right">'.$obj->position."</td>";
490
491 // Action column
492 if (!$conf->main_checkbox_left_column) {
493 print '<td class="nowrap center">';
494 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
495 $selected = 0;
496 if (in_array($object->id, $arrayofselected)) {
497 $selected = 1;
498 }
499 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
500 }
501 print '</td>';
502 if (!$i) {
503 $totalarray['nbfield']++;
504 }
505 }
506
507 print "</tr>\n";
508 }
509
510 $i++;
511}
512
513// Show total line
514include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
515
516// If no record found
517if ($num == 0) {
518 $colspan = 1;
519 foreach ($arrayfields as $key => $val) {
520 if (!empty($val['checked'])) {
521 $colspan++;
522 }
523 }
524 print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
525}
526
527$db->free($resql);
528
529$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
530$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
531print $hookmanager->resPrint;
532
533print '</table>'."\n";
534print '</div>'."\n";
535
536print '</form>'."\n";
537
538
539// End of page
540llxFooter();
541$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage bookmarks.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
dol_now($mode='gmt')
Return date for now.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:183
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.