1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

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

Discussion in 'Community' started by wuschel_lux, Feb 14, 2020 at 11:28 AM.

Thread Status:
Not open for further replies.
  1. wuschel_lux

    wuschel_lux Member

    Level: Community
    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
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Data-where has an "Apply to", you can select the access level (similar to pre-filters).
     
  3. wuschel_lux

    wuschel_lux Member

    Level: Community
    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
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    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.
     
    wuschel_lux likes this.
  5. wuschel_lux

    wuschel_lux Member

    Level: Community
    Sorry for the late confirmation. Your tip does what I want!

    Many Thanks for your great support.
     
Thread Status:
Not open for further replies.

Share This Page