function initializeGui(&$dbHandler, &$argsObj) { $guiObj = new stdClass(); $guiObj->highlight = initialize_tabsmenu(); $guiObj->highlight->view_roles = 1; $guiObj->roles = tlRole::getAll($dbHandler, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); $guiObj->grants = $argsObj->currentUser->getGrantsForUserMgmt($dbHandler); $guiObj->id = $argsObj->roleid; $guiObj->role_id_replacement = config_get('role_replace_for_deleted_roles'); $guiObj->affectedUsers = null; $guiObj->userFeedback = ''; $guiObj->tproject_id = $argsObj->tproject_id; return $guiObj; }
break; case "resetPassword": $highlight->edit_user = 1; $user = new tlUser($args->user_id); $user->readFromDB($db); $passwordSendMethod = config_get('password_reset_send_method'); $gui->op = createNewPassword($db, $args, $user, $passwordSendMethod); break; case "create": default: $highlight->create_user = 1; $user = new tlUser(); break; } $gui->op->operation = $actionOperation[$args->doAction]; $roles = tlRole::getAll($db, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); unset($roles[TL_ROLES_UNDEFINED]); $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->assign('highlight', $highlight); $smarty->assign('operation', $gui->op->operation); $smarty->assign('user_feedback', $gui->op->user_feedback); $smarty->assign('external_password_mgmt', tlUser::isPasswordMgtExternal($user->authentication)); $smarty->assign('mgt_view_events', $_SESSION['currentUser']->hasRight($db, "mgt_view_events")); $smarty->assign('grants', getGrantsForUserMgmt($db, $_SESSION['currentUser'])); $smarty->assign('optRights', $roles); $smarty->assign('userData', $user); renderGui($smarty, $args, $templateCfg); /** * *
function initializeGui(&$dbHandler, $argsObj) { $gui = new stdClass(); $gui->highlight = initialize_tabsmenu(); $gui->user_feedback = ''; $gui->no_features = ''; $gui->roles_updated = ''; $gui->tproject_name = $argsObj->testprojectName; $gui->featureType = $argsObj->featureType; $gui->optRights = tlRole::getAll($dbHandler, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); $gui->features = null; $gui->featureID = null; $gui->role_colour = null; $guiCfg = config_get('gui'); if ($guiCfg->usersAssignGlobalRoleColoring == ENABLED) { $gui->role_colour = tlRole::getRoleColourCfg($dbHandler); } return $gui; }
function getRoleColourCfg(&$db) { $role_colour = config_get('role_colour'); $roles = tlRole::getAll($db, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); unset($roles[TL_ROLES_UNDEFINED]); foreach ($roles as $roleObj) { if (!isset($role_colour[$roleObj->name])) { $role_colour[$roleObj->name] = ''; } } return $role_colour; }
$templateCfg = templateConfiguration(); $assignRolesFor = null; $featureMgr = null; $userFeatureRoles = null; $doInitGui = true; $guiCfg = config_get('gui'); $tprojectMgr = new testproject($db); $tplanMgr = new testplan($db); $args = init_args(); $gui = new stdClass(); $gui->highlight = initialize_tabsmenu(); $gui->user_feedback = ''; $gui->no_features = ''; $gui->roles_updated = ''; $gui->tproject_name = $args->testprojectName; $gui->optRights = tlRole::getAll($db, null, null, null, tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); $gui->features = null; $gui->featureType = $args->featureType; $gui->featureID = null; $gui->role_colour = null; if ($guiCfg->usersAssignGlobalRoleColoring == ENABLED) { $gui->role_colour = tlRole::getRoleColourCfg($db); } $target = new stdClass(); $target->testprojectID = null; $target->testplanID = null; switch ($args->featureType) { case "testproject": $gui->highlight->assign_users_tproject = 1; $gui->roles_updated = lang_get("test_project_user_roles_updated"); $gui->not_for_you = lang_get("testproject_roles_assign_disabled");