Filtering in dbjoin element by usergroup?

The current usertype is accessible with {$my->usertype}. So if you have a field with usertypes stored in, then you should be able to use a where clause to limit the list.
 
I got this from the wiki http://fabrikar.com/forums/index.php?wiki/placeholders/.

But looking at the code (replaceWithUserData in components\com_fabrik\helpers\parent.php) it should replace with any property of the JUser object (see http://api.joomla.org/Joomla-Platform/User/JUser.html).

usertype is not a listed property for platform 12.1 (which is J3) - so I am not surprised that it doesn't work. :) It was a property in 11.4 (which is J2.x?) hence the confusion. I will update the wiki.

So try ($my->groups) instead which should return an array of groups the user is a member of - there is some confusion about the format of this array so you might need to experiment a little.

Please let us know how you get on and what you find out.

S
 
I have updated the wiki entry, but would be interested to know just what you need to do to use the {$my->groups} placeholder in practice.

Thx.
 
I have form for addind news. There are several categoies of news. Each category fore one department. Task: show in dropdown only categories which are available for adding news for definite group of users.
My solution: dbjoin to table with fild element "category name" and access element "group".
In dbjoin element:
WHERE `group` IN
(SELECT group_id
FROM `cghb2_user_usergroup_map`
WHERE `user_id` = {$my->id})
Now i can add user to usergroup assigned to category of news.
Maybe it's not the best solution, but it is work.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top