feat: helpdesk automation engine + scheduled task plugin

Automation engine in TicketsModel:
- Condition evaluator: field/op/value with eq, neq, gt, lt, in, not_in
- Action executor: set_status, set_priority, assign, add_note
- Trigger events: ticket_created, ticket_replied, status_changed, scheduled
- Hooks wired into createTicket, addReply, updateStatus

Scheduled task plugin (plg_task_mokowaas_tickets):
- Runs all 'scheduled' automation rules against non-closed tickets
- Evaluates age_hours, status, priority, sla_responded
- Joomla Scheduler integration via TaskPluginTrait

Default automation rules:
1. Auto-close resolved tickets after 7 days
2. Escalate urgent tickets with no response in 1 hour
3. Notify on high/urgent ticket creation

Also:
- Added #__mokowaas_ticket_automation table
- Fixed dashboard ImportModel null error (direct instantiation)
- Added task plugin to package manifest + script.php

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-06-02 19:29:10 -05:00
parent d73b8b06ef
commit ac920b997a
10 changed files with 392 additions and 3 deletions
+2
View File
@@ -47,6 +47,7 @@ class Pkg_MokowaasInstallerScript
$this->enablePlugin('webservices', 'mokowaas');
$this->enablePlugin('task', 'mokowaasdemo');
$this->enablePlugin('task', 'mokowaassync');
$this->enablePlugin('task', 'mokowaas_tickets');
// Migrate params from core plugin to feature plugins (one-time)
$this->migrateFeatureParams();
@@ -411,6 +412,7 @@ class Pkg_MokowaasInstallerScript
$db->quote('mod_mokowaas_cpanel'),
$db->quote('mokowaasdemo'),
$db->quote('mokowaassync'),
$db->quote('mokowaas_tickets'),
$db->quote('perfectpublisher'),
$db->quote('mokoonyx'),
];