diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d3285869752..722f99d3b69 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -31,16 +31,17 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; * Prepare array with list of tabs * * @param Project $project Object related to tabs + * @param string $moreparam More param on url * @return array Array of tabs to show */ -function project_prepare_head(Project $project) +function project_prepare_head(Project $project, $moreparam = '') { global $db, $langs, $conf, $user; $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.$project->id; + $head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("Project"); $head[$h][2] = 'project'; $h++; @@ -56,7 +57,7 @@ function project_prepare_head(Project $project) $nbContacts = count($project->liste_contact(-1, 'internal')) + count($project->liste_contact(-1, 'external')); dol_setcache($cachekey, $nbContacts, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.$project->id; + $head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("ProjectContact"); if ($nbContacts > 0) { $head[$h][1] .= ''.$nbContacts.''; @@ -80,7 +81,7 @@ function project_prepare_head(Project $project) $nbTasks = count($taskstatic->getTasksArray(0, 0, $project->id, 0, 0)); dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$project->id; + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("Tasks"); if ($nbTasks > 0) { $head[$h][1] .= ''.($nbTasks).''; @@ -113,7 +114,7 @@ function project_prepare_head(Project $project) } } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.urlencode($project->id); + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("TimeSpent"); if ($nbTimeSpent > 0) { $head[$h][1] .= '...'; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 329b54d5eda..8a2298124c9 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -502,7 +502,15 @@ if (($id || $ref) && $action == 'edit') { // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $res = $object->fetch_optionals(); + $object->fetch_optionals(); + + $moreparam = ''; + if ($withproject) { + $moreparam .= '&withproject=1'; + } + if ($fk_project) { + $moreparam .= '&fk_project='.((int) $fk_project); + } $head = conferenceorboothattendeePrepareHead($object); print dol_get_fiche_head($head, 'card', $langs->trans("ConferenceOrBoothAttendee"), -1, $object->picto); @@ -544,13 +552,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; $morehtmlref .= '
'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $moreparam); print '
'; print '
'; diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index f49bd5e49a0..3951cc25df7 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -196,7 +196,7 @@ function conferenceorboothattendeePrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_card.php", 1).'?id='.$object->id.'&conforboothid='.$object->fk_actioncomm; + $head[$h][0] = DOL_URL_ROOT."/eventorganization/conferenceorboothattendee_card.php?id=".((int) $object->id).($object->fk_actioncomm > 0 ? '&conforboothid='.((int) $object->fk_actioncomm) : '').($object->fk_project > 0 ? '&withproject=1&fk_project='.((int) $object->fk_project) : ''); $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++;