Skip to content

Commit da96cb5

Browse files
author
Aurélien TISNE
authored
TICKET 0008881: Requirements no more available (#260)
The method has_rights in initTopMenu needs to know the project ID and optionally the test plan ID to compute if some icons must be displayed.
1 parent 34cc7e0 commit da96cb5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/functions/common.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ function initTopMenu(&$db)
323323
foreach ($guiTopMenu as $element)
324324
{
325325
// check if Test Plan is available
326+
$testPlanID = (isset($_SESSION['testplanID']) && $_SESSION['testplanID'] > 0) ? $_SESSION['testplanID'] : null;
326327
if ((!isset($element['condition'])) || ($element['condition'] == '') ||
327328
(($element['condition'] == 'TestPlanAvailable') &&
328-
isset($_SESSION['testplanID']) && $_SESSION['testplanID'] > 0) ||
329+
!is_null($testPlanID)) ||
329330
(($element['condition'] == 'ReqMgmtEnabled') &&
330331
isset($_SESSION['testprojectOptions']->requirementsEnabled) &&
331332
$_SESSION['testprojectOptions']->requirementsEnabled))
@@ -339,15 +340,15 @@ function initTopMenu(&$db)
339340
{
340341
foreach($element['right'] as $rg)
341342
{
342-
if( $addItem = (has_rights($db,$rg) == "yes") )
343+
if( $addItem = (has_rights($db,$rg, $_SESSION['testprojectID'], $testPlanID) == "yes") )
343344
{
344345
break;
345346
}
346347
}
347348
}
348349
else
349350
{
350-
$addItem = (has_rights($db,$element['right']) == "yes");
351+
$addItem = (has_rights($db,$element['right'], $_SESSION['testprojectID'], $testPlanID) == "yes");
351352
}
352353
}
353354

0 commit comments

Comments
 (0)