I need user element to show only one group.

fudge4u

Member
I have a user element in a form that populates with the current user's ID when filled out. (works fine)

Individual clinic locations use this form to order various items I print.

I also want to have the corporate office order on behalf of the individual clinics - so I set the EDITABLE version of the user element to allow them to select the clinic location in the form. (also works fine)

However, the user dropdown element in the form shows ALL users in my database, but I would like to show ONLY the users belonging to User Group 14 (the individual clinic locations.) Can this be done through the user element plugin?
 
No, it can't be done with the user element. But you could do it by changing it to a join element to the #__users table, and adding a "WHERE filter" like ...

Code:
WHERE {thistable}.id IN (SELECT user_id FROM #__users_usergroup_map WHERE group_id = '14')

... and set a default of ...

{$my->id}

... so it should emulate a user element by defaulting to the logged on user.

-- hugh
 
Thank you so much. It now works exactly how I wanted it to work.

The only difference in my database is that is was user_usergroup_map, not users_usergroup_map, but that was an easy thing to discover.

Thanks again for your commitment to helping the Fabrik community use it to it's fullest extent!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top