if ($userIsBlindFolded) {
    $testprojectID = $testplanID = 0;
    $_SESSION['testprojectTopMenu'] = '';
}
$tplan2check = null;
$currentUser = $_SESSION['currentUser'];
$userID = $currentUser->dbID;
$gui = new stdClass();
$gui->grants = getGrants($db, $user, $userIsBlindFolded);
$gui->hasTestCases = false;
if ($gui->grants['view_tc']) {
    $gui->hasTestCases = $tproject_mgr->count_testcases($testprojectID) > 0 ? 1 : 0;
}
$gui->hasKeywords = false;
if ($gui->hasTestCases) {
    $gui->hasKeywords = $tproject_mgr->hasKeywords($testprojectID);
}
// ----- Test Plan Section --------------------------------------------------------------
/** 
 * @TODO - franciscom - we must understand if these two calls are really needed,
 * or is enough just call to getAccessibleTestPlans()
 */
$filters = array('plan_status' => ACTIVE);
$gui->num_active_tplans = $tproject_mgr->getActiveTestPlansCount($testprojectID);
//sizeof($tproject_mgr->get_all_testplans($testprojectID,$filters));
// get Test Plans available for the user
$arrPlans = $currentUser->getAccessibleTestPlans($db, $testprojectID);
if ($testplanID > 0) {
    // if this test plan is present on $arrPlans
    //	  OK we will set it on $arrPlans as selected one.
    // else