dolibarr 21.0.0-beta
conferenceorboothattendee_list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017-2024 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
4 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
5 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
28// Load Dolibarr environment
29require '../main.inc.php';
30
31require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
35
36require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
37require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
38require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
39require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
40if (isModEnabled('category')) {
41 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
42}
43
54// Load translation files required by the page
55$langs->loadLangs(array("eventorganization", "other", "projects", "bills"));
56
57// Get Parameters
58$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
59$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
60$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
61$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
62$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
63$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
64$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
65$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
66$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
67$mode = GETPOST('mode', 'aZ');
68
69$id = GETPOSTINT('id');
70$conf_or_booth_id = GETPOSTINT('conforboothid');
71
72$withproject = GETPOSTINT('withproject');
73$fk_project = GETPOSTINT('fk_project') ? GETPOSTINT('fk_project') : GETPOSTINT('projectid');
74$projectid = $fk_project;
75
76$withProjectUrl = '';
77
78// Load variable for pagination
79$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
80$sortfield = GETPOST('sortfield', 'aZ09comma');
81$sortorder = GETPOST('sortorder', 'aZ09comma');
82$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
83if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
84 // If $page is not defined, or '' or -1 or if we click on clear filters
85 $page = 0;
86}
87$offset = $limit * $page;
88$pageprev = $page - 1;
89$pagenext = $page + 1;
90
91// Initialize a technical objects
93$project = new Project($db);
94$projectstatic = new Project($db);
95$extrafields = new ExtraFields($db);
96$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
97$hookmanager->initHooks(array('conferenceorboothattendeelist')); // Note that conf->hooks_modules contains array
98
99// Fetch optionals attributes and labels
100$extrafields->fetch_name_optionals_label($object->table_element);
101//$extrafields->fetch_name_optionals_label($object->table_element_line);
102
103$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
104
105// Default sort order (if not yet defined by previous GETPOST)
106if (!$sortfield) {
107 reset($object->fields); // Reset is required to avoid key() to return null.
108 $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
109}
110if (!$sortorder) {
111 $sortorder = "ASC";
112}
113
114// Initialize array of search criteria
115$search_all = GETPOST('search_all', 'alphanohtml');
116$search = array();
117foreach ($object->fields as $key => $val) {
118 if (GETPOST('search_'.$key, 'alpha') !== '') {
119 $search[$key] = GETPOST('search_'.$key, 'alpha');
120 }
121 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
122 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
123 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
124 }
125}
126
127// List of fields to search into when doing a "search in all"
128$fieldstosearchall = array();
129foreach ($object->fields as $key => $val) {
130 if (!empty($val['searchall'])) {
131 $fieldstosearchall['t.'.$key] = $val['label'];
132 }
133}
134
135// Definition of array of fields for columns
136$arrayfields = array();
137foreach ($object->fields as $key => $val) {
138 // If $val['visible']==0, then we never show the field
139 if (!empty($val['visible'])) {
140 $visible = (int) dol_eval((string) $val['visible'], 1);
141 $arrayfields['t.'.$key] = array(
142 'label' => $val['label'],
143 'checked' => (($visible < 0) ? 0 : 1),
144 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
145 'position' => $val['position'],
146 'help' => isset($val['help']) ? $val['help'] : ''
147 );
148 }
149}
150// Extra fields
151include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
152
153$object->fields = dol_sort_array($object->fields, 'position');
154$arrayfields = dol_sort_array($arrayfields, 'position');
155
156// Permissions
157$permissiontoread = $user->hasRight('eventorganization', 'read');
158$permissiontoadd = $user->hasRight('eventorganization', 'write');
159$permissiontodelete = $user->hasRight('eventorganization', 'delete');
160
161// Security check
162if (!isModEnabled('eventorganization')) {
163 accessforbidden('Module eventorganization not enabled');
164}
165$socid = 0;
166if ($user->socid > 0) { // Protection if external user
167 //$socid = $user->socid;
169}
170$result = restrictedArea($user, 'eventorganization');
171if (!$permissiontoread) {
173}
174
175
176/*
177 * Actions
178 */
179
180if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && $user->hasRight('eventorganization', 'write')) {
181 //If "set" fields keys is in projects fields
182 $project_attr = preg_replace('/^set/', '', $action);
183 if (array_key_exists($project_attr, $project->fields)) {
184 $result = $project->fetch($projectid, $projectref);
185 if ($result < 0) {
186 setEventMessages(null, $project->errors, 'errors');
187 } else {
188 $projectid = $project->id;
189 $project->{$project_attr} = GETPOST($project_attr);
190 $result = $project->update($user);
191 if ($result < 0) {
192 setEventMessages(null, $project->errors, 'errors');
193 }
194 }
195 }
196}
197
198if (GETPOST('cancel', 'alpha')) {
199 $action = 'list';
200 $massaction = '';
201}
202if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
203 $massaction = '';
204}
205
206$parameters = array();
207$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
208if ($reshook < 0) {
209 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
210}
211
212if (empty($reshook)) {
213 // Selection of new fields
214 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
215
216 // Purge search criteria
217 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
218 foreach ($object->fields as $key => $val) {
219 $search[$key] = '';
220 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
221 $search[$key.'_dtstart'] = '';
222 $search[$key.'_dtend'] = '';
223 }
224 }
225 $toselect = array();
226 $search_array_options = array();
227 }
228 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
229 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
230 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
231 }
232
233 // Mass actions
234 $objectclass = 'ConferenceOrBoothAttendee';
235 $objectlabel = 'ConferenceOrBoothAttendee';
236 $uploaddir = $conf->eventorganization->dir_output;
237 include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php';
238 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
239}
240
241
242
243/*
244 * View
245 */
246
247$form = new Form($db);
248$now = dol_now();
249
250$help_url = "EN:Module_Event_Organization";
251
252$morejs = array();
253$morecss = array();
254
255$confOrBooth = new ConferenceOrBooth($db);
256if ($conf_or_booth_id > 0) {
257 $result = $confOrBooth->fetch($conf_or_booth_id);
258 if ($result < 0) {
259 setEventMessages(null, $confOrBooth->errors, 'errors');
260 } else {
261 $fk_project = $confOrBooth->fk_project;
262 }
263}
264
265if ($fk_project > 0) {
266 $result = $projectstatic->fetch($fk_project);
267 if ($result < 0) {
268 setEventMessages(null, $projectstatic->errors, 'errors');
269 }
270}
271
272
273// Build and execute select
274// --------------------------------------------------------------------
275$sql = 'SELECT ';
276$sql .= $object->getFieldList('t');
277// Add fields from extrafields
278if (!empty($extrafields->attributes[$object->table_element]['label'])) {
279 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
280 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
281 }
282}
283// Add fields from hooks
284$parameters = array();
285$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
286$sql .= $hookmanager->resPrint;
287$sql = preg_replace('/,\s*$/', '', $sql);
288//$sql .= ", COUNT(rc.rowid) as anotherfield";
289
290$sqlfields = $sql; // $sql fields to remove for count total
291
292$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
293if (!empty($confOrBooth->id)) {
294 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm AND a.id=".((int) $confOrBooth->id);
295}
296if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
297 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
298}
299// Add table from hooks
300$parameters = array();
301$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
302$sql .= $hookmanager->resPrint;
303if ($object->ismultientitymanaged == 1) {
304 $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
305} else {
306 $sql .= " WHERE 1 = 1";
307}
308if (!empty($projectstatic->id)) {
309 $sql .= " AND t.fk_project = ".((int) $projectstatic->id);
310}
311foreach ($search as $key => $val) {
312 if (array_key_exists($key, $object->fields)) {
313 if ($key == 'status' && $search[$key] == -1) {
314 continue;
315 }
316 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
317 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
318 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
319 $search[$key] = '';
320 }
321 $mode_search = 2;
322 }
323 if ($search[$key] != '') {
324 $sql .= natural_search($db->sanitize($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
325 }
326 } else {
327 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
328 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
329 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
330 if (preg_match('/_dtstart$/', $key)) {
331 $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
332 }
333 if (preg_match('/_dtend$/', $key)) {
334 $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
335 }
336 }
337 }
338 }
339}
340if ($search_all) {
341 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
342}
343//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
344// Add where from extra fields
345include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
346// Add where from hooks
347$parameters = array();
348$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
349$sql .= $hookmanager->resPrint;
350
351// Count total nb of records
352$nbtotalofrecords = '';
353if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
354 /* The fast and low memory method to get and count full list converts the sql into a sql count */
355 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
356 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
357 $resql = $db->query($sqlforcount);
358 if ($resql) {
359 $objforcount = $db->fetch_object($resql);
360 $nbtotalofrecords = $objforcount->nbtotalofrecords;
361 } else {
362 dol_print_error($db);
363 }
364
365 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
366 $page = 0;
367 $offset = 0;
368 }
369 $db->free($resql);
370}
371
372// Complete request and execute it with limit
373$sql .= $db->order($sortfield, $sortorder);
374if ($limit) {
375 $sql .= $db->plimit($limit + 1, $offset);
376}
377
378$resql = $db->query($sql);
379if (!$resql) {
380 dol_print_error($db);
381 exit;
382}
383
384$num = $db->num_rows($resql);
385
386// Direct jump if only one record found
387if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
388 $obj = $db->fetch_object($resql);
389 $id = $obj->rowid;
390 header("Location: ".DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?id='.((int) $id));
391 exit;
392}
393
394if ($confOrBooth->id > 0) {
395 $title = $langs->trans('ListOfAttendeesPerConference');
396} else {
397 $title = $langs->trans('ListOfAttendeesOfEvent');
398}
399
400// Output page
401// --------------------------------------------------------------------
402
403llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-eventorganization page-attendee-list classforhorizontalscrolloftabs');
404
405
406
407if ($projectstatic->id > 0 || $confOrBooth > 0) {
408 if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
409 $projectstatic->fetchComments();
410 }
411 if (!empty($projectstatic->socid)) {
412 $projectstatic->fetch_thirdparty();
413 }
414
415 $withProjectUrl = '';
416 $object->project = clone $projectstatic;
417
418 if (!empty($withproject)) {
419 // Tabs for project
420 $tab = 'eventorganisation';
421 $withProjectUrl = "&withproject=1";
422 $head = project_prepare_head($projectstatic);
423
424 print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
425
426 $param = ($mode == 'mine' ? '&mode=mine' : '');
427
428 // Project card
429
430 $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
431
432 $morehtmlref = '<div class="refidno">';
433 // Title
434 $morehtmlref .= $projectstatic->title;
435 // Thirdparty
436 if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
437 $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
438 }
439 $morehtmlref .= '</div>';
440
441 // Define a complementary filter for search of next/prev ref.
442 if (!$user->hasRight('projet', 'all', 'lire')) {
443 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
444 $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
445 }
446
447 dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
448
449 print '<div class="fichecenter">';
450 print '<div class="fichehalfleft">';
451 print '<div class="underbanner clearboth"></div>';
452
453 print '<table class="border tableforfield centpercent">';
454
455 // Usage
456 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
457 print '<tr><td class="tdtop">';
458 print $langs->trans("Usage");
459 print '</td>';
460 print '<td>';
461 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
462 print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
463 $htmltext = $langs->trans("ProjectFollowOpportunity");
464 print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
465 print '<br>';
466 }
467 if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
468 print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
469 $htmltext = $langs->trans("ProjectFollowTasks");
470 print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
471 print '<br>';
472 }
473 if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
474 print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
475 $htmltext = $langs->trans("ProjectBillTimeDescription");
476 print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
477 print '<br>';
478 }
479 if (isModEnabled('eventorganization')) {
480 print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
481 $htmltext = $langs->trans("EventOrganizationDescriptionLong");
482 print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
483 }
484 print '</td></tr>';
485 }
486
487 // Visibility
488 print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
489 if ($projectstatic->public == 0) {
490 print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
491 print $langs->trans("PrivateProject");
492 } else {
493 print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
494 print $langs->trans("SharedProject");
495 }
496 print '</td></tr>';
497
498 // Budget
499 print '<tr><td>'.$langs->trans("Budget").'</td><td>';
500 if (strcmp($projectstatic->budget_amount, '')) {
501 print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
502 }
503 print '</td></tr>';
504
505 // Date start - end project
506 print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Project").')</td><td>';
507 $start = dol_print_date($projectstatic->date_start, 'day');
508 print($start ? $start : '?');
509 $end = dol_print_date($projectstatic->date_end, 'day');
510 print ' - ';
511 print($end ? $end : '?');
512 if ($projectstatic->hasDelay()) {
513 print img_warning("Late");
514 }
515 print '</td></tr>';
516
517 // Date start - end of event
518 print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Event").')</td><td>';
519 $start = dol_print_date($projectstatic->date_start_event, 'day');
520 print($start ? $start : '?');
521 $end = dol_print_date($projectstatic->date_end_event, 'day');
522 print ' - ';
523 print($end ? $end : '?');
524 if ($projectstatic->hasDelay()) {
525 print img_warning("Late");
526 }
527 print '</td></tr>';
528
529 // Location event
530 print '<tr><td>'.$langs->trans("Location").'</td><td>';
531 print $projectstatic->location;
532 print '</td></tr>';
533
534 // Other attributes
535 $cols = 2;
536 $objectconf = $object;
537 $object = $projectstatic;
538 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
539 $object = $objectconf;
540
541 print '</table>';
542
543 print '</div>';
544
545 print '<div class="fichehalfright">';
546 print '<div class="underbanner clearboth"></div>';
547
548 print '<table class="border tableforfield centpercent">';
549
550 // Description
551 print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
552 print dol_htmlentitiesbr($projectstatic->description);
553 print '</td></tr>';
554
555 // Categories
556 if (isModEnabled('category')) {
557 print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
558 print $form->showCategories($projectstatic->id, 'project', 1);
559 print "</td></tr>";
560 }
561
562 print '<tr><td class="nowrap">';
563 $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
564 $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
565 print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', $projectstatic->accept_conference_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
566 print '</td><td>';
567 print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', $projectstatic->accept_conference_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
568 print "</td></tr>";
569
570 print '<tr><td>';
571 $typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : '');
572 $htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
573 print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', $projectstatic->accept_booth_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
574 print '</td><td>';
575 print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', $projectstatic->accept_booth_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
576 print "</td></tr>";
577
578 print '<tr><td>';
579 print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
580 print '</td><td>';
581 print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
582 print "</td></tr>";
583
584 print '<tr><td>';
585 print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
586 print '</td><td>';
587 print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
588 print "</td></tr>";
589
590 print '<tr><td class="titlefield">';
591 print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $projectstatic, $permissiontoadd, 'integer:3', '&withproject=1', 0, 0, 'projectid');
592 print '</td><td class="valuefield">';
593 print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, 0, '&withproject=1', 0, '', 'projectid');
594 print "</td></tr>";
595
596 // Link to ICS for the event
597 print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLinkProject").'</td><td class="valuefield">';
598 // Define $urlwithroot
599 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
600 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
601
602 // Show message
603 $message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
604 $message .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
605 $message .= "&project=".$projectid.'&module='.urlencode('project@eventorganization').'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
606 print $message;
607 print "</td></tr>";
608
609 print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
610 // Define $urlwithroot
611 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
612 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
613
614 // Show message
615 $message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
616 $message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...');
617 $message .= "&project=".$projectstatic->id.'&module='.urlencode('conforbooth@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
618 print $message;
619 print "</td></tr>";
620
621 // Link to the submit vote/register page
622 print '<tr><td>';
623 //print '<span class="opacitymedium">';
624 print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
625 //print '</span>';
626 print '</td><td>';
627 $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
628 $encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
629 $linksuggest .= '&securekey='.urlencode($encodedsecurekey);
630 //print '<div class="urllink">';
631 //print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
632 print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
633 print '<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
634 //print '</div>';
635 //print ajax_autoselect("linkregister");
636 print '</td></tr>';
637
638 // Link to the subscribe
639 print '<tr><td>';
640 //print '<span class="opacitymedium">';
641 print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
642 //print '</span>';
643 print '</td><td>';
644 $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.'&type=global';
645 $encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
646 $link_subscription .= '&securekey='.urlencode($encodedsecurekey);
647 //print '<div class="urllink">';
648 //print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
649 print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.'" class="quatrevingtpercent">'.$link_subscription.'</a></div>';
650 print '<a target="_blank" rel="noopener noreferrer" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
651 //print '</div>';
652 //print ajax_autoselect("linkregister");
653 print '</td></tr>';
654
655 print '</table>';
656
657 print '</div>';
658 print '</div>';
659
660 print '<div class="clearboth"></div>';
661
662 print dol_get_fiche_end();
663
664 if (empty($confOrBooth->id)) {
665 $head = conferenceorboothProjectPrepareHead($projectstatic);
666 $tab = 'attendees';
667 print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, (!empty($project->public) ? 'projectpub' : 'project'), 0, '', 'reposition');
668 }
669 }
670
671 if ($confOrBooth->id > 0) {
672 $head = conferenceorboothPrepareHead($confOrBooth, $withproject);
673
674 print dol_get_fiche_head($head, 'attendees', $langs->trans("ConferenceOrBooth"), -1, $object->picto);
675
676 $object_evt = $object;
677 $object = $confOrBooth;
678
679 dol_banner_tab($object, 'ref', '', 0);
680
681 print '<div class="fichecenter">';
682 print '<div class="fichehalfleft">';
683 print '<div class="underbanner clearboth"></div>';
684 print '<table class="border centpercent tableforfield">' . "\n";
685
686 include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
687
688 // Other attributes. Fields from hook formObjectOptions and Extrafields.
689 include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
690 $object = $object_evt;
691 print '</table>';
692 print '</div>';
693 print '</div>';
694
695 print '<div class="clearboth"></div>';
696
697 print dol_get_fiche_end();
698 }
699}
700
701$arrayofselected = is_array($toselect) ? $toselect : array();
702
703$param = '';
704if (!empty($mode)) {
705 $param .= '&mode='.urlencode($mode);
706}
707if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
708 $param .= '&contextpage='.urlencode($contextpage);
709}
710if ($limit > 0 && $limit != $conf->liste_limit) {
711 $param .= '&limit='.((int) $limit);
712}
713if ($optioncss != '') {
714 $param .= '&optioncss='.urlencode($optioncss);
715}
716foreach ($search as $key => $val) {
717 if (is_array($search[$key])) {
718 foreach ($search[$key] as $skey) {
719 if ($skey != '') {
720 $param .= '&search_'.$key.'[]='.urlencode($skey);
721 }
722 }
723 } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
724 $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
725 $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
726 $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
727 } elseif ($search[$key] != '') {
728 $param .= '&search_'.$key.'='.urlencode($search[$key]);
729 }
730}
731if ($confOrBooth->id > 0) {
732 $param .= '&conforboothid='.urlencode((string) $confOrBooth->id);
733}
734if ($projectstatic->id > 0) {
735 $param .= '&fk_project='.urlencode((string) ($projectstatic->id));
736}
737$param .= $withProjectUrl;
738
739// Add $param from extra fields
740include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
741// Add $param from hooks
742$parameters = array('param' => &$param);
743$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
744$param .= $hookmanager->resPrint;
745
746// List of mass actions available
747$arrayofmassactions = array(
748 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
749 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
750 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
751 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
752);
753if (!empty($permissiontodelete)) {
754 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
755}
756if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
757 $arrayofmassactions = array();
758}
759$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
760
761print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($conf_or_booth_id) ? '?conforboothid='.$conf_or_booth_id : '').'">'."\n";
762if ($optioncss != '') {
763 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
764}
765print '<input type="hidden" name="token" value="'.newToken().'">';
766print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
767print '<input type="hidden" name="action" value="list">';
768print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
769print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
770print '<input type="hidden" name="page" value="'.$page.'">';
771print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
772print '<input type="hidden" name="withproject" value="'.$withproject.'">';
773print '<input type="hidden" name="fk_project" value="'.$fk_project.'">';
774print '<input type="hidden" name="page_y" value="">';
775print '<input type="hidden" name="mode" value="'.$mode.'">';
776
777$params = array('morecss' => 'reposition');
778
779$urlnew = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id) ? '&conforboothid='.$confOrBooth->id : '').(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : '').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl);
780
781$newcardbutton = '';
782$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $urlnew, '', $permissiontoadd, $params);
783
784print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
785
786
787// Add code for pre mass action (confirmation or email presend form)
788$topicmail = $projectstatic->title;
789$modelmail = "conferenceorbooth";
790$objecttmp = new ConferenceOrBoothAttendee($db);
791$trackid = 'conferenceorbooth_'.$object->id;
792$withmaindocfilemail = 0;
793include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
794
795
796if ($search_all) {
797 $setupstring = '';
798 foreach ($fieldstosearchall as $key => $val) {
799 $fieldstosearchall[$key] = $langs->trans($val);
800 $setupstring .= $key."=".$val.";";
801 }
802 print '<!-- Search done like if CONFERENCEORBOOTHATTENDEE_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
803 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
804}
805
806$moreforfilter = '';
807/*$moreforfilter.='<div class="divsearchfield">';
808$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
809$moreforfilter.= '</div>';*/
810
811$parameters = array();
812$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
813if (empty($reshook)) {
814 $moreforfilter .= $hookmanager->resPrint;
815} else {
816 $moreforfilter = $hookmanager->resPrint;
817}
818
819if (!empty($moreforfilter)) {
820 print '<div class="liste_titre liste_titre_bydiv centpercent">';
821 print $moreforfilter;
822 print '</div>';
823}
824
825$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
826$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
827$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
828$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
829
830
831print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
832print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
833
834
835// Fields title search
836// --------------------------------------------------------------------
837print '<tr class="liste_titre_filter">';
838// Action column
839if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
840 print '<td class="liste_titre center maxwidthsearch">';
841 $searchpicto = $form->showFilterButtons('left');
842 print $searchpicto;
843 print '</td>';
844}
845foreach ($object->fields as $key => $val) {
846 $searchkey = empty($search[$key]) ? '' : $search[$key];
847 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
848 if ($key == 'status') {
849 $cssforfield .= ($cssforfield ? ' ' : '').'center';
850 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
851 $cssforfield .= ($cssforfield ? ' ' : '').'center';
852 } elseif (in_array($val['type'], array('timestamp'))) {
853 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
854 } 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'])) {
855 $cssforfield .= ($cssforfield ? ' ' : '').'right';
856 }
857 if (!empty($arrayfields['t.'.$key]['checked'])) {
858 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
859 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
860 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);
861 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
862 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
863 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
864 print '<div class="nowrap">';
865 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
866 print '</div>';
867 print '<div class="nowrap">';
868 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
869 print '</div>';
870 } elseif ($key == 'lang') {
871 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
872 $formadmin = new FormAdmin($db);
873 print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
874 } else {
875 print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
876 }
877 print '</td>';
878 }
879}
880// Extra fields
881include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
882
883// Fields from hook
884$parameters = array('arrayfields' => $arrayfields);
885$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
886print $hookmanager->resPrint;
887// Action column
888if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
889 print '<td class="liste_titre center maxwidthsearch">';
890 $searchpicto = $form->showFilterButtons();
891 print $searchpicto;
892 print '</td>';
893}
894print '</tr>'."\n";
895
896$totalarray = array();
897$totalarray['nbfield'] = 0;
898
899// Fields title label
900// --------------------------------------------------------------------
901print '<tr class="liste_titre">';
902// Action column
903if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
904 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
905 $totalarray['nbfield']++;
906}
907foreach ($object->fields as $key => $val) {
908 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
909 if ($key == 'status') {
910 $cssforfield .= ($cssforfield ? ' ' : '').'center';
911 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
912 $cssforfield .= ($cssforfield ? ' ' : '').'center';
913 } elseif (in_array($val['type'], array('timestamp'))) {
914 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
915 } 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'])) {
916 $cssforfield .= ($cssforfield ? ' ' : '').'right';
917 }
918 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
919 if (!empty($arrayfields['t.'.$key]['checked'])) {
920 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";
921 $totalarray['nbfield']++;
922 }
923}
924// Extra fields
925include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
926// Hook fields
927$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
928$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
929print $hookmanager->resPrint;
930// Action column
931if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
932 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
933 $totalarray['nbfield']++;
934}
935print '</tr>'."\n";
936
937
938// Detect if we need a fetch on each output line
939$needToFetchEachLine = 0;
940if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
941 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
942 if (!is_null($val) && preg_match('/\$object/', $val)) {
943 $needToFetchEachLine++; // There is at least one compute field that use $object
944 }
945 }
946}
947
948
949// Loop on record
950// --------------------------------------------------------------------
951$i = 0;
952$savnbfield = $totalarray['nbfield'];
953$totalarray = array();
954$totalarray['nbfield'] = 0;
955$imaxinloop = ($limit ? min($num, $limit) : $num);
956while ($i < $imaxinloop) {
957 $obj = $db->fetch_object($resql);
958 if (empty($obj)) {
959 break; // Should not happen
960 }
961
962 // Store properties in $object
963 $object->setVarsFromFetchObj($obj);
964
965 if ($mode == 'kanban') {
966 if ($i == 0) {
967 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
968 print '<div class="box-flex-container kanban">';
969 }
970 // Output Kanban
971 $selected = -1;
972 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
973 $selected = 0;
974 if (in_array($object->id, $arrayofselected)) {
975 $selected = 1;
976 }
977 }
978 print $object->getKanbanView('', array('selected' => $selected));
979 if ($i == ($imaxinloop - 1)) {
980 print '</div>';
981 print '</td></tr>';
982 }
983 } else {
984 // Show line of result
985 $j = 0;
986 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
987 // Action column
988 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
989 print '<td class="nowrap center">';
990 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
991 $selected = 0;
992 if (in_array($object->id, $arrayofselected)) {
993 $selected = 1;
994 }
995 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
996 }
997 print '</td>';
998 if (!$i) {
999 $totalarray['nbfield']++;
1000 }
1001 }
1002 foreach ($object->fields as $key => $val) {
1003 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
1004 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
1005 $cssforfield .= ($cssforfield ? ' ' : '').'center';
1006 } elseif ($key == 'status') {
1007 $cssforfield .= ($cssforfield ? ' ' : '').'center';
1008 }
1009
1010 if (in_array($val['type'], array('timestamp'))) {
1011 $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
1012 } elseif ($key == 'ref') {
1013 $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
1014 }
1015
1016 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) {
1017 $cssforfield .= ($cssforfield ? ' ' : '').'right';
1018 }
1019 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
1020
1021 if (!empty($arrayfields['t.'.$key]['checked'])) {
1022 print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
1023 if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
1024 print ' title="'.dol_escape_htmltag($object->$key).'"';
1025 }
1026 print '>';
1027 if ($key == 'status') {
1028 print $object->getLibStatut(5);
1029 } elseif ($key == 'ref') {
1030 $optionLink = (!empty($withproject) ? 'conforboothidproject' : 'conforboothid');
1031 if (empty($confOrBooth->id)) {
1032 $optionLink = 'projectid';
1033 }
1034 print $object->getNomUrl(1, $optionLink);
1035 } else {
1036 print $object->showOutputField($val, $key, $object->$key, '');
1037 }
1038 print '</td>';
1039 if (!$i) {
1040 $totalarray['nbfield']++;
1041 }
1042 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
1043 if (!$i) {
1044 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
1045 }
1046 if (!isset($totalarray['val'])) {
1047 $totalarray['val'] = array();
1048 }
1049 if (!isset($totalarray['val']['t.'.$key])) {
1050 $totalarray['val']['t.'.$key] = 0;
1051 }
1052 $totalarray['val']['t.'.$key] += $object->$key;
1053 }
1054 }
1055 }
1056 // Extra fields
1057 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1058 // Fields from hook
1059 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
1060 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1061 print $hookmanager->resPrint;
1062 // Action column
1063 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1064 print '<td class="nowrap center">';
1065 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1066 $selected = 0;
1067 if (in_array($object->id, $arrayofselected)) {
1068 $selected = 1;
1069 }
1070 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
1071 }
1072 print '</td>';
1073 if (!$i) {
1074 $totalarray['nbfield']++;
1075 }
1076 }
1077
1078 print '</tr>'."\n";
1079 }
1080
1081 $i++;
1082}
1083
1084// Show total line
1085include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
1086
1087// If no record found
1088if ($num == 0) {
1089 $colspan = 1;
1090 foreach ($arrayfields as $key => $val) {
1091 if (!empty($val['checked'])) {
1092 $colspan++;
1093 }
1094 }
1095 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
1096}
1097
1098
1099$db->free($resql);
1100
1101$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1102$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1103print $hookmanager->resPrint;
1104
1105print '</table>'."\n";
1106print '</div>'."\n";
1107
1108print '</form>'."\n";
1109
1110if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
1111 $hidegeneratedfilelistifempty = 1;
1112 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
1113 $hidegeneratedfilelistifempty = 0;
1114 }
1115
1116 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
1117 $formfile = new FormFile($db);
1118
1119 // Show list of available documents
1120 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
1121 $urlsource .= str_replace('&amp;', '&', $param);
1122
1123 $filedir = $diroutputmassaction;
1124 $genallowed = $permissiontoread;
1125 $delallowed = $permissiontoadd;
1126
1127 print $formfile->showdocuments('massfilesarea_eventorganization', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
1128}
1129
1130// End of page
1131llxFooter();
1132$db->close();
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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:71
Class for ConferenceOrBoothAttendee.
Class for ConferenceOrBooth.
Class to manage standard extra fields.
Class to generate html code for admin pages.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
llxFooter()
Footer empty.
Definition document.php:107
conferenceorboothPrepareHead($object, $with_project=0)
Prepare array of tabs for ConferenceOrBooth.
conferenceorboothProjectPrepareHead($object)
Prepare array of tabs for ConferenceOrBooth Project tab.
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.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
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.
dol_hash($chain, $type='0', $nosalt=0)
Returns a hash (non reversible encryption) of a string.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.