dolibarr 20.0.0
knowledgerecord_list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2023 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
4 * Copyright (C) 2023 Anthony Berton <anthony.berton@bb2a.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';
28require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
29require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
34require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
35
36// Load translation files required by the page
37$langs->loadLangs(array("knowledgemanagement", "other"));
38
39$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
40$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
41$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
42$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
43$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
44$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
45$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'knowledgerecordlist'; // To manage different context of search
46$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
47$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
48$mode = GETPOST('mode', 'aZ09');
49
50$id = GETPOSTINT('id');
51
52$searchCategoryKnowledgemanagementList = GETPOST('search_category_knowledgemanagement_list', 'array');
53$searchCategoryKnowledgemanagementOperator = 0;
54if (GETPOSTISSET('formfilteraction')) {
55 $searchCategoryKnowledgemanagementOperator = GETPOSTINT('search_category_knowledgemanagement_operator');
56} elseif (getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT')) {
57 $searchCategoryKnowledgemanagementOperator = getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT');
58}
59// Load variable for pagination
60$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
61$sortfield = GETPOST('sortfield', 'aZ09comma');
62$sortorder = GETPOST('sortorder', 'aZ09comma');
63$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
64if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
65 // If $page is not defined, or '' or -1 or if we click on clear filters
66 $page = 0;
67}
68$offset = $limit * $page;
69$pageprev = $page - 1;
70$pagenext = $page + 1;
71
72// Initialize technical objects
73$object = new KnowledgeRecord($db);
74$extrafields = new ExtraFields($db);
75$diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id;
76$hookmanager->initHooks(array('knowledgerecordlist')); // Note that conf->hooks_modules contains array
77
78// Fetch optionals attributes and labels
79$extrafields->fetch_name_optionals_label($object->table_element);
80//$extrafields->fetch_name_optionals_label($object->table_element_line);
81
82$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
83
84// Default sort order (if not yet defined by previous GETPOST)
85if (!$sortfield) {
86 reset($object->fields); // Reset is required to avoid key() to return null.
87 $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
88}
89if (!$sortorder) {
90 $sortorder = "ASC";
91}
92
93// Initialize array of search criteria
94$search_all = GETPOST('search_all', 'alphanohtml');
95$search = array();
96foreach ($object->fields as $key => $val) {
97 if ($key == "lang") {
98 $search[$key] = GETPOST('search_'.$key, 'alpha') != '0' ? GETPOST('search_'.$key, 'alpha') : '';
99 } else {
100 $search[$key] = GETPOST('search_'.$key, 'alpha');
101 }
102
103 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
104 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
105 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
106 }
107}
108
109// List of fields to search into when doing a "search in all"
110$fieldstosearchall = array();
111foreach ($object->fields as $key => $val) {
112 if (!empty($val['searchall'])) {
113 $fieldstosearchall['t.'.$key] = $val['label'];
114 }
115}
116
117// Definition of array of fields for columns
118$arrayfields = array();
119foreach ($object->fields as $key => $val) {
120 // If $val['visible']==0, then we never show the field
121 if (!empty($val['visible'])) {
122 $visible = (int) dol_eval($val['visible'], 1);
123 $arrayfields['t.'.$key] = array(
124 'label'=>$val['label'],
125 'checked'=>(($visible < 0) ? 0 : 1),
126 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
127 'position'=>$val['position'],
128 'help'=> isset($val['help']) ? $val['help'] : ''
129 );
130 }
131}
132// Extra fields
133include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
134
135$object->fields = dol_sort_array($object->fields, 'position');
136$arrayfields = dol_sort_array($arrayfields, 'position');
137
138$permissiontoread = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read');
139$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
140$permissiontodelete = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete');
141
142// Security check
143if (empty($conf->knowledgemanagement->enabled)) {
144 accessforbidden('Module not enabled');
145}
146$socid = 0;
147if ($user->socid > 0) { // Protection if external user
148 //$socid = $user->socid;
150}
151$result = restrictedArea($user, 'knowledgemanagement', 0, '', 'knowledgerecord');
152//if (!$permissiontoread) accessforbidden();
153
154
155
156/*
157 * Actions
158 */
159
160if (GETPOST('cancel', 'alpha')) {
161 $action = 'list';
162 $massaction = '';
163}
164if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
165 $massaction = '';
166}
167
168$parameters = array();
169$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
170if ($reshook < 0) {
171 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
172}
173
174if (empty($reshook)) {
175 // Selection of new fields
176 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
177
178 // Purge search criteria
179 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
180 foreach ($object->fields as $key => $val) {
181 $search[$key] = '';
182 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
183 $search[$key.'_dtstart'] = '';
184 $search[$key.'_dtend'] = '';
185 }
186 }
187 $toselect = array();
188 $search_array_options = array();
189 }
190 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
191 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
192 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
193 }
194 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
195 $searchCategoryKnowledgemanagementOperator = 0;
196 $searchCategoryKnowledgemanagementList = array();
197 }
198
199 // Mass actions
200 $objectclass = 'KnowledgeRecord';
201 $objectlabel = 'KnowledgeRecord';
202 $uploaddir = $conf->knowledgemanagement->dir_output;
203 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
204}
205
206
207
208/*
209 * View
210 */
211
212$form = new Form($db);
213$user_temp = new User($db);
214$formadmin = new FormAdmin($db);
215
216$now = dol_now();
217
218//$help_url="EN:Module_KnowledgeRecord|FR:Module_KnowledgeRecord_FR|ES:Módulo_KnowledgeRecord";
219$help_url = '';
220$title = $langs->trans('KnowledgeRecords');
221$morejs = array();
222$morecss = array();
223
224
225// Build and execute select
226// --------------------------------------------------------------------
227$sql = 'SELECT ';
228$sql .= $object->getFieldList('t');
229// Add fields from extrafields
230if (!empty($extrafields->attributes[$object->table_element]['label'])) {
231 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
232 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
233 }
234}
235// Add fields from hooks
236$parameters = array();
237$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
238$sql .= $hookmanager->resPrint;
239$sql = preg_replace('/,\s*$/', '', $sql);
240
241$sqlfields = $sql; // $sql fields to remove for count total
242
243$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
244if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
245 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
246}
247// Add table from hooks
248$parameters = array();
249$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
250$sql .= $hookmanager->resPrint;
251if ($object->ismultientitymanaged == 1) {
252 $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
253} else {
254 $sql .= " WHERE 1 = 1";
255}
256foreach ($search as $key => $val) {
257 if (array_key_exists($key, $object->fields)) {
258 if ($key == 'status' && $search[$key] == -1) {
259 continue;
260 }
261 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
262 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
263 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
264 $search[$key] = '';
265 }
266 $mode_search = 2;
267 }
268 if ($search[$key] != '') {
269 $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
270 }
271 } else {
272 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
273 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
274 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
275 if (preg_match('/_dtstart$/', $key)) {
276 $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
277 }
278 if (preg_match('/_dtend$/', $key)) {
279 $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
280 }
281 }
282 }
283 }
284}
285
286// Search for tag/category ($searchCategoryKnowledgemanagementList is an array of ID)
287if (!empty($searchCategoryKnowledgemanagementList)) {
288 $searchCategoryKnowledgemanagementSqlList = array();
289 $listofcategoryid = '';
290 foreach ($searchCategoryKnowledgemanagementList as $searchCategoryKnowledgemanagement) {
291 if (intval($searchCategoryKnowledgemanagement) == -2) {
292 $searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)";
293 } elseif (intval($searchCategoryKnowledgemanagement) > 0) {
294 if (empty($searchCategoryKnowledgemanagementOperator)) {
295 $searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie = ".((int) $searchCategoryKnowledgemanagement).")";
296 } else {
297 $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement);
298 }
299 }
300 }
301 if ($listofcategoryid) {
302 $searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
303 }
304 if ($searchCategoryKnowledgemanagementOperator == 1) {
305 if (!empty($searchCategoryKnowledgemanagementSqlList)) {
306 $sql .= " AND (".implode(' OR ', $searchCategoryKnowledgemanagementSqlList).")";
307 }
308 } else {
309 if (!empty($searchCategoryKnowledgemanagementSqlList)) {
310 $sql .= " AND (".implode(' AND ', $searchCategoryKnowledgemanagementSqlList).")";
311 }
312 }
313}
314
315if ($search_all) {
316 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
317}
318//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
319// Add where from extra fields
320include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
321// Add where from hooks
322$parameters = array();
323$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
324$sql .= $hookmanager->resPrint;
325
326/* If a group by is required
327$sql.= " GROUP BY ";
328foreach($object->fields as $key => $val) {
329 $sql .= "t.".$key.", ";
330}
331// Add fields from extrafields
332if (!empty($extrafields->attributes[$object->table_element]['label'])) {
333 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
334}
335// Add where from hooks
336$parameters=array();
337$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters, $object); // Note that $action and $object may have been modified by hook
338$sql.=$hookmanager->resPrint;
339$sql=preg_replace('/,\s*$/','', $sql);
340*/
341
342// Count total nb of records
343$nbtotalofrecords = '';
344if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
345 /* The fast and low memory method to get and count full list converts the sql into a sql count */
346 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
347 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
348 $resql = $db->query($sqlforcount);
349 if ($resql) {
350 $objforcount = $db->fetch_object($resql);
351 $nbtotalofrecords = $objforcount->nbtotalofrecords;
352 } else {
353 dol_print_error($db);
354 }
355
356 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
357 $page = 0;
358 $offset = 0;
359 }
360 $db->free($resql);
361}
362
363// Complete request and execute it with limit
364$sql .= $db->order($sortfield, $sortorder);
365if ($limit) {
366 $sql .= $db->plimit($limit + 1, $offset);
367}
368
369$resql = $db->query($sql);
370if (!$resql) {
371 dol_print_error($db);
372 exit;
373}
374
375$num = $db->num_rows($resql);
376
377
378// Direct jump if only one record found
379if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
380 $obj = $db->fetch_object($resql);
381 $id = $obj->rowid;
382 header("Location: ".dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.$id);
383 exit;
384}
385
386
387// Output page
388// --------------------------------------------------------------------
389
390llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-knowledgemanagement page-list bodyforlist');
391
392
393$arrayofselected = is_array($toselect) ? $toselect : array();
394
395$param = '';
396if (!empty($mode)) {
397 $param .= '&mode='.urlencode($mode);
398}
399if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
400 $param .= '&contextpage='.urlencode($contextpage);
401}
402if ($limit > 0 && $limit != $conf->liste_limit) {
403 $param .= '&limit='.((int) $limit);
404}
405foreach ($search as $key => $val) {
406 if (is_array($search[$key])) {
407 foreach ($search[$key] as $skey) {
408 if ($skey != '') {
409 $param .= '&search_'.$key.'[]='.urlencode($skey);
410 }
411 }
412 } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
413 $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
414 $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
415 $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
416 } elseif ($search[$key] != '') {
417 $param .= '&search_'.$key.'='.urlencode($search[$key]);
418 }
419}
420if ($optioncss != '') {
421 $param .= '&optioncss='.urlencode($optioncss);
422}
423// Add $param from extra fields
424include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
425// Add $param from hooks
426$parameters = array('param' => &$param);
427$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
428$param .= $hookmanager->resPrint;
429
430// List of mass actions available
431$arrayofmassactions = array(
432 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
433 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
434 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
435 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
436);
437if (isModEnabled('category') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
438 $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
439}
440if (!empty($permissiontodelete)) {
441 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
442}
443if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
444 $arrayofmassactions = array();
445}
446$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
447
448print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
449if ($optioncss != '') {
450 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
451}
452print '<input type="hidden" name="token" value="'.newToken().'">';
453print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
454print '<input type="hidden" name="action" value="list">';
455print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
456print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
457print '<input type="hidden" name="page" value="'.$page.'">';
458print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
459print '<input type="hidden" name="page_y" value="">';
460print '<input type="hidden" name="mode" value="'.$mode.'">';
461
462$newcardbutton = '';
463$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
464$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
465$newcardbutton .= dolGetButtonTitleSeparator();
466$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
467
468print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
469
470// Add code for pre mass action (confirmation or email presend form)
471$topicmail = "SendKnowledgeRecordRef";
472$modelmail = "knowledgerecord";
473$objecttmp = new KnowledgeRecord($db);
474$trackid = 'xxxx'.$object->id;
475include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
476
477if ($search_all) {
478 $setupstring = '';
479 foreach ($fieldstosearchall as $key => $val) {
480 $fieldstosearchall[$key] = $langs->trans($val);
481 $setupstring .= $key."=".$val.";";
482 }
483 print '<!-- Search done like if KNOWLEDGEMANAGEMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
484 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
485}
486
487$moreforfilter = '';
488/*$moreforfilter.='<div class="divsearchfield">';
489$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
490$moreforfilter.= '</div>';*/
491
492// Filter on categories
493$moreforfilter = '';
494if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
495 $formcategory = new FormCategory($db);
496 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_KNOWLEDGEMANAGEMENT, $searchCategoryKnowledgemanagementList, 'minwidth300', $searchCategoryKnowledgemanagementList ? $searchCategoryKnowledgemanagementList : 0);
497 /*
498 $moreforfilter .= '<div class="divsearchfield">';
499 $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
500 $categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 3);
501 $categoriesKnowledgeArr[-2] = '- '.$langs->trans('NotCategorized').' -';
502 $moreforfilter .= Form::multiselectarray('search_category_knowledgemanagement_list', $categoriesKnowledgeArr, $searchCategoryKnowledgemanagementList, 0, 0, 'minwidth300');
503 $moreforfilter .= ' <input type="checkbox" class="valignmiddle" id="search_category_knowledgemanagement_operator" name="search_category_knowledgemanagement_operator" value="1"'.($searchCategoryKnowledgemanagementOperator == 1 ? ' checked="checked"' : '').'/><label class="none valignmiddle" for="search_category_knowledgemanagement_operator">'.$langs->trans('UseOrOperatorForCategories').'</label>';
504 $moreforfilter .= '</div>';
505 */
506}
507
508$parameters = array();
509$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
510if (empty($reshook)) {
511 $moreforfilter .= $hookmanager->resPrint;
512} else {
513 $moreforfilter = $hookmanager->resPrint;
514}
515
516if (!empty($moreforfilter)) {
517 print '<div class="liste_titre liste_titre_bydiv centpercent">';
518 print $moreforfilter;
519 $parameters = array();
520 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
521 print $hookmanager->resPrint;
522 print '</div>';
523}
524
525$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
526$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
527$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
528
529print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
530print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
531
532
533// Fields title search
534// --------------------------------------------------------------------
535print '<tr class="liste_titre_filter">';
536// Action column
537if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
538 print '<td class="liste_titre maxwidthsearch center">';
539 $searchpicto = $form->showFilterButtons('left');
540 print $searchpicto;
541 print '</td>';
542}
543foreach ($object->fields as $key => $val) {
544 $searchkey = empty($search[$key]) ? '' : $search[$key];
545 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
546 if ($key == 'status') {
547 $cssforfield .= ($cssforfield ? ' ' : '').'center';
548 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
549 $cssforfield .= ($cssforfield ? ' ' : '').'center';
550 } elseif (in_array($val['type'], array('timestamp'))) {
551 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
552 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
553 $cssforfield .= ($cssforfield ? ' ' : '').'right';
554 }
555 if (!empty($arrayfields['t.'.$key]['checked'])) {
556 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
557 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
558 print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
559 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
560 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
561 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
562 print '<div class="nowrap">';
563 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
564 print '</div>';
565 print '<div class="nowrap">';
566 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
567 print '</div>';
568 } elseif ($key == 'lang') {
569 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
570 $formadmin = new FormAdmin($db);
571 print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
572 } else {
573 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
574 }
575 print '</td>';
576 }
577}
578// Extra fields
579include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
580
581// Fields from hook
582$parameters = array('arrayfields'=>$arrayfields);
583$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
584print $hookmanager->resPrint;
585// Action column
586if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
587 print '<td class="liste_titre center maxwidthsearch">';
588 $searchpicto = $form->showFilterButtons();
589 print $searchpicto;
590 print '</td>';
591}
592print '</tr>'."\n";
593
594$totalarray = array();
595$totalarray['nbfield'] = 0;
596
597// Fields title label
598// --------------------------------------------------------------------
599print '<tr class="liste_titre">';
600if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
601 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
602 $totalarray['nbfield']++;
603}
604foreach ($object->fields as $key => $val) {
605 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
606 if ($key == 'status') {
607 $cssforfield .= ($cssforfield ? ' ' : '').'center';
608 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
609 $cssforfield .= ($cssforfield ? ' ' : '').'center';
610 } elseif (in_array($val['type'], array('timestamp'))) {
611 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
612 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
613 $cssforfield .= ($cssforfield ? ' ' : '').'right';
614 }
615 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
616 if (!empty($arrayfields['t.'.$key]['checked'])) {
617 print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
618 $totalarray['nbfield']++;
619 }
620}
621// Extra fields
622include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
623// Hook fields
624$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
625$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
626print $hookmanager->resPrint;
627// Action column
628if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
629 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
630 $totalarray['nbfield']++;
631}
632print '</tr>'."\n";
633
634// Detect if we need a fetch on each output line
635$needToFetchEachLine = 0;
636if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
637 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
638 if (!is_null($val) && preg_match('/\$object/', $val)) {
639 $needToFetchEachLine++; // There is at least one compute field that use $object
640 }
641 }
642}
643
644
645// Loop on record
646// --------------------------------------------------------------------
647$i = 0;
648$savnbfield = $totalarray['nbfield'];
649$totalarray = array();
650$totalarray['nbfield'] = 0;
651$imaxinloop = ($limit ? min($num, $limit) : $num);
652while ($i < $imaxinloop) {
653 $obj = $db->fetch_object($resql);
654 if (empty($obj)) {
655 break; // Should not happen
656 }
657
658 // Store properties in $object
659 $object->setVarsFromFetchObj($obj);
660
661 if ($mode == 'kanban') {
662 if ($i == 0) {
663 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
664 print '<div class="box-flex-container kanban">';
665 }
666 // Output Kanban
667 $selected = -1;
668 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
669 $selected = 0;
670 if (in_array($object->id, $arrayofselected)) {
671 $selected = 1;
672 }
673 }
674 print $object->getKanbanView('', array('selected' => $selected));
675 if ($i == ($imaxinloop - 1)) {
676 print '</div>';
677 print '</td></tr>';
678 }
679 } else {
680 // Show here line of result
681 $j = 0;
682 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
683 // Action column
684 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
685 print '<td class="nowrap center">';
686 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
687 $selected = 0;
688 if (in_array($object->id, $arrayofselected)) {
689 $selected = 1;
690 }
691 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
692 }
693 print '</td>';
694 if (!$i) {
695 $totalarray['nbfield']++;
696 }
697 }
698 foreach ($object->fields as $key => $val) {
699 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
700 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
701 $cssforfield .= ($cssforfield ? ' ' : '').'center';
702 } elseif ($key == 'status') {
703 $cssforfield .= ($cssforfield ? ' ' : '').'center';
704 }
705
706 if (in_array($val['type'], array('timestamp'))) {
707 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
708 } elseif ($key == 'ref') {
709 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
710 }
711
712 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
713 $cssforfield .= ($cssforfield ? ' ' : '').'right';
714 }
715 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
716 if (!empty($arrayfields['t.'.$key]['checked'])) {
717 print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
718 if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
719 print ' title="'.dol_escape_htmltag(dol_nl2br($object->$key, 1)).'"'; // We add dol_nl2br for the question and answer fields
720 }
721 print '>';
722 if ($key == 'status') {
723 print $object->getLibStatut(5);
724 } elseif ($key == 'rowid') {
725 print $object->showOutputField($val, $key, $object->id, '');
726 } elseif ($key == 'fk_user_creat') {
727 if ($object->fk_user_creat > 0) {
728 if (isset($conf->cache['user'][$object->fk_user_creat])) {
729 $user_temp = $conf->cache['user'][$object->fk_user_creat];
730 } else {
731 $user_temp = new User($db);
732 $user_temp->fetch($object->fk_user_creat);
733 $conf->cache['user'][$object->fk_user_creat] = $user_temp;
734 }
735 print $user_temp->getNomUrl(-1);
736 }
737 } elseif ($key == 'fk_user_modif') {
738 if ($object->fk_user_modif > 0) {
739 if (isset($conf->cache['user'][$object->fk_user_modif])) {
740 $user_temp = $conf->cache['user'][$object->fk_user_modif];
741 } else {
742 $user_temp = new User($db);
743 $user_temp->fetch($object->fk_user_modif);
744 $conf->cache['user'][$object->fk_user_modif] = $user_temp;
745 }
746 print $user_temp->getNomUrl(-1);
747 }
748 } elseif ($key == 'fk_user_valid') {
749 if ($object->fk_user_valid > 0) {
750 if (isset($conf->cache['user'][$object->fk_user_valid])) {
751 $user_temp = $conf->cache['user'][$object->fk_user_valid];
752 } else {
753 $user_temp = new User($db);
754 $user_temp->fetch($object->fk_user_valid);
755 $conf->cache['user'][$object->fk_user_valid] = $user_temp;
756 }
757 print $user_temp->getNomUrl(-1);
758 }
759 } elseif ($key == 'lang') {
760 $labellang = ($object->lang ? $langs->trans('Language_'.$object->lang) : '');
761 print picto_from_langcode($object->lang, 'class="paddingrightonly saturatemedium opacitylow"');
762 print $labellang;
763 } elseif ($key == 'question') {
764 print dolGetFirstLineOfText($object->$key);
765 } else {
766 print $object->showOutputField($val, $key, $object->$key, '');
767 }
768 print '</td>';
769 if (!$i) {
770 $totalarray['nbfield']++;
771 }
772 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
773 if (!$i) {
774 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
775 }
776 if (!isset($totalarray['val'])) {
777 $totalarray['val'] = array();
778 }
779 if (!isset($totalarray['val']['t.'.$key])) {
780 $totalarray['val']['t.'.$key] = 0;
781 }
782 $totalarray['val']['t.'.$key] += $object->$key;
783 }
784 }
785 }
786 // Extra fields
787 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
788 // Fields from hook
789 $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
790 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
791 print $hookmanager->resPrint;
792 // Action column
793 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
794 print '<td class="nowrap center">';
795 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
796 $selected = 0;
797 if (in_array($object->id, $arrayofselected)) {
798 $selected = 1;
799 }
800 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
801 }
802 print '</td>';
803 if (!$i) {
804 $totalarray['nbfield']++;
805 }
806 }
807
808 print '</tr>'."\n";
809 }
810 $i++;
811}
812
813// Show total line
814include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
815
816// If no record found
817if ($num == 0) {
818 $colspan = 1;
819 foreach ($arrayfields as $key => $val) {
820 if (!empty($val['checked'])) {
821 $colspan++;
822 }
823 }
824 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
825}
826
827
828$db->free($resql);
829
830$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
831$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
832print $hookmanager->resPrint;
833
834print '</table>'."\n";
835print '</div>'."\n";
836
837print '</form>'."\n";
838
839if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
840 $hidegeneratedfilelistifempty = 1;
841 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
842 $hidegeneratedfilelistifempty = 0;
843 }
844
845 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
846 $formfile = new FormFile($db);
847
848 // Show list of available documents
849 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
850 $urlsource .= str_replace('&amp;', '&', $param);
851
852 $filedir = $diroutputmassaction;
853 $genallowed = $permissiontoread;
854 $delallowed = $permissiontoadd;
855
856 print $formfile->showdocuments('massfilesarea_knowledgemanagement', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
857}
858
859// End of page
860llxFooter();
861$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage standard extra fields.
Class to generate html code for admin pages.
Class to manage forms for categories.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class for KnowledgeRecord.
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
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...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.