SOLVED - Prefilter Question

nclaypool

Member
I need to see if what I'm trying to do is possible or if I need to figure out a different way.

I have a list that matches an employee to their manager via their Joomla IDs.

I have another list where an employee enters a record, that manager link from the previous list is used to create an email notification to the manager.

Ideally I'd like to make it so when a manager goes to the list they only see records they themselves have created or were created by their subordinates. Obviously a pre-filter is the best way to do this. Where I'm struggling is how this will work if I create an EVAL code that runs an SQL query and pulls out a list of IDs where the manager that's logged in matches. Ultimately a series of IDs will be returned due to one manager having multiple subordinates. How will the pre-filter handle this? Will it?

If this isn't the best way, what is an alternate?
 
You don't need an eval, you can probably do it with a subquery, using the {$my->id} placeholder.

If you can outline the actual structure of those tables, with the significant fields, I'll help you.

-- hugh
 
You don't need an eval, you can probably do it with a subquery, using the {$my->id} placeholder.

If you can outline the actual structure of those tables, with the significant fields, I'll help you.

-- hugh

I see. Here's how its structured.

List ID: 17
Contains the manager employee relationships.
The elements of note are managers___requestor and managers___manager both are nothing more than the corresponding user's Joomla ID.

List ID: 27
Contains expense reports and is where the magic needs to happen.
So the subquery needs to say something like,
RETURN managers___requestor WHERE managers___manager = {$my->id}

I greatly appreciate your assistance.
 
Assuming the expense report has a 'user' element on it ...

WHERE
Field: user(raw)
Condition: IN
Value: SELECT requestor FROM managers WHERE manager = '{$my->id}'
Type: query
Access: Managers (or whatever that level is called)

Make that an "OR", with another pre-filter for the standard "view my own records" type filter.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top