Skip to content
Snippets Groups Projects
Commit a1282f52 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Navigation into projects

parent 8ac33e98
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$id=GETPOST('id','int');
$ref=GETPOST('ref','alpha');
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
$mode = GETPOST('mode', 'alpha');
$mine = ($mode == 'mine' ? 1 : 0);
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$object = new Project($db);
......@@ -99,7 +101,7 @@ if ($id > 0 || ! empty($ref))
$head=project_prepare_head($object);
dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project'));
$param=($_REQUEST["mode"]=='mine'?'&mode=mine':'');
$param=($mode=='mine'?'&mode=mine':'');
print '<table class="border" width="100%">';
......@@ -110,8 +112,11 @@ if ($id > 0 || ! empty($ref))
print $langs->trans("Ref");
print '</td><td>';
// Define a complementary filter for search of next/prev ref.
$objectsListId = $object->getProjectsAuthorizedForUser($user,$mine,1);
$object->next_prev_filter=" rowid in (".$objectsListId.")";
if (! $user->rights->projet->all->lire)
{
$projectsListId = $object->getProjectsAuthorizedForUser($user,$mine,0);
$object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
}
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param);
print '</td></tr>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment