Best practice forum (Archived)

This forum discussion has been removed

 
This forum post has been removed
Friday, 17 May 2013, 2:13 AM
The content of this forum post has been removed and can no longer be accessed.
me
Re: Position link on user My Profile settings block
by George Angus - Sunday, 19 May 2013, 8:51 PM
Group Totara

Hi Amir,

You have to comment out some code for this:

/lib/navigationlib.php

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.

This forum post has been removed
Sunday, 19 May 2013, 9:32 PM
The content of this forum post has been removed and can no longer be accessed.
me
Re: Position link on user My Profile settings block
by George Angus - Sunday, 19 May 2013, 9:45 PM
Group Totara

Hi Amir,

Yip - Ill put one in toute suite.

cheers,

George.

Oleg Demeshev
Re: Position link on user My Profile settings block
by Oleg Demeshev - Tuesday, 21 May 2013, 9:14 PM
Group Totara

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

This forum post has been removed
Tuesday, 21 May 2013, 10:08 PM
The content of this forum post has been removed and can no longer be accessed.
This forum post has been removed
Tuesday, 21 May 2013, 10:27 PM
The content of this forum post has been removed and can no longer be accessed.
Oleg Demeshev
Re: Position link on user My Profile settings block
by Oleg Demeshev - Thursday, 23 May 2013, 3:09 PM
Group Totara

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

This forum post has been removed
Thursday, 23 May 2013, 10:11 PM
The content of this forum post has been removed and can no longer be accessed.