Best practice forum (Archived)

该论坛讨论已删除

 
该论坛帖子已被删除
2013年05月17日 Friday 02:13
该论坛帖子的内容已被删除,无法再访问。
me
Re: Position link on user My Profile settings block
AngusGeorge 发表于 2013年05月19日 Sunday 20:51
小组 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.

该论坛帖子已被删除
2013年05月19日 Sunday 21:32
该论坛帖子的内容已被删除,无法再访问。
me
Re: Position link on user My Profile settings block
AngusGeorge 发表于 2013年05月19日 Sunday 21:45
小组 Totara

Hi Amir,

Yip - Ill put one in toute suite.

cheers,

George.

DemeshevOleg
Re: Position link on user My Profile settings block
DemeshevOleg 发表于 2013年05月21日 Tuesday 21:14
小组 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

该论坛帖子已被删除
2013年05月21日 Tuesday 22:08
该论坛帖子的内容已被删除,无法再访问。
该论坛帖子已被删除
2013年05月21日 Tuesday 22:27
该论坛帖子的内容已被删除,无法再访问。
DemeshevOleg
Re: Position link on user My Profile settings block
DemeshevOleg 发表于 2013年05月23日 Thursday 15:09
小组 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

该论坛帖子已被删除
2013年05月23日 Thursday 22:11
该论坛帖子的内容已被删除,无法再访问。