29require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/eventorganization/class/conferenceorbooth.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
54$langs->loadLangs(array(
"eventorganization",
"projects",
"companies",
"other",
"mails"));
57$action =
GETPOST(
'action',
'aZ09');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'conferenceorboothcard';
61$backtopage =
GETPOST(
'backtopage',
'alpha');
62$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
67$project_ref =
GETPOST(
'project_ref',
'alpha');
70$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
71$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
73if (empty($page) || $page == -1) {
76$offset = $limit * $page;
90$projectstatic =
new Project($db);
91$diroutputmassaction =
$conf->eventorganization->dir_output.
'/temp/massgeneration/'.$user->id;
92$hookmanager->initHooks(array(
'conferenceorboothdocument',
'globalcard'));
95$extrafields->fetch_name_optionals_label(
$object->table_element);
97$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
100include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
102$upload_dir =
$conf->eventorganization->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
103if ($id > 0 || !empty($ref)) {
108$permissiontoread = $user->hasRight(
'eventorganization',
'read');
109$permissiontoadd = $user->hasRight(
'eventorganization',
'write');
110$permissiontodelete = $user->hasRight(
'eventorganization',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
111$permissionnote = $user->hasRight(
'eventorganization',
'write');
112$permissiondellink = $user->hasRight(
'eventorganization',
'write');
115if ($user->socid > 0) {
118$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
121if (!$permissiontoread) {
130$parameters = array();
131$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
136include_once DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
143$form =
new Form($db);
145$title = $langs->trans(
"ConferenceOrBooth").
' - '.$langs->trans(
"Files");
146$help_url =
'EN:Module_Event_Organization';
148llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-eventorganization page-card_documents');
150$result = $projectstatic->fetch(
$object->fk_project);
151if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
152 $projectstatic->fetchComments();
154if (!empty($projectstatic->socid)) {
155 $projectstatic->fetch_thirdparty();
159$object->project = clone $projectstatic;
161if (!empty($withproject)) {
163 $tab =
'eventorganisation';
164 $withProjectUrl =
"&withproject=1";
166 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'), 0,
'',
'');
170 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
172 $morehtmlref =
'<div class="refidno">';
174 $morehtmlref .= $projectstatic->title;
176 if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
177 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
179 $morehtmlref .=
'</div>';
182 if (!$user->hasRight(
'project',
'all',
'lire')) {
183 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
184 $projectstatic->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
187 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
189 print
'<div class="fichecenter">';
190 print
'<div class="fichehalfleft">';
191 print
'<div class="underbanner clearboth"></div>';
193 print
'<table class="border tableforfield centpercent">';
197 print
'<tr><td class="tdtop">';
198 print $langs->trans(
"Usage");
202 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
203 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
204 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
208 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
209 $htmltext = $langs->trans(
"ProjectFollowTasks");
210 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
214 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"' :
'')).
'"> ';
215 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
216 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
219 if (isModEnabled(
'eventorganization')) {
220 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"' :
'')).
'"> ';
221 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
222 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
228 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
229 if ($projectstatic->public) {
230 print $langs->trans(
'SharedProject');
232 print $langs->trans(
'PrivateProject');
237 print
'<tr><td>'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"DateEnd").
'</td><td>';
239 print($start ? $start :
'?');
242 print($end ? $end :
'?');
243 if ($projectstatic->hasDelay()) {
249 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
250 if (strcmp($projectstatic->budget_amount,
'')) {
251 print
price($projectstatic->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency);
259 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
266 print
'<div class="fichehalfright">';
267 print
'<div class="underbanner clearboth"></div>';
269 print
'<table class="border tableforfield centpercent">';
272 print
'<td class="tdtop">'.$langs->trans(
"Description").
'</td><td>';
273 print nl2br($projectstatic->description);
277 if (isModEnabled(
'category')) {
278 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
279 print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
284 $typeofdata =
'checkbox:'.($projectstatic->accept_conference_suggestions ?
' checked="checked"' :
'');
285 $htmltext = $langs->trans(
"AllowUnknownPeopleSuggestConfHelp");
286 print $form->editfieldkey(
'AllowUnknownPeopleSuggestConf',
'accept_conference_suggestions',
'', $projectstatic, 0, $typeofdata,
'', 0, 0,
'projectid', $htmltext);
288 print $form->editfieldval(
'AllowUnknownPeopleSuggestConf',
'accept_conference_suggestions',
'1', $projectstatic, 0, $typeofdata,
'',
null,
null,
'', 0,
'',
'projectid');
292 $typeofdata =
'checkbox:'.($projectstatic->accept_booth_suggestions ?
' checked="checked"' :
'');
293 $htmltext = $langs->trans(
"AllowUnknownPeopleSuggestBoothHelp");
294 print $form->editfieldkey(
'AllowUnknownPeopleSuggestBooth',
'accept_booth_suggestions',
'', $projectstatic, 0, $typeofdata,
'', 0, 0,
'projectid', $htmltext);
296 print $form->editfieldval(
'AllowUnknownPeopleSuggestBooth',
'accept_booth_suggestions',
'1', $projectstatic, 0, $typeofdata,
'',
null,
null,
'', 0,
'',
'projectid');
300 print $form->editfieldkey($form->textwithpicto($langs->trans(
'PriceOfBooth'), $langs->trans(
"PriceOfBoothHelp")),
'price_booth',
'', $projectstatic, 0,
'amount',
'', 0, 0,
'projectid');
302 print $form->editfieldval($form->textwithpicto($langs->trans(
'PriceOfBooth'), $langs->trans(
"PriceOfBoothHelp")),
'price_booth', $projectstatic->price_booth, $projectstatic, 0,
'amount',
'',
null,
null,
'', 0,
'',
'projectid');
306 print $form->editfieldkey($form->textwithpicto($langs->trans(
'PriceOfRegistration'), $langs->trans(
"PriceOfRegistrationHelp")),
'price_registration',
'', $projectstatic, 0,
'amount',
'', 0, 0,
'projectid');
308 print $form->editfieldval($form->textwithpicto($langs->trans(
'PriceOfRegistration'), $langs->trans(
"PriceOfRegistrationHelp")),
'price_registration', $projectstatic->price_registration, $projectstatic, 0,
'amount',
'',
null,
null,
'', 0,
'',
'projectid');
311 print
'<tr><td valign="middle">'.$langs->trans(
"EventOrganizationICSLink").
'</td><td>';
314 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
317 $message =
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=ical'.(
$conf->entity > 1 ?
"&entity=".$conf->entity :
"");
318 $message .=
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_AGENDA_XCAL_EXPORTKEY',
'...'));
319 $message .=
"&project=".$projectstatic->id.
'&module='.urlencode(
'@eventorganization').
'&status='.ConferenceOrBooth::STATUS_CONFIRMED.
'">'.$langs->trans(
'DownloadICSLink').img_picto(
'',
'download',
'class="paddingleft"').
'</a>';
326 print $form->textwithpicto($langs->trans(
"SuggestOrVoteForConfOrBooth"), $langs->trans(
"EvntOrgRegistrationHelpMessage"));
330 $encodedsecurekey =
dol_hash(
getDolGlobalString(
'EVENTORGANIZATION_SECUREKEY').
'conferenceorbooth'.((
int) $projectstatic->id),
'md5');
331 $linksuggest .=
'&securekey='.urlencode($encodedsecurekey);
334 print
'<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.
'" class="quatrevingtpercent">'.$linksuggest.
'</a></div>';
335 print
'<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.
'">'.
img_picto(
'',
'globe').
'</a>';
343 print $langs->trans(
"PublicAttendeeSubscriptionGlobalPage");
346 $link_subscription =
$dolibarr_main_url_root.
'/public/eventorganization/attendee_new.php?id='.((int) $projectstatic->id).
'&type=global';
347 $encodedsecurekey =
dol_hash(
getDolGlobalString(
'EVENTORGANIZATION_SECUREKEY').
'conferenceorbooth'.((
int) $projectstatic->id),
'md5');
348 $link_subscription .=
'&securekey='.urlencode($encodedsecurekey);
351 print
'<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.
'" class="quatrevingtpercent">'.$link_subscription.
'</a></div>';
352 print
'<a target="_blank" rel="noopener noreferrer" rel="noopener noreferrer" href="'.$link_subscription.
'">'.
img_picto(
'',
'globe').
'</a>';
362 print
'<div class="clearboth"></div>';
379 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
381 foreach ($filearray as $key => $file) {
382 $totalsize += $file[
'size'];
387 $linkback =
'<a href="'.dol_buildpath(
'/eventorganization/conferenceorbooth_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
389 $morehtmlref =
'<div class="refidno">';
390 $morehtmlref .=
'</div>';
392 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
394 print
'<div class="fichecenter">';
396 print
'<div class="underbanner clearboth"></div>';
397 print
'<table class="border centpercent tableforfield">';
400 print
'<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td colspan="3">'.count($filearray).
'</td></tr>';
403 print
'<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td colspan="3">'.$totalsize.
' '.$langs->trans(
"bytes").
'</td></tr>';
411 $modulepart =
'eventorganization';
412 $param =
'&id='.$object->id;
415 $param .=
'&withproject=1';
418 $relativepathwithnofile =
'conferenceorbooth/'.dol_sanitizeFileName(
$object->ref).
'/';
420 include_once DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
global $dolibarr_main_url_root
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
conferenceorboothPrepareHead($object, $with_project=0)
Prepare array of tabs for ConferenceOrBooth.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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, $morecssdiv='')
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
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.
dol_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.