FIX navigation on ticket tab of projects

This commit is contained in:
Laurent Destailleur 2019-10-01 12:28:56 +02:00
parent 64381ac4d6
commit 9b607a3105

View File

@ -53,6 +53,7 @@ $id = GETPOST('id', 'int');
$msg_id = GETPOST('msg_id', 'int');
$socid = GETPOST('socid', 'int');
$projectid = GETPOST('projectid', 'int');
$project_ref= GETPOST('project_ref', 'alpha');
$search_societe = GETPOST('search_societe', 'alpha');
$search_fk_project=GETPOST('search_fk_project', 'int')?GETPOST('search_fk_project', 'int'):GETPOST('projectid', 'int');
$search_fk_status = GETPOST('search_fk_statut', 'array');
@ -300,7 +301,7 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) &&
llxHeader('', $title, $help_url);
if ($socid && !$projectid && $user->rights->societe->lire) {
if ($socid && ! $projectid && ! $project_ref && $user->rights->societe->lire) {
$socstat = new Societe($db);
$res = $socstat->fetch($socid);
if ($res > 0) {
@ -350,9 +351,10 @@ if ($socid && !$projectid && $user->rights->societe->lire) {
}
}
if ($projectid > 0) {
if ($projectid > 0 || $project_ref) {
$projectstat = new Project($db);
if ($projectstat->fetch($projectid) > 0) {
if ($projectstat->fetch($projectid, $project_ref) > 0) {
$projectid = $projectstat->id;
$projectstat->fetch_thirdparty();
$savobject = $object;
@ -388,7 +390,7 @@ if ($projectid > 0) {
$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',', array_keys($objectsListId)):'0').")";
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
dol_banner_tab($object, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';