25 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/eventorganization/class/conferenceorbooth.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/eventorganization/class/conferenceorboothattendee.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
39 global $dolibarr_main_url_root;
45 $langs->loadLangs(array(
"eventorganization",
"other",
"projects"));
47 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
48 $massaction =
GETPOST(
'massaction',
'alpha');
49 $show_files =
GETPOST(
'show_files',
'int');
50 $confirm =
GETPOST(
'confirm',
'alpha');
51 $cancel =
GETPOST(
'cancel',
'alpha');
52 $toselect =
GETPOST(
'toselect',
'array');
53 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'conferenceorboothattendeelist';
54 $backtopage =
GETPOST(
'backtopage',
'alpha');
55 $optioncss =
GETPOST(
'optioncss',
'aZ');
58 $conf_or_booth_id =
GETPOST(
'conforboothid',
'int');
60 $withproject =
GETPOST(
'withproject',
'int');
61 $fk_project =
GETPOST(
'fk_project',
'int') ?
GETPOST(
'fk_project',
'int') :
GETPOST(
'projectid',
'int');
62 $projectid = $fk_project;
67 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
68 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
74 $offset = $limit * $page;
75 $pageprev = $page - 1;
76 $pagenext = $page + 1;
81 $projectstatic =
new Project($db);
82 $diroutputmassaction = $conf->eventorganization->dir_output.
'/temp/massgeneration/'.$user->id;
83 $hookmanager->initHooks(array(
'conferenceorboothattendeelist'));
86 $extrafields->fetch_name_optionals_label($object->table_element);
89 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
93 reset($object->fields);
94 $sortfield =
"t.".key($object->fields);
101 $search_all =
GETPOST(
'search_all',
'alphanohtml');
103 foreach ($object->fields as $key => $val) {
104 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
105 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
107 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
108 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
109 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
114 $fieldstosearchall = array();
115 foreach ($object->fields as $key => $val) {
116 if (!empty($val[
'searchall'])) {
117 $fieldstosearchall[
't.'.$key] = $val[
'label'];
122 $arrayfields = array();
123 foreach ($object->fields as $key => $val) {
125 if (!empty($val[
'visible'])) {
126 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
127 $arrayfields[
't.'.$key] = array(
128 'label'=>$val[
'label'],
129 'checked'=>(($visible < 0) ? 0 : 1),
130 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
131 'position'=>$val[
'position'],
132 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
137 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
142 $permissiontoread = $user->rights->eventorganization->read;
143 $permissiontoadd = $user->rights->eventorganization->write;
144 $permissiontodelete = $user->rights->eventorganization->delete;
147 if (empty($conf->eventorganization->enabled)) {
151 if ($user->socid > 0) {
163 if (preg_match(
'/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) {
166 $project_attr=preg_replace(
'/^set/',
'', $action);
167 if (array_key_exists($project_attr, $project->fields)) {
168 $result = $project->fetch($projectid);
172 $project->{$project_attr}=
GETPOST($project_attr);
173 $result=$project->update($user);
181 if (
GETPOST(
'cancel',
'alpha')) {
185 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend'
186 && $massaction !=
'presend'
187 && $massaction !=
'confirm_presend') {
191 $parameters = array();
192 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
197 if (empty($reshook)) {
199 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
202 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
203 foreach ($object->fields as $key => $val) {
205 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
206 $search[$key.
'_dtstart'] =
'';
207 $search[$key.
'_dtend'] =
'';
211 $search_array_options = array();
213 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
214 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
219 $objectclass =
'ConferenceOrBoothAttendee';
220 $objectlabel =
'ConferenceOrBoothAttendee';
221 $uploaddir = $conf->eventorganization->dir_output;
222 include DOL_DOCUMENT_ROOT.
'/eventorganization/core/actions_massactions_mail.inc.php';
223 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
237 if ($confOrBooth->id > 0) {
238 $title = $langs->trans(
'ListOfAttendeesPerConference');
240 $title = $langs->trans(
'ListOfAttendeesOfEvent');
246 if ($conf_or_booth_id > 0) {
247 $result = $confOrBooth->fetch($conf_or_booth_id);
251 $fk_project = $confOrBooth->fk_project;
255 if ($fk_project > 0) {
256 $result = $projectstatic->fetch($fk_project);
266 $sql .= $object->getFieldList(
't');
268 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
269 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
270 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
274 $parameters = array();
275 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
276 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
277 $sql = preg_replace(
'/,\s*$/',
'', $sql);
278 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
279 if (!empty($confOrBooth->id)) {
280 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as a on a.id=t.fk_actioncomm AND a.id=".((int) $confOrBooth->id);
282 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
283 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
286 $parameters = array();
287 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
288 $sql .= $hookmanager->resPrint;
289 if ($object->ismultientitymanaged == 1) {
290 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
292 $sql .=
" WHERE 1 = 1";
294 if (!empty($projectstatic->id)) {
295 $sql .=
" AND t.fk_project=".((int) $projectstatic->id);
297 foreach ($search as $key => $val) {
298 if (array_key_exists($key, $object->fields)) {
299 if ($key ==
'status' && $search[$key] == -1) {
302 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
303 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
304 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
309 if ($search[$key] !=
'') {
310 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
313 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
314 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
315 if (preg_match(
'/^(date|timestamp|datetime)/', $object->fields[$columnName][
'type'])) {
316 if (preg_match(
'/_dtstart$/', $key)) {
317 $sql .=
" AND t.".$columnName.
" >= '".$db->idate($search[$key]).
"'";
319 if (preg_match(
'/_dtend$/', $key)) {
320 $sql .=
" AND t." . $columnName .
" <= '" . $db->idate($search[$key]) .
"'";
327 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
331 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
333 $parameters = array();
334 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
335 $sql .= $hookmanager->resPrint;
338 $sql .= $db->order($sortfield, $sortorder);
341 $nbtotalofrecords =
'';
342 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
343 $resql = $db->query($sql);
344 $nbtotalofrecords = $db->num_rows(
$resql);
345 if (($page * $limit) > $nbtotalofrecords) {
351 if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
352 $num = $nbtotalofrecords;
355 $sql .= $db->plimit($limit + 1, $offset);
358 $resql = $db->query($sql);
364 $num = $db->num_rows(
$resql);
368 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
369 $obj = $db->fetch_object(
$resql);
371 header(
"Location: ".
dol_buildpath(
'/eventorganization/conferenceorboothattendee_card.php', 1).
'?id='.$id);
377 llxHeader(
'', $title,
$help_url,
'', 0, 0, $morejs, $morecss,
'',
'classforhorizontalscrolloftabs');
381 if ($projectstatic->id > 0 || $confOrBooth > 0) {
382 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
383 $projectstatic->fetchComments();
385 if (!empty($projectstatic->socid)) {
386 $projectstatic->fetch_thirdparty();
390 $object->project = clone $projectstatic;
392 if (!empty($withproject)) {
394 $tab =
'eventorganisation';
395 $withProjectUrl =
"&withproject=1";
398 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'), 0,
'',
'');
400 $param = ($mode ==
'mine' ?
'&mode=mine' :
'');
404 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
406 $morehtmlref =
'<div class="refidno">';
408 $morehtmlref .= $projectstatic->title;
410 if ($projectstatic->thirdparty->id > 0) {
411 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$projectstatic->thirdparty->getNomUrl(1,
'project');
413 $morehtmlref .=
'</div>';
416 if (empty($user->rights->projet->all->lire)) {
417 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
418 $projectstatic->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
421 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
423 print
'<div class="fichecenter">';
424 print
'<div class="fichehalfleft">';
425 print
'<div class="underbanner clearboth"></div>';
427 print
'<table class="border tableforfield centpercent">';
430 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
431 print
'<tr><td class="tdtop">';
432 print $langs->trans(
"Usage");
435 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
436 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
437 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
438 print
$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
441 if (empty($conf->global->PROJECT_HIDE_TASKS)) {
442 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
443 $htmltext = $langs->trans(
"ProjectFollowTasks");
444 print
$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
447 if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
448 print
'<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_bill_time ?
' checked="checked"' :
'')).
'"> ';
449 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
450 print
$form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
453 if (!empty($conf->eventorganization->enabled)) {
454 print
'<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_organize_event ?
' checked="checked"' :
'')).
'"> ';
455 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
456 print
$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
462 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
463 if ($projectstatic->public == 0) {
464 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
465 print $langs->trans(
"PrivateProject");
467 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
468 print $langs->trans(
"SharedProject");
473 print
'<tr><td>'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"DateEnd").
'</td><td>';
475 print ($start ? $start :
'?');
478 print ($end ? $end :
'?');
479 if ($projectstatic->hasDelay()) {
485 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
486 if (strcmp($projectstatic->budget_amount,
'')) {
487 print
price($projectstatic->budget_amount,
'', $langs, 1, 0, 0, $conf->currency);
493 $objectconf = $object;
494 $object = $projectstatic;
495 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
496 $object = $objectconf;
502 print
'<div class="fichehalfright">';
503 print
'<div class="underbanner clearboth"></div>';
505 print
'<table class="border tableforfield centpercent">';
508 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
509 print nl2br($projectstatic->description);
514 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
515 print
$form->showCategories($projectstatic->id,
'project', 1);
519 print
'<tr><td class="nowrap">';
520 $typeofdata =
'checkbox:'.($projectstatic->accept_conference_suggestions ?
' checked="checked"' :
'');
521 $htmltext = $langs->trans(
"AllowUnknownPeopleSuggestConfHelp");
522 print
$form->editfieldkey(
'AllowUnknownPeopleSuggestConf',
'accept_conference_suggestions',
'', $projectstatic, 0, $typeofdata,
'', 0, 0,
'projectid', $htmltext);
524 print
$form->editfieldval(
'AllowUnknownPeopleSuggestConf',
'accept_conference_suggestions',
'1', $projectstatic, 0, $typeofdata,
'', 0, 0,
'', 0,
'',
'projectid');
528 $typeofdata =
'checkbox:'.($projectstatic->accept_booth_suggestions ?
' checked="checked"' :
'');
529 $htmltext = $langs->trans(
"AllowUnknownPeopleSuggestBoothHelp");
530 print
$form->editfieldkey(
'AllowUnknownPeopleSuggestBooth',
'accept_booth_suggestions',
'', $projectstatic, 0, $typeofdata,
'', 0, 0,
'projectid', $htmltext);
532 print
$form->editfieldval(
'AllowUnknownPeopleSuggestBooth',
'accept_booth_suggestions',
'1', $projectstatic, 0, $typeofdata,
'', 0, 0,
'', 0,
'',
'projectid');
536 print
$form->editfieldkey(
$form->textwithpicto($langs->trans(
'PriceOfBooth'), $langs->trans(
"PriceOfBoothHelp")),
'price_booth',
'', $projectstatic, 0,
'amount',
'', 0, 0,
'projectid');
538 print
$form->editfieldval(
$form->textwithpicto($langs->trans(
'PriceOfBooth'), $langs->trans(
"PriceOfBoothHelp")),
'price_booth', $projectstatic->price_booth, $projectstatic, 0,
'amount',
'', 0, 0,
'', 0,
'',
'projectid');
542 print
$form->editfieldkey(
$form->textwithpicto($langs->trans(
'PriceOfRegistration'), $langs->trans(
"PriceOfRegistrationHelp")),
'price_registration',
'', $projectstatic, 0,
'amount',
'', 0, 0,
'projectid');
544 print
$form->editfieldval(
$form->textwithpicto($langs->trans(
'PriceOfRegistration'), $langs->trans(
"PriceOfRegistrationHelp")),
'price_registration', $projectstatic->price_registration, $projectstatic, 0,
'amount',
'', 0, 0,
'', 0,
'',
'projectid');
547 print
'<tr><td class="titlefield">';
548 print
$form->editfieldkey(
$form->textwithpicto($langs->trans(
'MaxNbOfAttendees'),
''),
'max_attendees',
'', $projectstatic, $permissiontoadd,
'integer:3',
'&withproject=1', 0, 0,
'projectid');
549 print
'</td><td class="valuefield">';
550 print
$form->editfieldval(
$form->textwithpicto($langs->trans(
'MaxNbOfAttendees'),
''),
'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd,
'integer:3',
'', 0, 0,
'&withproject=1', 0,
'',
'projectid');
553 print
'<tr><td valign="middle">'.$langs->trans(
"EventOrganizationICSLink").
'</td><td>';
555 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
556 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
559 $message =
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ?
"&entity=".$conf->entity :
"");
560 $message .=
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...');
561 $message .=
"&project=".$projectstatic->id.
'&module='.urlencode(
'@eventorganization').
'&status='.ConferenceOrBooth::STATUS_CONFIRMED.
'">'.$langs->trans(
'DownloadICSLink').img_picto(
'',
'download',
'class="paddingleft"').
'</a>';
568 print
$form->textwithpicto($langs->trans(
"SuggestOrVoteForConfOrBooth"), $langs->trans(
"EvntOrgRegistrationHelpMessage"));
571 $linksuggest = $dolibarr_main_url_root.
'/public/project/index.php?id='.$projectstatic->id;
572 $encodedsecurekey =
dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.
'conferenceorbooth'.$projectstatic->id,
'md5');
573 $linksuggest .=
'&securekey='.urlencode($encodedsecurekey);
576 print
'<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.
'" class="quatrevingtpercent">'.$linksuggest.
'</a></div>';
577 print
'<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.
'">'.
img_picto(
'',
'globe').
'</a>';
585 print $langs->trans(
"PublicAttendeeSubscriptionGlobalPage");
588 $link_subscription = $dolibarr_main_url_root.
'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.
'&type=global';
589 $encodedsecurekey =
dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.
'conferenceorbooth'.$projectstatic->id,
'md5');
590 $link_subscription .=
'&securekey='.urlencode($encodedsecurekey);
593 print
'<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.
'" class="quatrevingtpercent">'.$link_subscription.
'</a></div>';
594 print
'<a target="_blank" rel="noopener noreferrer" href="'.$link_subscription.
'">'.
img_picto(
'',
'globe').
'</a>';
604 print
'<div class="clearboth"></div>';
608 if (empty($confOrBooth->id)) {
611 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($project->public ?
'projectpub' :
'project'), 0,
'',
'reposition');
615 if ($confOrBooth->id > 0) {
618 print
dol_get_fiche_head($head,
'attendees', $langs->trans(
"ConferenceOrBooth"), -1, $object->picto);
620 $object_evt = $object;
621 $object = $confOrBooth;
625 print
'<div class="fichecenter">';
626 print
'<div class="fichehalfleft">';
627 print
'<div class="underbanner clearboth"></div>';
628 print
'<table class="border centpercent tableforfield">' .
"\n";
630 include DOL_DOCUMENT_ROOT .
'/core/tpl/commonfields_view.tpl.php';
633 include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_view.tpl.php';
634 $object = $object_evt;
639 print
'<div class="clearboth"></div>';
645 $arrayofselected = is_array($toselect) ? $toselect : array();
648 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
649 $param .=
'&contextpage='.urlencode($contextpage);
651 if ($limit > 0 && $limit != $conf->liste_limit) {
652 $param .=
'&limit='.urlencode($limit);
654 foreach ($search as $key => $val) {
655 if (is_array($search[$key]) && count($search[$key])) {
656 foreach ($search[$key] as $skey) {
658 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
661 } elseif ($search[$key] !=
'') {
662 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
665 if ($confOrBooth->id > 0) {
666 $param .=
'&conforboothid='.urlencode($confOrBooth->id);
668 if ($projectstatic->id > 0) {
669 $param .=
'&fk_project='.urlencode($projectstatic->id);
671 $param .= $withProjectUrl;
672 if ($optioncss !=
'') {
673 $param .=
'&optioncss='.urlencode($optioncss);
677 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
679 $parameters = array();
680 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
681 $param .= $hookmanager->resPrint;
684 $arrayofmassactions = array(
688 'presend'=>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
690 if ($permissiontodelete) {
691 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
693 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
694 $arrayofmassactions = array();
696 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
698 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].(!empty($conf_or_booth_id)?
'?conforboothid='.$conf_or_booth_id:
'').
'">'.
"\n";
699 if ($optioncss !=
'') {
700 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
702 print
'<input type="hidden" name="token" value="'.newToken().
'">';
703 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
704 print
'<input type="hidden" name="action" value="list">';
705 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
706 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
707 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
708 print
'<input type="hidden" name="withproject" value="'.$withproject.
'">';
709 print
'<input type="hidden" name="fk_project" value="'.$fk_project.
'">';
710 print
'<input type="hidden" name="page_y" value="">';
712 $params = array(
'morecss'=>
'reposition');
713 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?
'&conforboothid='.$confOrBooth->id:
'').(!empty($projectstatic->id)?
'&fk_project='.$projectstatic->id:
'').$withProjectUrl.
'&backtopage='.urlencode($_SERVER[
'PHP_SELF'].
'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ?
'' :
'&conforboothid='.$confOrBooth->id).$withProjectUrl),
'', $permissiontoadd, $params);
715 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
719 $topicmail = $projectstatic->title;
720 $modelmail =
"conferenceorbooth";
722 $trackid =
'conferenceorbooth_'.$object->id;
723 $withmaindocfilemail = 0;
724 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
728 foreach ($fieldstosearchall as $key => $val) {
729 $fieldstosearchall[$key] = $langs->trans($val);
731 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
739 $parameters = array();
740 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
741 if (empty($reshook)) {
742 $moreforfilter .= $hookmanager->resPrint;
744 $moreforfilter = $hookmanager->resPrint;
747 if (!empty($moreforfilter)) {
748 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
749 print $moreforfilter;
753 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
754 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
755 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
757 print
'<div class="div-table-responsive">';
758 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
763 print
'<tr class="liste_titre">';
764 foreach ($object->fields as $key => $val) {
765 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
766 if ($key ==
'status') {
767 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
768 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
769 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
770 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
771 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
772 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'ref')) && $val[
'label'] !=
'TechnicalID') {
773 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
775 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
776 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
777 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
778 print
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
779 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:')=== 0)) {
780 print $object->showInputField($val, $key, $search[$key],
'',
'',
'search_',
'maxwidth125', 1);
781 } elseif (!preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
782 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag($search[$key]).
'">';
783 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
784 print
'<div class="nowrap">';
785 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
787 print
'<div class="nowrap">';
788 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
795 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
798 $parameters = array(
'arrayfields'=>$arrayfields);
799 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
800 print $hookmanager->resPrint;
802 print
'<td class="liste_titre maxwidthsearch">';
803 $searchpicto =
$form->showFilterButtons();
811 print
'<tr class="liste_titre">';
812 foreach ($object->fields as $key => $val) {
813 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
814 if ($key ==
'status') {
815 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
816 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
817 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
818 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
819 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
820 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'ref')) && $val[
'label'] !=
'TechnicalID') {
821 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
823 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
824 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
828 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
830 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
831 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
832 print $hookmanager->resPrint;
834 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
839 $needToFetchEachLine = 0;
840 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
841 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
842 if (preg_match(
'/\$object/', $val)) {
843 $needToFetchEachLine++;
852 $totalarray = array();
853 while ($i < ($limit ? min($num, $limit) : $num)) {
854 $obj = $db->fetch_object(
$resql);
860 $object->setVarsFromFetchObj($obj);
863 print
'<tr class="oddeven">';
864 foreach ($object->fields as $key => $val) {
865 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
866 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
867 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
868 } elseif ($key ==
'status') {
869 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
872 if (in_array($val[
'type'], array(
'timestamp'))) {
873 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap left';
874 } elseif ($key ==
'ref') {
875 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
878 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'rowid',
'ref',
'status'))) {
879 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
883 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
884 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
885 if ($key ==
'status') {
886 print $object->getLibStatut(5);
887 } elseif ($key ==
'ref') {
888 $optionLink = (!empty($withproject)?
'conforboothidproject':
'conforboothid');
889 if (empty($confOrBooth->id)) {
890 $optionLink=
'projectid';
892 print $object->getNomUrl(1, $optionLink);
894 print $object->showOutputField($val, $key, $object->$key,
'');
898 $totalarray[
'nbfield']++;
900 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
902 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
904 if (!isset($totalarray[
'val'])) {
905 $totalarray[
'val'] = array();
907 if (!isset($totalarray[
'val'][
't.'.$key])) {
908 $totalarray[
'val'][
't.'.$key] = 0;
910 $totalarray[
'val'][
't.'.$key] += $object->$key;
915 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
917 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
918 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
919 print $hookmanager->resPrint;
921 print
'<td class="nowrap center">';
922 if ($massactionbutton || $massaction) {
924 if (in_array($object->id, $arrayofselected)) {
927 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
931 $totalarray[
'nbfield']++;
940 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
945 foreach ($arrayfields as $key => $val) {
946 if (!empty($val[
'checked'])) {
950 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
956 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
957 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
958 print $hookmanager->resPrint;
960 print
'</table>'.
"\n";
963 print
'</form>'.
"\n";
965 if (in_array(
'builddoc', $arrayofmassactions) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
966 $hidegeneratedfilelistifempty = 1;
967 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
968 $hidegeneratedfilelistifempty = 0;
971 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
975 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
976 $urlsource .= str_replace(
'&',
'&', $param);
978 $filedir = $diroutputmassaction;
979 $genallowed = $permissiontoread;
980 $delallowed = $permissiontoadd;
982 print $formfile->showdocuments(
'massfilesarea_eventorganization',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);