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