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