Presented at JoomlaDay Australia Brisbane 2019.
Learn how to leverage the core Joomla 4 features of workflows and custom fields to build simple applications, without having to be a coding geek. While custom fields have been in Joomla core for a couple of years, they become so much more powerful once you combine them with the new Joomla 4 workflows feature. We'll take a look at how it all works and give you some ideas about what you can create on your own Joomla sites.
22. Rename existing Stages if required
In our example, rename Unpublished to Rejected Rename
Published to Completed, and delete Trashed and Archive
Create a leave request
23. Add new workflow Stages
• Also set default (initial stage)
Create a leave request
24. Set up the Workflow Transitions
Create a leave request
25. Add your Transitions
• Give each a name, and decide which Stage can
transition to a specific stage. Also decide who can
move to next stage
Create a leave request
32. Override edit form
Copy /components/com_content/tmpl/form/edit.php to
/yourtemplate/html/com_content/form/edit.php and customise look for this category.
Note this is the geeking coding bit
that a regular Joomla user
wouldn’t be able to do. Maybe in
future there will be an easier way.
33. Create a My Approvals view
Note: You can adjust what columns you see on the List Layouts tab.
Note: We actually create this access level in a couple
of slides time.
34. My Leave Applications view
You could take this even further with an override and customise to include columns such as
workflow state
36. Override the view form with alternate layout
• You can clean up and simply the view form with an alternate layout
Copy /components/com_content/tmpl/article/default.php to
/yourtemplate/html/com_content/article/default.php and rename as
leaveapplication.php
Edit as required, then assign that layout to your menu item
Another geeking coding bit that
a regular Joomla user wouldn’t
be able to do.
37. You can also use Access Levels (optional)
• If you want to further restrict access, use
access levels which you can apply to menu
item and category
38. Now let’s see it in action
• Employee creates a leave request. It goes to
manager approval
Create a leave request
39.
40. Manager approval step
• When sent to manager, he can reject, approve,
or request more information
• Note if employee logs in, they don’t see the manager action transition states
Create a leave request
42. Leave request is now complete
There are no more transitional states for this workflow
Create a leave request
43. Limitations
• Can’t customise transition emails
• Everyone with “Execute Transition” permission will get the email
• Need coding skills to override form and view
• All the records are saved in com_content (Joomla articles)
44. We probably don’t have time for Questions
• Feel free to come and chat with me during one of the breaks or at the
social event. I’ll be around all weekend.