Skip to content

Commit

Permalink
#502 [Session] fix: backtolist to fromObject list
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Jan 11, 2024
1 parent 7b88046 commit 4737739
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions view/session/session_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,28 @@
//$searchExternalAttendants = GETPOST('search_external_attendants', 'int');
$searchSocietyAttendants = GETPOST('search_society_attendants', 'int');

$error = 0;
$error = 0;
$moreHtml = '';
if (!empty($fromType)) {
switch ($fromType) {
case 'thirdparty' :
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
$objectLinked = new Societe($db);
$search['fk_soc'] = $fromID;
$moreHtml = '<a href="' . dol_buildpath('/societe/list.php', 1) . '?restore_lastsearch_values=1">' . $langs->trans('BackToList') . '</a>';
break;
case 'project' :
require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
$objectLinked = new Project($db);
$search['fk_project'] = $fromID;
$moreHtml = '<a href="' . dol_buildpath('/projet/list.php', 1) . '?restore_lastsearch_values=1">' . $langs->trans('BackToList') . '</a>';
break;
case 'socpeople' :
require_once DOL_DOCUMENT_ROOT . '/core/lib/contact.lib.php';
$objectLinked = new Contact($db);
$search['fk_contact'] = $fromID;
$search['search_external_attendants'] = $fromID;
$moreHtml = '<a href="' . dol_buildpath('/contact/list.php', 1) . '?restore_lastsearch_values=1">' . $langs->trans('BackToList') . '</a>';
break;
case 'contrat' :
require_once DOL_DOCUMENT_ROOT . '/core/lib/contract.lib.php';
Expand All @@ -167,11 +171,13 @@
$sortfield = 't.date_start';
$sortorder = 'ASC';
}
$moreHtml = '<a href="' . dol_buildpath('/contrat/list.php', 1) . '?restore_lastsearch_values=1">' . $langs->trans('BackToList') . '</a>';
break;
case 'user' :
require_once DOL_DOCUMENT_ROOT . '/core/lib/usergroups.lib.php';
$objectLinked = new User($db);
$search['search_internal_attendants'] = $fromID;
$moreHtml = '<a href="' . dol_buildpath('/user/list.php', 1) . '?restore_lastsearch_values=1">' . $langs->trans('BackToList') . '</a>';
break;
default :
$error++;
Expand Down Expand Up @@ -456,7 +462,8 @@

if (!empty($fromType) && !$error) {
saturne_get_fiche_head($objectLinked, 'sessionList', $langs->trans($objectType));
saturne_banner_tab($objectLinked);
// Shownav must be 0 because navigation between fromObject can't be done while saturne_banner_tab not fix
saturne_banner_tab($objectLinked, 'ref', $moreHtml, 0);
}

$arrayofselected = is_array($toselect) ? $toselect : [];
Expand Down

0 comments on commit 4737739

Please sign in to comment.