29require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/eventorganization/class/conferenceorbooth.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
49$langs->loadLangs(array(
'companies',
'eventorganization',
'mails',
'others',
'projects'));
57$action =
GETPOST(
'action',
'aZ09');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$cancel =
GETPOST(
'cancel',
'aZ09');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'conferenceorboothcard';
61$backtopage =
GETPOST(
'backtopage',
'alpha');
62$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
70$projectstatic =
new Project($db);
71$diroutputmassaction =
$conf->eventorganization->dir_output.
'/temp/massgeneration/'.$user->id;
72$hookmanager->initHooks(array(
'conferenceorboothcontact',
'globalcard'));
75$extrafields->fetch_name_optionals_label(
$object->table_element);
77$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
80include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
83if ($user->socid > 0) {
87$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
88$result =
restrictedArea($user,
'eventorganization',
$object->id,
'',
'',
'fk_soc',
'rowid', $isdraft);
90$permissiontoread = $user->hasRight(
'eventorganization',
'read');
91$permissiontoadd = $user->hasRight(
'eventorganization',
'write');
92$permissiontodelete = $user->hasRight(
'eventorganization',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
93$permissionnote = $user->hasRight(
'eventorganization',
'write');
94$permissiondellink = $user->hasRight(
'eventorganization',
'write');
95$upload_dir =
$conf->eventorganization->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
98if ($user->socid > 0) {
101$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
102$result =
restrictedArea($user,
'eventorganization',
$object->id,
'',
'',
'fk_soc',
'rowid', $isdraft);
104if (!$permissiontoread) {
113$parameters = array();
114$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
119if ($action ==
'addcontact' && $permission) {
122 $result =
$object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
125 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".((
int)
$object->id).(!empty($withproject) ?
'&withproject=1' :
''));
128 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
129 $langs->load(
"errors");
130 setEventMessages($langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType"),
null,
'errors');
135} elseif ($action ==
'swapstatut' && $permission) {
138} elseif ($action ==
'deletecontact' && $permission) {
140 $result =
$object->delete_contact($lineid);
143 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".((
int)
$object->id).(!empty($withproject) ?
'&withproject=1' :
''));
155$form =
new Form($db);
157$contactstatic =
new Contact($db);
158$userstatic =
new User($db);
160$title = $langs->trans(
'ConferenceOrBooth').
" - ".$langs->trans(
'ContactsAddresses');
161$help_url=
'EN:Module_Event_Organization';
163llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-eventorganization page-card_contact');
172$result = $projectstatic->fetch(
$object->fk_project);
173if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
174 $projectstatic->fetchComments();
176if (!empty($projectstatic->socid)) {
177 $projectstatic->fetch_thirdparty();
180$object->project = clone $projectstatic;
182if (!empty($withproject)) {
184 $tab =
'eventorganisation';
185 $withProjectUrl =
"&withproject=1";
187 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'), 0,
'',
'');
189 $param = ($mode ==
'mine' ?
'&mode=mine' :
'');
193 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
195 $morehtmlref =
'<div class="refidno">';
197 $morehtmlref .= $projectstatic->title;
199 if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
200 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
202 $morehtmlref .=
'</div>';
205 if (!$user->hasRight(
'project',
'all',
'lire')) {
206 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
207 $projectstatic->next_prev_filter =
"rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0').
")";
210 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
212 print
'<div class="fichecenter">';
213 print
'<div class="fichehalfleft">';
214 print
'<div class="underbanner clearboth"></div>';
216 print
'<table class="border tableforfield centpercent">';
220 print
'<tr><td class="tdtop">';
221 print $langs->trans(
"Usage");
225 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
226 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
227 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
231 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
232 $htmltext = $langs->trans(
"ProjectFollowTasks");
233 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
237 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"' :
'')).
'"> ';
238 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
239 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
242 if (isModEnabled(
'eventorganization')) {
243 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"' :
'')).
'"> ';
244 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
245 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
251 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
252 if ($projectstatic->public) {
253 print $langs->trans(
'SharedProject');
255 print $langs->trans(
'PrivateProject');
260 print
'<tr><td>'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"DateEnd").
'</td><td>';
262 print($start ? $start :
'?');
265 print($end ? $end :
'?');
266 if ($projectstatic->hasDelay()) {
272 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
273 if (strcmp($projectstatic->budget_amount,
'')) {
274 print
price($projectstatic->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency);
282 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
289 print
'<div class="fichehalfright">';
290 print
'<div class="underbanner clearboth"></div>';
292 print
'<table class="border tableforfield centpercent">';
295 print
'<td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
296 print nl2br($projectstatic->description);
300 if (isModEnabled(
'category')) {
301 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
302 print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
307 $typeofdata =
'checkbox:'.($projectstatic->accept_conference_suggestions ?
' checked="checked"' :
'');
308 $htmltext = $langs->trans(
"AllowUnknownPeopleSuggestConfHelp");
309 print $form->editfieldkey(
'AllowUnknownPeopleSuggestConf',
'accept_conference_suggestions',
'', $projectstatic, 0, $typeofdata,
'', 0, 0,
'projectid', $htmltext);
311 print $form->editfieldval(
'AllowUnknownPeopleSuggestConf',
'accept_conference_suggestions',
'1', $projectstatic, 0, $typeofdata,
'',
null, 0,
'', 0,
'',
'projectid');
315 $typeofdata =
'checkbox:'.($projectstatic->accept_booth_suggestions ?
' checked="checked"' :
'');
316 $htmltext = $langs->trans(
"AllowUnknownPeopleSuggestBoothHelp");
317 print $form->editfieldkey(
'AllowUnknownPeopleSuggestBooth',
'accept_booth_suggestions',
'', $projectstatic, 0, $typeofdata,
'', 0, 0,
'projectid', $htmltext);
319 print $form->editfieldval(
'AllowUnknownPeopleSuggestBooth',
'accept_booth_suggestions',
'1', $projectstatic, 0, $typeofdata,
'',
null, 0,
'', 0,
'',
'projectid');
323 print $form->editfieldkey($form->textwithpicto($langs->trans(
'PriceOfBooth'), $langs->trans(
"PriceOfBoothHelp")),
'price_booth',
'', $projectstatic, 0,
'amount',
'', 0, 0,
'projectid');
325 print $form->editfieldval($form->textwithpicto($langs->trans(
'PriceOfBooth'), $langs->trans(
"PriceOfBoothHelp")),
'price_booth', $projectstatic->price_booth, $projectstatic, 0,
'amount',
'',
null, 0,
'', 0,
'',
'projectid');
329 print $form->editfieldkey($form->textwithpicto($langs->trans(
'PriceOfRegistration'), $langs->trans(
"PriceOfRegistrationHelp")),
'price_registration',
'', $projectstatic, 0,
'amount',
'', 0, 0,
'projectid');
331 print $form->editfieldval($form->textwithpicto($langs->trans(
'PriceOfRegistration'), $langs->trans(
"PriceOfRegistrationHelp")),
'price_registration', $projectstatic->price_registration, $projectstatic, 0,
'amount',
'',
null, 0,
'', 0,
'',
'projectid');
334 print
'<tr><td valign="middle">'.$langs->trans(
"EventOrganizationICSLink").
'</td><td>';
336 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
337 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
340 $message =
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=ical'.(
$conf->entity > 1 ?
"&entity=".$conf->entity :
"");
341 $message .=
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_AGENDA_XCAL_EXPORTKEY',
'...'));
342 $message .=
"&project=".$projectstatic->id.
'&module='.urlencode(
'@eventorganization').
'&status='.ConferenceOrBooth::STATUS_CONFIRMED.
'">'.$langs->trans(
'DownloadICSLink').img_picto(
'',
'download',
'class="paddingleft"').
'</a>';
349 print $form->textwithpicto($langs->trans(
"SuggestOrVoteForConfOrBooth"), $langs->trans(
"EvntOrgRegistrationHelpMessage"));
352 $linksuggest = $dolibarr_main_url_root.
'/public/project/index.php?id='.((int) $projectstatic->id);
353 $encodedsecurekey =
dol_hash(
getDolGlobalString(
'EVENTORGANIZATION_SECUREKEY').
'conferenceorbooth'.((
int) $projectstatic->id),
'md5');
354 $linksuggest .=
'&securekey='.urlencode($encodedsecurekey);
357 print
'<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.
'" class="quatrevingtpercent">'.$linksuggest.
'</a></div>';
358 print
'<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.
'">'.
img_picto(
'',
'globe').
'</a>';
366 print $langs->trans(
"PublicAttendeeSubscriptionGlobalPage");
369 $link_subscription = $dolibarr_main_url_root.
'/public/eventorganization/attendee_new.php?id='.((int) $projectstatic->id).
'&type=global';
370 $encodedsecurekey =
dol_hash(
getDolGlobalString(
'EVENTORGANIZATION_SECUREKEY').
'conferenceorbooth'.((
int) $projectstatic->id),
'md5');
371 $link_subscription .=
'&securekey='.urlencode($encodedsecurekey);
374 print
'<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.
'" class="quatrevingtpercent">'.$link_subscription.
'</a></div>';
375 print
'<a target="_blank" rel="noopener noreferrer" rel="noopener noreferrer" href="'.$link_subscription.
'">'.
img_picto(
'',
'globe').
'</a>';
385 print
'<div class="clearboth"></div>';
400 $linkback =
'<a href="'.dol_buildpath(
'/eventorganization/conferenceorbooth_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
402 $morehtmlref =
'<div class="refidno">';
440 $morehtmlref .=
'</div>';
442 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
449 $dirtpls = array_merge(
$conf->modules_parts[
'tpl'], array(
'/core/tpl'));
450 foreach ($dirtpls as $reldir) {
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class for ConferenceOrBooth.
Class to manage projects.
Class to manage Dolibarr users.
conferenceorboothPrepareHead($object, $with_project=0)
Prepare array of tabs for ConferenceOrBooth.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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', $nosalt=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.