dolibarr 21.0.0-alpha
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-2024 Frédéric France <frederic.france@free.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 a 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((string) $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$permissiontovalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $permissiontoadd) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('knowledgemanagement', 'knowledgerecord_advance', 'validate')));
142
143
144// Security check
145if (empty($conf->knowledgemanagement->enabled)) {
146 accessforbidden('Module not enabled');
147}
148$socid = 0;
149if ($user->socid > 0) { // Protection if external user
150 //$socid = $user->socid;
152}
153$result = restrictedArea($user, 'knowledgemanagement', 0, '', 'knowledgerecord');
154//if (!$permissiontoread) accessforbidden();
155
156
157
158/*
159 * Actions
160 */
161
162if (GETPOST('cancel', 'alpha')) {
163 $action = 'list';
164 $massaction = '';
165}
166if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
167 $massaction = '';
168}
169
170$parameters = array();
171$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
172if ($reshook < 0) {
173 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
174}
175
176if (empty($reshook)) {
177 // Selection of new fields
178 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
179
180 // Purge search criteria
181 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
182 foreach ($object->fields as $key => $val) {
183 $search[$key] = '';
184 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
185 $search[$key.'_dtstart'] = '';
186 $search[$key.'_dtend'] = '';
187 }
188 }
189 $toselect = array();
190 $search_array_options = array();
191 }
192 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
193 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
194 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
195 }
196 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
197 $searchCategoryKnowledgemanagementOperator = 0;
198 $searchCategoryKnowledgemanagementList = array();
199 }
200
201 // Mass actions
202 $objectclass = 'KnowledgeRecord';
203 $objectlabel = 'KnowledgeRecord';
204 $uploaddir = $conf->knowledgemanagement->dir_output;
205 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
206}
207
208
209
210/*
211 * View
212 */
213
214$form = new Form($db);
215$user_temp = new User($db);
216$formadmin = new FormAdmin($db);
217
218$now = dol_now();
219
220//$help_url="EN:Module_KnowledgeRecord|FR:Module_KnowledgeRecord_FR|ES:Módulo_KnowledgeRecord";
221$help_url = '';
222$title = $langs->trans('KnowledgeRecords');
223$morejs = array();
224$morecss = array();
225
226
227// Build and execute select
228// --------------------------------------------------------------------
229$sql = 'SELECT ';
230$sql .= $object->getFieldList('t');
231// Add fields from extrafields
232if (!empty($extrafields->attributes[$object->table_element]['label'])) {
233 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
234 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
235 }
236}
237// Add fields from hooks
238$parameters = array();
239$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
240$sql .= $hookmanager->resPrint;
241$sql = preg_replace('/,\s*$/', '', $sql);
242
243$sqlfields = $sql; // $sql fields to remove for count total
244
245$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
246if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
247 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
248}
249// Add table from hooks
250$parameters = array();
251$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
252$sql .= $hookmanager->resPrint;
253if ($object->ismultientitymanaged == 1) {
254 $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
255} else {
256 $sql .= " WHERE 1 = 1";
257}
258foreach ($search as $key => $val) {
259 if (array_key_exists($key, $object->fields)) {
260 if ($key == 'status' && $search[$key] == -1) {
261 continue;
262 }
263 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
264 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
265 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
266 $search[$key] = '';
267 }
268 $mode_search = 2;
269 }
270 if ($search[$key] != '') {
271 $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
272 }
273 } else {
274 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
275 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
276 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
277 if (preg_match('/_dtstart$/', $key)) {
278 $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
279 }
280 if (preg_match('/_dtend$/', $key)) {
281 $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
282 }
283 }
284 }
285 }
286}
287
288// Search for tag/category ($searchCategoryKnowledgemanagementList is an array of ID)
289if (!empty($searchCategoryKnowledgemanagementList)) {
290 $searchCategoryKnowledgemanagementSqlList = array();
291 $listofcategoryid = '';
292 foreach ($searchCategoryKnowledgemanagementList as $searchCategoryKnowledgemanagement) {
293 if (intval($searchCategoryKnowledgemanagement) == -2) {
294 $searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)";
295 } elseif (intval($searchCategoryKnowledgemanagement) > 0) {
296 if (empty($searchCategoryKnowledgemanagementOperator)) {
297 $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).")";
298 } else {
299 $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement);
300 }
301 }
302 }
303 if ($listofcategoryid) {
304 $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)."))";
305 }
306 if ($searchCategoryKnowledgemanagementOperator == 1) {
307 if (!empty($searchCategoryKnowledgemanagementSqlList)) {
308 $sql .= " AND (".implode(' OR ', $searchCategoryKnowledgemanagementSqlList).")";
309 }
310 } else {
311 if (!empty($searchCategoryKnowledgemanagementSqlList)) {
312 $sql .= " AND (".implode(' AND ', $searchCategoryKnowledgemanagementSqlList).")";
313 }
314 }
315}
316
317if ($search_all) {
318 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
319}
320//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
321// Add where from extra fields
322include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
323// Add where from hooks
324$parameters = array();
325$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
326$sql .= $hookmanager->resPrint;
327
328/* If a group by is required
329$sql.= " GROUP BY ";
330foreach($object->fields as $key => $val) {
331 $sql .= "t.".$key.", ";
332}
333// Add fields from extrafields
334if (!empty($extrafields->attributes[$object->table_element]['label'])) {
335 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
336}
337// Add where from hooks
338$parameters=array();
339$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters, $object); // Note that $action and $object may have been modified by hook
340$sql.=$hookmanager->resPrint;
341$sql=preg_replace('/,\s*$/','', $sql);
342*/
343
344// Count total nb of records
345$nbtotalofrecords = '';
346if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
347 /* The fast and low memory method to get and count full list converts the sql into a sql count */
348 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
349 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
350 $resql = $db->query($sqlforcount);
351 if ($resql) {
352 $objforcount = $db->fetch_object($resql);
353 $nbtotalofrecords = $objforcount->nbtotalofrecords;
354 } else {
355 dol_print_error($db);
356 }
357
358 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
359 $page = 0;
360 $offset = 0;
361 }
362 $db->free($resql);
363}
364
365// Complete request and execute it with limit
366$sql .= $db->order($sortfield, $sortorder);
367if ($limit) {
368 $sql .= $db->plimit($limit + 1, $offset);
369}
370
371$resql = $db->query($sql);
372if (!$resql) {
373 dol_print_error($db);
374 exit;
375}
376
377$num = $db->num_rows($resql);
378
379
380// Direct jump if only one record found
381if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
382 $obj = $db->fetch_object($resql);
383 $id = $obj->rowid;
384 header("Location: ".dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.$id);
385 exit;
386}
387
388
389// Output page
390// --------------------------------------------------------------------
391
392llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-knowledgemanagement page-list bodyforlist');
393
394
395$arrayofselected = is_array($toselect) ? $toselect : array();
396
397$param = '';
398if (!empty($mode)) {
399 $param .= '&mode='.urlencode($mode);
400}
401if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
402 $param .= '&contextpage='.urlencode($contextpage);
403}
404if ($limit > 0 && $limit != $conf->liste_limit) {
405 $param .= '&limit='.((int) $limit);
406}
407foreach ($search as $key => $val) {
408 if (is_array($search[$key])) {
409 foreach ($search[$key] as $skey) {
410 if ($skey != '') {
411 $param .= '&search_'.$key.'[]='.urlencode($skey);
412 }
413 }
414 } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
415 $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
416 $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
417 $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
418 } elseif ($search[$key] != '') {
419 $param .= '&search_'.$key.'='.urlencode($search[$key]);
420 }
421}
422if ($optioncss != '') {
423 $param .= '&optioncss='.urlencode($optioncss);
424}
425// Add $param from extra fields
426include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
427// Add $param from hooks
428$parameters = array('param' => &$param);
429$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
430$param .= $hookmanager->resPrint;
431
432// List of mass actions available
433$arrayofmassactions = array(
434 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
435 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
436 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
437);
438if ($permissiontovalidate) {
439 $arrayofmassactions['validate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
440}
441if (isModEnabled('category') && $permissiontoadd) {
442 $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
443}
444if (!empty($permissiontodelete)) {
445 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
446}
447if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
448 $arrayofmassactions = array();
449}
450$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
451
452print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
453if ($optioncss != '') {
454 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
455}
456print '<input type="hidden" name="token" value="'.newToken().'">';
457print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
458print '<input type="hidden" name="action" value="list">';
459print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
460print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
461print '<input type="hidden" name="page" value="'.$page.'">';
462print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
463print '<input type="hidden" name="page_y" value="">';
464print '<input type="hidden" name="mode" value="'.$mode.'">';
465
466$newcardbutton = '';
467$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'));
468$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'));
469$newcardbutton .= dolGetButtonTitleSeparator();
470$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
471
472print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
473
474// Add code for pre mass action (confirmation or email presend form)
475$topicmail = "SendKnowledgeRecordRef";
476$modelmail = "knowledgerecord";
477$objecttmp = new KnowledgeRecord($db);
478$trackid = 'xxxx'.$object->id;
479include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
480
481if ($search_all) {
482 $setupstring = '';
483 foreach ($fieldstosearchall as $key => $val) {
484 $fieldstosearchall[$key] = $langs->trans($val);
485 $setupstring .= $key."=".$val.";";
486 }
487 print '<!-- Search done like if KNOWLEDGEMANAGEMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
488 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
489}
490
491$moreforfilter = '';
492/*$moreforfilter.='<div class="divsearchfield">';
493$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
494$moreforfilter.= '</div>';*/
495
496// Filter on categories
497$moreforfilter = '';
498if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
499 $formcategory = new FormCategory($db);
500 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_KNOWLEDGEMANAGEMENT, $searchCategoryKnowledgemanagementList, 'minwidth300', $searchCategoryKnowledgemanagementList ? $searchCategoryKnowledgemanagementList : 0);
501 /*
502 $moreforfilter .= '<div class="divsearchfield">';
503 $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
504 $categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 3);
505 $categoriesKnowledgeArr[-2] = '- '.$langs->trans('NotCategorized').' -';
506 $moreforfilter .= Form::multiselectarray('search_category_knowledgemanagement_list', $categoriesKnowledgeArr, $searchCategoryKnowledgemanagementList, 0, 0, 'minwidth300');
507 $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>';
508 $moreforfilter .= '</div>';
509 */
510}
511
512$parameters = array();
513$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
514if (empty($reshook)) {
515 $moreforfilter .= $hookmanager->resPrint;
516} else {
517 $moreforfilter = $hookmanager->resPrint;
518}
519
520if (!empty($moreforfilter)) {
521 print '<div class="liste_titre liste_titre_bydiv centpercent">';
522 print $moreforfilter;
523 print '</div>';
524}
525
526$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
527$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
528$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
529
530print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
531print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
532
533
534// Fields title search
535// --------------------------------------------------------------------
536print '<tr class="liste_titre_filter">';
537// Action column
538if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
539 print '<td class="liste_titre maxwidthsearch center">';
540 $searchpicto = $form->showFilterButtons('left');
541 print $searchpicto;
542 print '</td>';
543}
544foreach ($object->fields as $key => $val) {
545 $searchkey = empty($search[$key]) ? '' : $search[$key];
546 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
547 if ($key == 'status') {
548 $cssforfield .= ($cssforfield ? ' ' : '').'center';
549 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
550 $cssforfield .= ($cssforfield ? ' ' : '').'center';
551 } elseif (in_array($val['type'], array('timestamp'))) {
552 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
553 } 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'])) {
554 $cssforfield .= ($cssforfield ? ' ' : '').'right';
555 }
556 if (!empty($arrayfields['t.'.$key]['checked'])) {
557 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
558 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
559 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);
560 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
561 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
562 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
563 print '<div class="nowrap">';
564 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
565 print '</div>';
566 print '<div class="nowrap">';
567 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
568 print '</div>';
569 } elseif ($key == 'lang') {
570 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
571 $formadmin = new FormAdmin($db);
572 print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
573 } else {
574 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
575 }
576 print '</td>';
577 }
578}
579// Extra fields
580include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
581
582// Fields from hook
583$parameters = array('arrayfields'=>$arrayfields);
584$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
585print $hookmanager->resPrint;
586// Action column
587if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
588 print '<td class="liste_titre center maxwidthsearch">';
589 $searchpicto = $form->showFilterButtons();
590 print $searchpicto;
591 print '</td>';
592}
593print '</tr>'."\n";
594
595$totalarray = array();
596$totalarray['nbfield'] = 0;
597
598// Fields title label
599// --------------------------------------------------------------------
600print '<tr class="liste_titre">';
601if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
602 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
603 $totalarray['nbfield']++;
604}
605foreach ($object->fields as $key => $val) {
606 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
607 if ($key == 'status') {
608 $cssforfield .= ($cssforfield ? ' ' : '').'center';
609 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
610 $cssforfield .= ($cssforfield ? ' ' : '').'center';
611 } elseif (in_array($val['type'], array('timestamp'))) {
612 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
613 } 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'])) {
614 $cssforfield .= ($cssforfield ? ' ' : '').'right';
615 }
616 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
617 if (!empty($arrayfields['t.'.$key]['checked'])) {
618 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";
619 $totalarray['nbfield']++;
620 }
621}
622// Extra fields
623include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
624// Hook fields
625$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
626$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
627print $hookmanager->resPrint;
628// Action column
629if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
630 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
631 $totalarray['nbfield']++;
632}
633print '</tr>'."\n";
634
635// Detect if we need a fetch on each output line
636$needToFetchEachLine = 0;
637if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
638 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
639 if (!is_null($val) && preg_match('/\$object/', $val)) {
640 $needToFetchEachLine++; // There is at least one compute field that use $object
641 }
642 }
643}
644
645
646// Loop on record
647// --------------------------------------------------------------------
648$i = 0;
649$savnbfield = $totalarray['nbfield'];
650$totalarray = array();
651$totalarray['nbfield'] = 0;
652$imaxinloop = ($limit ? min($num, $limit) : $num);
653while ($i < $imaxinloop) {
654 $obj = $db->fetch_object($resql);
655 if (empty($obj)) {
656 break; // Should not happen
657 }
658
659 // Store properties in $object
660 $object->setVarsFromFetchObj($obj);
661
662 if ($mode == 'kanban') {
663 if ($i == 0) {
664 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
665 print '<div class="box-flex-container kanban">';
666 }
667 // Output Kanban
668 $selected = -1;
669 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
670 $selected = 0;
671 if (in_array($object->id, $arrayofselected)) {
672 $selected = 1;
673 }
674 }
675 print $object->getKanbanView('', array('selected' => $selected));
676 if ($i == ($imaxinloop - 1)) {
677 print '</div>';
678 print '</td></tr>';
679 }
680 } else {
681 // Show here line of result
682 $j = 0;
683 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
684 // Action column
685 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
686 print '<td class="nowrap center">';
687 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
688 $selected = 0;
689 if (in_array($object->id, $arrayofselected)) {
690 $selected = 1;
691 }
692 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
693 }
694 print '</td>';
695 if (!$i) {
696 $totalarray['nbfield']++;
697 }
698 }
699 foreach ($object->fields as $key => $val) {
700 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
701 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
702 $cssforfield .= ($cssforfield ? ' ' : '').'center';
703 } elseif ($key == 'status') {
704 $cssforfield .= ($cssforfield ? ' ' : '').'center';
705 }
706
707 if (in_array($val['type'], array('timestamp'))) {
708 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
709 } elseif ($key == 'ref') {
710 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
711 }
712
713 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
714 $cssforfield .= ($cssforfield ? ' ' : '').'right';
715 }
716 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
717 if (!empty($arrayfields['t.'.$key]['checked'])) {
718 print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
719 if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
720 print ' title="'.dol_escape_htmltag(dol_nl2br($object->$key, 1)).'"'; // We add dol_nl2br for the question and answer fields
721 }
722 print '>';
723 if ($key == 'status') {
724 print $object->getLibStatut(5);
725 } elseif ($key == 'rowid') {
726 print $object->showOutputField($val, $key, $object->id, '');
727 } elseif ($key == 'fk_user_creat') {
728 if ($object->fk_user_creat > 0) {
729 if (isset($conf->cache['user'][$object->fk_user_creat])) {
730 $user_temp = $conf->cache['user'][$object->fk_user_creat];
731 } else {
732 $user_temp = new User($db);
733 $user_temp->fetch($object->fk_user_creat);
734 $conf->cache['user'][$object->fk_user_creat] = $user_temp;
735 }
736 print $user_temp->getNomUrl(-1);
737 }
738 } elseif ($key == 'fk_user_modif') {
739 if ($object->fk_user_modif > 0) {
740 if (isset($conf->cache['user'][$object->fk_user_modif])) {
741 $user_temp = $conf->cache['user'][$object->fk_user_modif];
742 } else {
743 $user_temp = new User($db);
744 $user_temp->fetch($object->fk_user_modif);
745 $conf->cache['user'][$object->fk_user_modif] = $user_temp;
746 }
747 print $user_temp->getNomUrl(-1);
748 }
749 } elseif ($key == 'fk_user_valid') {
750 if ($object->fk_user_valid > 0) {
751 if (isset($conf->cache['user'][$object->fk_user_valid])) {
752 $user_temp = $conf->cache['user'][$object->fk_user_valid];
753 } else {
754 $user_temp = new User($db);
755 $user_temp->fetch($object->fk_user_valid);
756 $conf->cache['user'][$object->fk_user_valid] = $user_temp;
757 }
758 print $user_temp->getNomUrl(-1);
759 }
760 } elseif ($key == 'lang') {
761 $labellang = ($object->lang ? $langs->trans('Language_'.$object->lang) : '');
762 print picto_from_langcode($object->lang, 'class="paddingrightonly saturatemedium opacitylow"');
763 print $labellang;
764 } elseif ($key == 'question') {
765 print dolGetFirstLineOfText($object->$key);
766 } else {
767 print $object->showOutputField($val, $key, $object->$key, '');
768 }
769 print '</td>';
770 if (!$i) {
771 $totalarray['nbfield']++;
772 }
773 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
774 if (!$i) {
775 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
776 }
777 if (!isset($totalarray['val'])) {
778 $totalarray['val'] = array();
779 }
780 if (!isset($totalarray['val']['t.'.$key])) {
781 $totalarray['val']['t.'.$key] = 0;
782 }
783 $totalarray['val']['t.'.$key] += $object->$key;
784 }
785 }
786 }
787 // Extra fields
788 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
789 // Fields from hook
790 $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
791 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
792 print $hookmanager->resPrint;
793 // Action column
794 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
795 print '<td class="nowrap center">';
796 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
797 $selected = 0;
798 if (in_array($object->id, $arrayofselected)) {
799 $selected = 1;
800 }
801 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
802 }
803 print '</td>';
804 if (!$i) {
805 $totalarray['nbfield']++;
806 }
807 }
808
809 print '</tr>'."\n";
810 }
811 $i++;
812}
813
814// Show total line
815include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
816
817// If no record found
818if ($num == 0) {
819 $colspan = 1;
820 foreach ($arrayfields as $key => $val) {
821 if (!empty($val['checked'])) {
822 $colspan++;
823 }
824 }
825 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
826}
827
828
829$db->free($resql);
830
831$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
832$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
833print $hookmanager->resPrint;
834
835print '</table>'."\n";
836print '</div>'."\n";
837
838print '</form>'."\n";
839
840if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
841 $hidegeneratedfilelistifempty = 1;
842 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
843 $hidegeneratedfilelistifempty = 0;
844 }
845
846 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
847 $formfile = new FormFile($db);
848
849 // Show list of available documents
850 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
851 $urlsource .= str_replace('&amp;', '&', $param);
852
853 $filedir = $diroutputmassaction;
854 $genallowed = $permissiontoread;
855 $delallowed = $permissiontoadd;
856
857 print $formfile->showdocuments('massfilesarea_knowledgemanagement', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
858}
859
860// End of page
861llxFooter();
862$db->close();
$id
Definition account.php:39
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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
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.
llxFooter()
Footer empty.
Definition document.php:107
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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 a 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.