Loading...
 

Run Profiles From Plugin List Execute

Added for Tiki 27+

(This page needs more info)

This example uses items from a client list to create groups with roles and a permissions category, linked to an initial tracker item.
{LISTEXECUTE()} {filter type="trackeritem"} {filter field="tracker_id" exact="2"} {filter field="tracker_field_clientGroup_text" exact=""} {OUTPUT(template="table")} {column label="Client" translatelabel="y" field="titlelink" mode="raw"} {OUTPUT} {FORMAT(name="titlelink")}{display name="title" format="objectlink" mode="raw"}{FORMAT} {ACTION(name="Create Client Groups" default="y")} {step action="data_channel" channel="clientcreate, clientsetup" params="client_group_name:itemId" client_group_name_field="tracker_field_clientName" itemId_field="object_id"} {ACTION} {ALTERNATE()}^{TR()}All clients have been set up{TR}^{ALTERNATE} {LISTEXECUTE}


Where the data channel pages look like this:

clientcreate

YAML
permissions: Client $profilerequest:client_group_name$Default$: include: [ ] Client $profilerequest:client_group_name$Default$ Account Managers: include: [ Clients Account Managers, Client $profilerequest:client_group_name$Default$ ] user_signup: y Client $profilerequest:client_group_name$Default$ General Staff: include: [ Clients Laboratory Staff, Client $profilerequest:client_group_name$Default$ ] user_signup: y


clientsetup

The file needs to be split up into two part so the groups created in the first part can have the permissions granted to them in the second.
YAML
objects: - type: category ref: client_category data: name: Client $profilerequest:client_group_name$Default$ Content # the parent Id below is the Id of the existing ''Client Content'' container category. parent: 4 items: - [ file_gallery, $client_file_gallery ] - type: tracker_item ref: client_item data: tracker: 2 mode: update itemId: $profilerequest:itemId$0$ values: - [ clientGroup, Client $profilerequest:client_group_name$Default$ ] - [ clientControlCategory, $client_category ] permissions: Client $profilerequest:client_group_name$Default$: include: [ Clients Groups ] default_category: $client_category


Notes:

The data channels need to be set up in the profiles control panel: tiki-admin.php?page=profiles and look like:
clientcreate, tiki://local, clientcreate, Admins clientsetup, tiki://local, clientsetup, Admins

Also note the use of $profilerequest:itemId$0$ as the placeholder for the initial itemId from each row of the List Execute.

Category: Documentation