Best practice forum (Archived)
تمت إزالة منتدى المناقشة هذا
Hi Amir,
You have to comment out some code for this:
Comment out line 4063-4103
4063 //Add positions links
4064 $canview = false;
4065 if (!empty($USER->id) && ($user->id == $USER->id)) {
4066 // Can view own profile
4067 $canview = true;
4068 }
4069 elseif (has_capability('moodle/user:viewdetails', $coursecontext)) {
4070 $canview = true;
4071 }
4072 elseif (has_capability('moodle/user:viewdetails', $usercontext)) {
4073 $canview = true;
4074 }
4075
4076 $positionsenabled = get_config('totara_hierarchy', 'positionsenabled');
4077 if ($canview && $positionsenabled) {
4078 $posbaseargs['user'] = $user->id;
4079
4080 $enabled_positions = explode(',', $positionsenabled);
4081 // Get default enabled position type
4082 global $POSITION_CODES;
4083 foreach ($POSITION_CODES as $ptype => $poscode) {
4084 if (in_array($poscode, $enabled_positions)) {
4085 $dtype = $ptype;
4086 break;
4087 }
4088 }
4089 $url = new moodle_url('/user/positions.php', array_merge($posbaseargs, array('type' => $dtype)));
4090
4091 // Link to users Positions page
4092 $positions = $usersetting->add(get_string('positions', 'totara_hierarchy'), null, self::TYPE_CONTAINER);
4093
4094 require_once($CFG->dirroot . '/totara/hierarchy/prefix/position/lib.php');
4095 global $POSITION_TYPES;
4096
4097 foreach ($POSITION_TYPES as $pcode => $ptype) {
4098 if (in_array($pcode, $enabled_positions)) {
4099 $url = new moodle_url('/user/positions.php', array_merge($posbaseargs, array('type' => $ptype)));
4100 $positions->add(get_string('type' . $ptype, 'totara_hierarchy'), $url, self::TYPE_USER);
4101 }
4102 }
4103 }
Should do the trick!
cheers,
George.
Hi Amir,
Not sure if it will help, but can you try to do the following steps:
"Site administrator" > "Users" > "Permissions" > "Define roles". Under "Manage roles" tab (first one), click on a role which you would like to change, for example "Authenticated user" link and than "Edit". Search for these setting: "View a position" and uncheck it and "Save".
Let me know if helps or not. It works for me, for my "Authenticated user".
Kind regards
Oleg
Hi Amir,
There was a bug in the system and I fixed it. With next release it should fix it. Are you using "Purge all caches" after the changes?
Kind regards
Oleg