Best practice forum (Archived)

Deze forumdiscussie is verwijderd

 
Dit forumbericht is verwijderd
Friday, 17 May 2013, 02:13 AM
De inhoud van dit forumbericht is verwijderd en is niet langer toegankelijk.
me
Re: Position link on user My Profile settings block
door George Angus - Sunday, 19 May 2013, 20:51 PM
Groep 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.

Dit forumbericht is verwijderd
Sunday, 19 May 2013, 21:32 PM
De inhoud van dit forumbericht is verwijderd en is niet langer toegankelijk.
me
Re: Position link on user My Profile settings block
door George Angus - Sunday, 19 May 2013, 21:45 PM
Groep Totara

Hi Amir,

Yip - Ill put one in toute suite.

cheers,

George.

Oleg Demeshev
Re: Position link on user My Profile settings block
door Oleg Demeshev - Tuesday, 21 May 2013, 21:14 PM
Groep 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

Dit forumbericht is verwijderd
Tuesday, 21 May 2013, 22:08 PM
De inhoud van dit forumbericht is verwijderd en is niet langer toegankelijk.
Dit forumbericht is verwijderd
Tuesday, 21 May 2013, 22:27 PM
De inhoud van dit forumbericht is verwijderd en is niet langer toegankelijk.
Oleg Demeshev
Re: Position link on user My Profile settings block
door Oleg Demeshev - Thursday, 23 May 2013, 15:09 PM
Groep 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

Dit forumbericht is verwijderd
Thursday, 23 May 2013, 22:11 PM
De inhoud van dit forumbericht is verwijderd en is niet langer toegankelijk.