diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 7b012a42d8e..57cf6baba78 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -30,6 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array("eventorganization", "other")); @@ -46,10 +48,12 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); $conf_or_booth_id = GETPOST('conforboothid', 'int'); +$withproject = GETPOST('withproject', 'int'); // Initialize technical objects $object = new ConferenceOrBoothAttendee($db); $extrafields = new ExtraFields($db); +$projectstatic = new Project($db); $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array @@ -166,11 +170,189 @@ $title = $langs->trans("ConferenceOrBoothAttendee"); $help_url = ''; llxHeader('', $title, $help_url); +$result = $projectstatic->fetch($confOrBooth->fk_project); +if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { + $projectstatic->fetchComments(); +} +if (!empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); +} + +$withProjectUrl=''; +$object->project = clone $projectstatic; + +if (!empty($withproject)) { + // Tabs for project + $tab = 'eventorganisation'; + $withProjectUrl="&withproject=1"; + $head = project_prepare_head($projectstatic); + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); + + $param = ($mode == 'mine' ? '&mode=mine' : ''); + + // Project card + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + // Title + $morehtmlref .= $projectstatic->title; + // Thirdparty + if ($projectstatic->thirdparty->id > 0) { + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref .= '
'; + + // Define a complementary filter for search of next/prev ref. + if (!$user->rights->projet->all->lire) { + $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); + $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")"; + } + + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
'; + print '
'; + print '
'; + + print ''; + + // Usage + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print ''; + print ''; + } + + // Visibility + print ''; + + // Date start - end + print ''; + + // Budget + print ''; + + // Other attributes + $cols = 2; + //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; + if ($projectstatic->public) { + print $langs->trans('SharedProject'); + } else { + print $langs->trans('PrivateProject'); + } + print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + $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()) { + print img_warning("Late"); + } + print '
'.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print '
'; + + print '
'; + + print '
'; + print '
'; + print '
'; + + print ''; + + // Description + print ''; + + // Categories + if ($conf->categorie->enabled) { + print '"; + } + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '
'.$langs->trans("Description").''; + print nl2br($projectstatic->description); + print '
'.$langs->trans("Categories").''; + print $form->showCategories($projectstatic->id, 'project', 1); + print "
'; + $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 ''; + print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid'); + print "
'; + $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 ''; + print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid'); + print "
'; + print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print ''; + print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print "
'; + print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print ''; + print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print "
'.$langs->trans("EventOrganizationICSLink").''; + print ''; + print "
'; + + print '
'; + print '
'; + print '
'; + + print '
'; + + print dol_get_fiche_end(); + + print '
'; +} + // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto); - print '
'; + print ''; print ''; if ($confOrBooth->id > 0) { diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 5ddd2cd163b..f4b7d8226d0 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -44,8 +44,6 @@ $objectref = GETPOST("taskref", 'alpha'); // task ref $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $withproject = GETPOST('withproject', 'int'); -$project_ref = GETPOST('project_ref', 'alpha'); -$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : ''); // Security check $socid = 0;