databasejoin: show only persons from repeated group belongs to the parent person

Status
Not open for further replies.

wuschel_lux

Member
Hi all,

I had some time ago raised a questions, an thanks to the community found a solution (https://fabrikar.com/forums/index.php?threads/design-function-question.50613/#post-264494).

So I have a Parent person, who can register other persons (in a repeated group). So later in a databasejoin element I can show only persons that belongs to the parent one.

Element: databasejoin
Under Data: Selected ID from repeated group
Contact Label: last_name_p,' ',first_name_p

now the tab data-where:
Joins where and/or order by statement (SQL)

PHP:
WHERE {thistable}.parent_id = (SELECT mam_user_accounts.id from mam_user_accounts where mam_user_accounts.juser_id = {$my->id})

Apply where to: public
Apply where when: new

This works fine, so far. But now I would like to have the whole list if I am registered as "Admin" e.g. joomla group "10".
I tryed to play with something like:

PHP:
AND "{$my->groups}" IN ("10")

but without success. Maybe someone out could help me with the SQL query extension to achieve the result:
- Admin sees all persons if joomla group = 10
- Parent Persons sees only persons belongs to his parent_id

Thanks and BR
 
Data-where has an "Apply to", you can select the access level (similar to pre-filters).
 
Data-where has an "Apply to", you can select the access level (similar to pre-filters).

Hi an thanks,
I had this value set to public, so it is applied all other group. Must I define e new group when registering and apply it to this group?
Br
 
You can create an access level like "nosuperadmin", assign this to all parent groups (guest, registered, manager if standard J! groups are used), not to public (is parent of superadmin) and not to superadmin.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top