Extend view condition on join element for super admins

Hi guys

I have no clue where to start with this one

I have two tables, one projects and one project fees

Project fees has an element called project name which is a dropdown that references the project that the fee belongs to and it is locked down so the logged in user can only see their own projects when attaching a fee to a project.

I worked out how to lock it to the user by putting this code

where {thistable}.proj_user_name = {$my->id}

in the Date - where box in the details.

This is all working beautifully. If a user logs in and creates a project then goes to create the fees associated with the project, they can only see their own projects to choose.

BUT NOW

We need the three super admins on the site to be able to login and edit and choose the same projects available to the users but they can't because they are NOT the user who created the project, therefore the dropdown does not have any projects to choose.

What would I have to do to enable this please

I will need a code sample because I have no clue how to start this

Any help appreciated

Thanks

Jacqui
 

Attachments

  • field-sample.png
    field-sample.png
    21.3 KB · Views: 68
Create a Joomla "Access Level" which does NOT belong to the superadmin Joomla group.
In "Data - where" set "Apply where to" to this access level.
 
Hi Troester

This did not quite work as expected.

It worked for the project owners but when the super administrators logged in, it allowed them to pick any project in the very long list whether it belonged to that owner or not and seemed a bit overwhelming as well as allowing for mistakes to creep in.

However, your help put me on the right track and I found another work around as the Super Admins NEVER have to edit this field

I created the access level as suggested which did not include admins or super admins and in the access on that element, I changed it editable only by the new access group.

Now the admins can see the project name but have no option to edit it and it does not disappear from the item or give too many non filtered choices.

Cheers

Jacqui
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top