Editing My View based on user level

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
cASARIO
Posts: 3
Joined: 26 Jan 2016, 08:45

Editing My View based on user level

Post by cASARIO »

Hi everyone,

These forums have been very helpful already thanks, though I'm trying to take our database a bit further for simplicity.

Is there a way I can edit the My View page based on the user level? I understand how to make the changes I need but not how to stop them being global.

So for a Developer id like the My View page to only include:
- Assigned to Me
- Monitored by Me

Then for Updater id like the same My View to only show:
- New
- Resolved
- Recently Modified
- Monitored by Me

As I'm aware Id be making the change in config_inc as I have with everything else by using the following:

Developer:
$g_my_view_boxes = array (
'assigned' => '1',
'unassigned' => '0',
'reported' => '0',
'resolved' => '0',
'recent_mod' => '0',
'monitored' => '2',
'feedback' => '0',
'verify' => '0',
'my_comments' => '0'
);

Updater:
$g_my_view_boxes = array (
'assigned' => '0',
'unassigned' => '1',
'reported' => '0',
'resolved' => '2',
'recent_mod' => '3',
'monitored' => '4',
'feedback' => '0',
'verify' => '0',
'my_comments' => '0'
);

What Id like to know is what do I put prior to the code to ensure it only affects the people I want it to?

Many thanks
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Editing My View based on user level

Post by atrol »

There is no way to get this by just setting configuration options.
You can be set options globally (in config_inc..php), per project or per user (in database)
You have to write some lines of PHP code to set this option per user level.
Please use Search before posting and read the Manual
cASARIO
Posts: 3
Joined: 26 Jan 2016, 08:45

Re: Editing My View based on user level

Post by cASARIO »

Thanks, yeah I assumed there would need to be some code written. I am just hoping someone knows what it will be. I expect it to be along the lines of what I've done below, but I'm very new to this sort of thing.

if ( $g_access_levels_enum_string = 'developer') {
$g_my_view_boxes = array (
'assigned' => '1',
'unassigned' => '0',
'reported' => '0',
'resolved' => '0',
'recent_mod' => '0',
'monitored' => '2',
'feedback' => '0',
'verify' => '0',
'my_comments' => '0'
);
}

Anyone have any thoughts?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Editing My View based on user level

Post by atrol »

Didn't try, this should be the right way for it

Code: Select all

if ( access_get_project_level() == DEVELOPER )
Please use Search before posting and read the Manual
cASARIO
Posts: 3
Joined: 26 Jan 2016, 08:45

Re: Editing My View based on user level

Post by cASARIO »

atrol wrote:Didn't try, this should be the right way for it

Code: Select all

if ( access_get_project_level() == DEVELOPER )
Thanks, but I'm afraid this didn't work.
Post Reply