/** gives the role info, role profile info and role user info details in an array for the specified role id * @param $roleid -- role id:: Type integer * @returns $return_data -- array contains role info, role profile info and role user info. This array is used to construct the detail view for the specified role id :: Type varchar * */ function getStdOutput($roleid) { //Retreiving the related vtiger_profiles $roleProfileArr = getRoleRelatedProfiles($roleid); //Retreving the related vtiger_users $roleUserArr = getRoleUsers($roleid); //Constructing the Profile list $profileinfo = array(); foreach ($roleProfileArr as $profileId => $profileName) { $profileinfo[] = $profileId; $profileinfo[] = $profileName; $profileList .= '<a href="index.php?module=Settings&action=profilePrivileges&profileid=' . $profileId . '">' . $profileName . '</a>'; } $profileinfo = array_chunk($profileinfo, 2); //Constructing the Users List $userinfo = array(); foreach ($roleUserArr as $userId => $userName) { $userinfo[] = $userId; $userinfo[] = $userName; $userList .= '<a href="index.php?module=Settings&action=DetailView&record=' . $userId . '">' . $userName . '</a>'; } $userinfo = array_chunk($userinfo, 2); //Check for Current User global $current_user; $current_role = fetchUserRole($current_user->id); $return_data = array('profileinfo' => $profileinfo, 'userinfo' => $userinfo); return $return_data; }
global $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $smarty = new vtigerCRM_Smarty(); $profDetails = getAllProfileInfo(); $smarty->assign("MOD", return_module_language($current_language, 'Settings')); $smarty->assign("APP", $app_strings); if (isset($_REQUEST['roleid']) && $_REQUEST['roleid'] != '') { $roleid = vtlib_purify($_REQUEST['roleid']); $mode = vtlib_purify($_REQUEST['mode']); $roleInfo = getRoleInformation($roleid); $thisRoleDet = $roleInfo[$roleid]; $rolename = $thisRoleDet[0]; $parent = $thisRoleDet[3]; //retreiving the vtiger_profileid $roleRelatedProfiles = getRoleRelatedProfiles($roleid); } elseif (isset($_REQUEST['parent']) && $_REQUEST['parent'] != '') { $mode = 'create'; $parent = vtlib_purify($_REQUEST['parent']); } $smarty->assign("IMAGE_PATH", $image_path); $smarty->assign("CMOD", $mod_strings); $smarty->assign("THEME", $theme); $parentname = getRoleName($parent); $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['returnaction'])); $smarty->assign("ROLEID", $roleid); $smarty->assign("MODE", $mode); $smarty->assign("PARENT", $parent); $smarty->assign("PARENTNAME", $parentname); $smarty->assign("ROLENAME", $rolename); $profile_entries = array();