27 require
'../main.inc.php';
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';
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';
39 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
41 global $dolibarr_main_url_root;
47 $langs->loadLangs(array(
"eventorganization",
"other",
"projects",
"companies"));
50 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
51 $massaction =
GETPOST(
'massaction',
'alpha');
52 $show_files =
GETPOST(
'show_files',
'int');
53 $confirm =
GETPOST(
'confirm',
'alpha');
54 $cancel =
GETPOST(
'cancel',
'alpha');
55 $toselect =
GETPOST(
'toselect',
'array');
56 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'conferenceorboothlist';
57 $backtopage =
GETPOST(
'backtopage',
'alpha');
58 $optioncss =
GETPOST(
'optioncss',
'aZ');
61 $projectid =
GETPOST(
'projectid',
'int');
65 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
66 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
72 $offset = $limit * $page;
73 $pageprev = $page - 1;
74 $pagenext = $page + 1;
79 $diroutputmassaction = $conf->eventorganization->dir_output.
'/temp/massgeneration/'.$user->id;
80 $hookmanager->initHooks(array(
'conferenceorboothlist'));
83 $extrafields->fetch_name_optionals_label($object->table_element);
86 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
90 reset($object->fields);
91 $sortfield =
"t.".key($object->fields);
98 $search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
100 foreach ($object->fields as $key => $val) {
101 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
102 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
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'));
111 $fieldstosearchall = array();
112 foreach ($object->fields as $key => $val) {
113 if (!empty($val[
'searchall'])) {
114 $fieldstosearchall[
't.'.$key] = $val[
'label'];
119 $arrayfields = array();
120 foreach ($object->fields as $key => $val) {
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'] :
''
134 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
139 $permissiontoread = $user->rights->eventorganization->read;
140 $permissiontoadd = $user->rights->eventorganization->write;
141 $permissiontodelete = $user->rights->eventorganization->delete;
144 if (empty($conf->eventorganization->enabled)) {
148 if ($user->socid > 0) {
160 if (preg_match(
'/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) {
163 $project_attr=preg_replace(
'/^set/',
'', $action);
164 if (array_key_exists($project_attr, $project->fields)) {
165 $result = $project->fetch($projectid, $projectref);
169 $project->{$project_attr}=
GETPOST($project_attr);
170 $result=$project->update($user);
181 if (
GETPOST(
'cancel',
'alpha')) {
185 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend'
186 && $massaction !=
'presend_attendees'
187 && $massaction !=
'confirm_presend'
188 && $massaction !=
'confirm_presend_attendees') {
195 $parameters = array();
196 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
201 if (empty($reshook)) {
203 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
206 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
207 foreach ($object->fields as $key => $val) {
209 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
210 $search[$key.
'_dtstart'] =
'';
211 $search[$key.
'_dtend'] =
'';
215 $search_array_options = array();
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')) {
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';
238 $title = $langs->trans(
'ListOfConferencesOrBooths');
242 if ($projectid > 0 || $projectref) {
244 $result = $project->fetch($projectid, $projectref);
248 $projectid = $project->id;
250 $result = $project->fetch_thirdparty();
254 $result = $project->fetch_optionals();
259 $help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Mó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");
272 if ($projectid > 0) {
275 $userWrite = $project->restrictedProjectArea($user,
'write');
280 print
dol_get_fiche_head($head,
'eventorganisation', $langs->trans(
"ConferenceOrBoothTab"), -1, ($project->public ?
'projectpub' :
'project'));
283 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
285 $morehtmlref =
'<div class="refidno">';
287 $morehtmlref .= $project->title;
289 if (isset($project->thirdparty->id) && $project->thirdparty->id > 0) {
290 $morehtmlref .=
'<br>'.$project->thirdparty->getNomUrl(1,
'project');
292 $morehtmlref .=
'</div>';
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').
")";
300 dol_banner_tab($project,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
302 print
'<div class="fichecenter">';
303 print
'<div class="fichehalfleft">';
304 print
'<div class="underbanner clearboth"></div>';
306 print
'<table class="border tableforfield centpercent">';
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");
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);
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);
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);
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);
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");
346 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
347 print $langs->trans(
"SharedProject");
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>';
359 print
'<tr><td>'.$langs->trans(
"Dates").
' ('.$langs->trans(
"Project").
')</td><td>';
361 print ($start ? $start :
'?');
364 print ($end ? $end :
'?');
365 if ($object->hasDelay()) {
371 print
'<tr><td>'.$langs->trans(
"Dates").
' ('.$langs->trans(
"Event").
')</td><td>';
373 print ($start ? $start :
'?');
376 print ($end ? $end :
'?');
377 if ($object->hasDelay()) {
383 print
'<tr><td>'.$langs->trans(
"Location").
'</td><td>';
384 print $project->location;
389 $objectconf = $object;
391 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
392 $object = $objectconf;
397 print
'<div class="fichehalfright">';
398 print
'<div class="underbanner clearboth"></div>';
400 print
'<table class="border tableforfield centpercent">';
403 print
'<tr><td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td class="valuefield">';
404 print nl2br($project->description);
409 print
'<tr><td class="titlefield valignmiddle">'.$langs->trans(
"Categories").
'</td><td class="valuefield">';
410 print
$form->showCategories($project->id, Categorie::TYPE_PROJECT, 1);
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');
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');
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');
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');
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');
448 print
'<tr><td class="titlefield valignmiddle">'.$langs->trans(
"EventOrganizationICSLink").
'</td><td class="valuefield">';
450 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
451 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
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>';
461 print
'<tr><td class="titlefield">';
463 print
$form->textwithpicto($langs->trans(
"SuggestOrVoteForConfOrBooth"), $langs->trans(
"EvntOrgRegistrationHelpMessage"));
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);
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>';
478 print
'<tr><td class="titlefield">';
480 print $langs->trans(
"PublicAttendeeSubscriptionGlobalPage");
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);
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>';
499 print
'<div class="clearboth"></div>';
504 if (!empty($project->id)) {
506 $tab =
'conferenceorbooth';
508 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($project->public ?
'projectpub' :
'project'), 0,
'',
'reposition');
514 $sql .= $object->getFieldList(
't');
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 :
'');
523 $parameters = array();
524 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
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)";
531 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"c_actioncomm as cact ON cact.id=t.fk_action AND cact.module LIKE '%@eventorganization'";
533 $parameters = array();
534 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
535 $sql .= $hookmanager->resPrint;
536 if ($object->ismultientitymanaged == 1) {
537 $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
539 $sql .=
" WHERE 1 = 1";
541 if ($projectid > 0) {
542 $sql .=
" AND t.fk_project = ".((int) $project->id);
544 foreach ($search as $key => $val) {
545 if (array_key_exists($key, $object->fields)) {
546 if ($key ==
'status' && $search[$key] == -1) {
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'])))) {
556 if ($search[$key] !=
'') {
557 $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
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]).
"'";
566 if (preg_match(
'/_dtend$/', $key)) {
567 $sql .=
" AND t." . $columnName .
" <= '" . $db->idate($search[$key]) .
"'";
575 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
579 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
581 $parameters = array();
582 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
583 $sql .= $hookmanager->resPrint;
585 $sql .= $db->order($sortfield, $sortorder);
589 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
590 $resql = $db->query($sql);
602 $sql .= $db->plimit($limit + 1, $offset);
605 $resql = $db->query($sql);
611 $num = $db->num_rows(
$resql);
615 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
616 $obj = $db->fetch_object(
$resql);
618 header(
"Location: ".DOL_URL_ROOT.
'/eventorganization/conferenceorbooth_card.php?id='.((
int) $id));
622 $arrayofselected = is_array($toselect) ? $toselect : array();
625 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
626 $param .=
'&contextpage='.urlencode($contextpage);
628 if ($limit > 0 && $limit != $conf->liste_limit) {
629 $param .=
'&limit='.urlencode($limit);
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);
637 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
640 if ($optioncss !=
'') {
641 $param .=
'&optioncss='.urlencode($optioncss);
644 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
646 $parameters = array();
647 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
648 $param .= $hookmanager->resPrint;
651 $arrayofmassactions = array(
655 'presend'=>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail").
' ('.$langs->trans(
"ToSpeakers").
')',
658 if ($permissiontodelete) {
659 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
661 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
662 $arrayofmassactions = array();
664 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
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.
'">';
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="">';
678 $title = $langs->trans(
"EventOrganizationConfOrBoothes");
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);
682 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords, $object->picto, 0, $newcardbutton,
'', $limit, 0, 0, 1);
686 $topicmail = $projectstatic->title;
687 $modelmail =
"conferenceorbooth";
689 $trackid =
'conferenceorbooth_'.$object->id;
690 $withmaindocfilemail = 0;
691 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
695 foreach ($fieldstosearchall as $key => $val) {
696 $fieldstosearchall[$key] = $langs->trans($val);
698 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
706 $parameters = array();
707 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
708 if (empty($reshook)) {
709 $moreforfilter .= $hookmanager->resPrint;
711 $moreforfilter = $hookmanager->resPrint;
714 if (!empty($moreforfilter)) {
715 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
716 print $moreforfilter;
720 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
721 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
722 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
725 print
'<div class="div-table-responsive">';
726 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
731 print
'<tr class="liste_titre">';
732 foreach ($object->fields as $key => $val) {
733 $searchkey = (empty($search[$key]) ?
'' : $search[$key]);
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';
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'));
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'));
765 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
768 $parameters = array(
'arrayfields'=>$arrayfields);
769 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
770 print $hookmanager->resPrint;
772 print
'<td class="liste_titre maxwidthsearch">';
773 $searchpicto =
$form->showFilterButtons();
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';
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";
798 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
800 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
801 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
802 print $hookmanager->resPrint;
804 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
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++;
822 $totalarray = array();
823 while ($i < ($limit ? min($num, $limit) : $num)) {
824 $obj = $db->fetch_object(
$resql);
830 $object->setVarsFromFetchObj($obj);
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';
843 if (in_array($val[
'type'], array(
'timestamp'))) {
844 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
845 } elseif ($key ==
'ref') {
846 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap left';
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';
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':
''));
861 print $object->showOutputField($val, $key, $object->$key,
'');
865 $totalarray[
'nbfield']++;
867 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
869 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
871 if (!isset($totalarray[
'val'])) {
872 $totalarray[
'val'] = array();
874 if (!isset($totalarray[
'val'][
't.'.$key])) {
875 $totalarray[
'val'][
't.'.$key] = 0;
877 $totalarray[
'val'][
't.'.$key] += $object->$key;
882 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
884 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
885 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
886 print $hookmanager->resPrint;
888 print
'<td class="nowrap center">';
889 if ($massactionbutton || $massaction) {
891 if (in_array($object->id, $arrayofselected)) {
894 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
898 $totalarray[
'nbfield']++;
907 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
912 foreach ($arrayfields as $key => $val) {
913 if (!empty($val[
'checked'])) {
917 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
923 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
924 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
925 print $hookmanager->resPrint;
927 print
'</table>'.
"\n";
930 print
'</form>'.
"\n";
933 $hidegeneratedfilelistifempty = 1;
934 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
935 $hidegeneratedfilelistifempty = 0;
938 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
942 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
943 $urlsource .= str_replace(
'&',
'&', $param);
945 $filedir = $diroutputmassaction;
946 $genallowed = $permissiontoread;
947 $delallowed = $permissiontoadd;
949 print $formfile->showdocuments(
'massfilesarea_eventorganization',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
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.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class for ConferenceOrBooth.
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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
dol_hash($chain, $type='0')
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.