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