|
@@ -46,18 +46,19 @@ $cancel = GETPOST('cancel', 'aZ09');
|
|
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothcard'; // To manage different context of search
|
|
|
$backtopage = GETPOST('backtopage', 'alpha');
|
|
|
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
|
|
+$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
|
|
+$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
|
|
|
|
|
|
$id = GETPOST('id', 'int');
|
|
|
$ref = GETPOST('ref', 'alpha');
|
|
|
$withproject = GETPOST('withproject', 'int');
|
|
|
-$mode = GETPOST('mode', 'alpha');
|
|
|
|
|
|
// Initialize technical objects
|
|
|
$object = new ConferenceOrBooth($db);
|
|
|
$extrafields = new ExtraFields($db);
|
|
|
$projectstatic = new Project($db);
|
|
|
$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
|
|
|
-$hookmanager->initHooks(array('conferenceorboothcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
|
|
+$hookmanager->initHooks(array($contextpage, 'globalcard')); // Note that conf->hooks_modules contains array
|
|
|
|
|
|
// Fetch optionals attributes and labels
|
|
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
|
@@ -68,9 +69,13 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|
|
$search_all = GETPOST("search_all", 'alpha');
|
|
|
$search = array();
|
|
|
foreach ($object->fields as $key => $val) {
|
|
|
- if (GETPOST('search_'.$key, 'alpha')) {
|
|
|
+ if (GETPOST('search_'.$key, 'alpha') !== '') {
|
|
|
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
|
|
}
|
|
|
+ if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
|
|
+ $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
|
|
|
+ $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (empty($action) && empty($id) && empty($ref)) {
|
|
@@ -93,7 +98,7 @@ if ($user->socid > 0) {
|
|
|
accessforbidden();
|
|
|
}
|
|
|
$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
|
|
|
-$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
|
|
+$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'id', $isdraft);
|
|
|
|
|
|
if (!$permissiontoread) {
|
|
|
accessforbidden();
|
|
@@ -256,32 +261,51 @@ if (!empty($withproject)) {
|
|
|
|
|
|
// Visibility
|
|
|
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
|
|
- if ($projectstatic->public) {
|
|
|
- print $langs->trans('SharedProject');
|
|
|
+ if ($projectstatic->public == 0) {
|
|
|
+ print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
|
|
+ print $langs->trans("PrivateProject");
|
|
|
} else {
|
|
|
- print $langs->trans('PrivateProject');
|
|
|
+ print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
|
|
+ print $langs->trans("SharedProject");
|
|
|
+ }
|
|
|
+ print '</td></tr>';
|
|
|
+
|
|
|
+ // Budget
|
|
|
+ print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
|
|
+ if (strcmp($projectstatic->budget_amount, '')) {
|
|
|
+ print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
|
|
|
}
|
|
|
print '</td></tr>';
|
|
|
|
|
|
- // Date start - end
|
|
|
- print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
|
|
|
+ // Date start - end project
|
|
|
+ print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Project").')</td><td>';
|
|
|
$start = dol_print_date($projectstatic->date_start, 'day');
|
|
|
print ($start ? $start : '?');
|
|
|
$end = dol_print_date($projectstatic->date_end, 'day');
|
|
|
print ' - ';
|
|
|
print ($end ? $end : '?');
|
|
|
- if ($projectstatic->hasDelay()) {
|
|
|
+ if ($object->hasDelay()) {
|
|
|
print img_warning("Late");
|
|
|
}
|
|
|
print '</td></tr>';
|
|
|
|
|
|
- // Budget
|
|
|
- print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
|
|
- if (strcmp($projectstatic->budget_amount, '')) {
|
|
|
- print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
|
|
+ // Date start - end of event
|
|
|
+ print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Event").')</td><td>';
|
|
|
+ $start = dol_print_date($projectstatic->date_start_event, 'day');
|
|
|
+ print ($start ? $start : '?');
|
|
|
+ $end = dol_print_date($projectstatic->date_end_event, 'day');
|
|
|
+ print ' - ';
|
|
|
+ print ($end ? $end : '?');
|
|
|
+ if ($object->hasDelay()) {
|
|
|
+ print img_warning("Late");
|
|
|
}
|
|
|
print '</td></tr>';
|
|
|
|
|
|
+ // Location event
|
|
|
+ print '<tr><td>'.$langs->trans("Location").'</td><td>';
|
|
|
+ print $projectstatic->location;
|
|
|
+ print '</td></tr>';
|
|
|
+
|
|
|
// Other attributes
|
|
|
$cols = 2;
|
|
|
$objectconf = $object;
|
|
@@ -299,46 +323,52 @@ if (!empty($withproject)) {
|
|
|
print '<table class="border tableforfield centpercent">';
|
|
|
|
|
|
// Description
|
|
|
- print '<td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
|
|
- print nl2br($projectstatic->description);
|
|
|
+ print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td class="valuefield">';
|
|
|
+ print dol_htmlentitiesbr($projectstatic->description);
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Categories
|
|
|
if (isModEnabled('categorie')) {
|
|
|
- print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
|
|
+ print '<tr><td class="titlefield valignmiddle">'.$langs->trans("Categories").'</td><td class="valuefield">';
|
|
|
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
|
|
|
print "</td></tr>";
|
|
|
}
|
|
|
|
|
|
- print '<tr><td>';
|
|
|
+ print '<tr><td class="titlefield nowrap">';
|
|
|
$typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
|
|
|
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
|
|
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
|
|
- print '</td><td>';
|
|
|
+ print '</td><td class="valuefield">';
|
|
|
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
|
|
print "</td></tr>";
|
|
|
|
|
|
- print '<tr><td>';
|
|
|
+ print '<tr><td class="valuefield">';
|
|
|
$typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : '');
|
|
|
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
|
|
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
|
|
- print '</td><td>';
|
|
|
+ print '</td><td class="valuefield">';
|
|
|
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
|
|
print "</td></tr>";
|
|
|
|
|
|
- print '<tr><td>';
|
|
|
+ print '<tr><td class="valuefield">';
|
|
|
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
|
|
- print '</td><td>';
|
|
|
+ print '</td><td class="valuefield">';
|
|
|
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
|
|
print "</td></tr>";
|
|
|
|
|
|
- print '<tr><td>';
|
|
|
+ print '<tr><td class="valuefield">';
|
|
|
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
|
|
- print '</td><td>';
|
|
|
+ print '</td><td class="valuefield">';
|
|
|
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
|
|
print "</td></tr>";
|
|
|
|
|
|
- print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
|
|
+ print '<tr><td class="titlefield">';
|
|
|
+ print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $project, $permissiontoadd, 'integer:3', '', 0, 0, 'projectid');
|
|
|
+ print '</td><td class="valuefield">';
|
|
|
+ print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $project->max_attendees, $project, $permissiontoadd, 'integer:3', '', 0, 0, '', 0, '', 'projectid');
|
|
|
+ print "</td></tr>";
|
|
|
+
|
|
|
+ print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
|
|
// Define $urlwithroot
|
|
|
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
|
|
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|