From e111a3d51cbebebff07435a88766c22dc08be927 Mon Sep 17 00:00:00 2001 From: bytestream Date: Thu, 11 Jun 2026 16:29:35 +0100 Subject: [PATCH 1/3] update tailwind utility class names --- Controllers/Demo.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Controllers/Demo.php b/Controllers/Demo.php index b8c2df9..c59dd9e 100755 --- a/Controllers/Demo.php +++ b/Controllers/Demo.php @@ -101,11 +101,11 @@ protected function setLoginCredentials() protected function setDemoNotice() { $notice = << - This is the SupportPal product demo. By +
+ This is the SupportPal product demo. By continuing to navigate this website you agree to our - Terms of Service - and Privacy Policy. + Terms of Service + and Privacy Policy.
END; From 49a1a60e42183cf3da71df693934a4e5ca9bf095 Mon Sep 17 00:00:00 2001 From: bytestream Date: Thu, 11 Jun 2026 16:29:46 +0100 Subject: [PATCH 2/3] fix wrong ticket message type --- Seeds/Tickets/TicketSeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Seeds/Tickets/TicketSeeder.php b/Seeds/Tickets/TicketSeeder.php index 26d849c..57cf5bd 100755 --- a/Seeds/Tickets/TicketSeeder.php +++ b/Seeds/Tickets/TicketSeeder.php @@ -292,7 +292,7 @@ public function run() 'user_name' => User::operator()->firstOrFail()->formatted_name, 'user_ip_address' => inet_pton('81.8.12.192'), 'by' => 0, - 'type' => 1, + 'type' => 0, 'excerpt' => 'Hi Jane, No worries I\'ve just reactivated the service and we can give you 5 days', 'text' => $text = 'Hi Jane,

No worries I\'ve just reactivated the service and we can give you 5 days to complete payment. I hope this is enough time, but let me know if you run in to any further trouble with it.

-----
Best Regards,

John Doe
Demo', 'purified_text' => $text, From ea15d51a9b75846e7f60f7a2a4dfeab768a130c9 Mon Sep 17 00:00:00 2001 From: bytestream Date: Thu, 11 Jun 2026 16:46:06 +0100 Subject: [PATCH 3/3] seed timeline --- Seeds/Tickets/TicketSeeder.php | 156 +++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/Seeds/Tickets/TicketSeeder.php b/Seeds/Tickets/TicketSeeder.php index 57cf5bd..c8c1018 100755 --- a/Seeds/Tickets/TicketSeeder.php +++ b/Seeds/Tickets/TicketSeeder.php @@ -3,7 +3,11 @@ namespace Addons\Plugins\Demo\Seeds\Tickets; use App\Modules\Core\Controllers\Database\Seed\Seeder; +use App\Modules\Core\Models\ActivityLog\Attribute; +use App\Modules\Core\Models\ActivityLog\DynamicValue; +use App\Modules\Core\Models\ActivityLog\RelNameOptions; use App\Modules\Core\Models\Brand; +use App\Modules\Core\Models\FeedbackRating; use App\Modules\Ticket\Models\Channel; use App\Modules\Ticket\Models\Department; use App\Modules\Ticket\Models\DepartmentEmail; @@ -514,5 +518,157 @@ public function run() 'updated_at' => $time - 2804 ] ]); + + // Insert ticket events (status changes, tags, locking, feedback) along with their timeline entries + $addEventWithTimelineEntry = function (array $data) { + $logId = DB::table('activity_log')->insertGetId($data); + + DB::table('ticket_timeline')->insert([ + 'ticket_id' => $data['rel_id'], + 'ticket_message_id' => null, + 'activity_log_id' => $logId, + 'created_at' => $data['created_at'], + 'updated_at' => $data['updated_at'], + ]); + }; + + $statusValue = function (string $name) { + return DynamicValue::create( + new Attribute(Status::where('name', $name)->firstOrFail()->id, Status::class), + $name + ); + }; + + // Ticket 3 - status changed and tag added with the last operator reply. + $addEventWithTimelineEntry([ + 'type' => 1, + 'rel_name' => '7483029', + 'rel_id' => $ticket3, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::operator()->firstOrFail()->id, + 'user_name' => User::operator()->firstOrFail()->formatted_name, + 'event_name' => 'ticket_status_updated', + 'extra' => json_encode([ + 'old_value' => $statusValue('Open'), + 'new_value' => $statusValue('In-Progress'), + ]), + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 3100, + 'updated_at' => $time - 3100 + ]); + + $addEventWithTimelineEntry([ + 'type' => 1, + 'rel_name' => '7483029', + 'rel_id' => $ticket3, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::operator()->firstOrFail()->id, + 'user_name' => User::operator()->firstOrFail()->formatted_name, + 'event_name' => 'ticket_tag_added_multiple', + 'extra' => json_encode([ + 'formatted_items' => Tag::formatCollectionForActivityLog(Tag::where('name', 'Custom Work')->get()), + ]), + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 3100, + 'updated_at' => $time - 3100 + ]); + + // Ticket 4 - closed and locked after the last user reply, then the user left feedback. + $addEventWithTimelineEntry([ + 'type' => 1, + 'rel_name' => 'SALES-03139', + 'rel_id' => $ticket4, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::operator()->firstOrFail()->id, + 'user_name' => User::operator()->firstOrFail()->formatted_name, + 'event_name' => 'ticket_status_updated', + 'extra' => json_encode([ + 'old_value' => $statusValue('Open'), + 'new_value' => $statusValue('Closed'), + ]), + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 86600, + 'updated_at' => $time - 86600 + ]); + + $addEventWithTimelineEntry([ + 'type' => 1, + 'rel_name' => 'SALES-03139', + 'rel_id' => $ticket4, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::operator()->firstOrFail()->id, + 'user_name' => User::operator()->firstOrFail()->formatted_name, + 'event_name' => 'ticket_locked', + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 86600, + 'updated_at' => $time - 86600 + ]); + + $addEventWithTimelineEntry([ + 'type' => 2, + 'rel_name' => 'SALES-03139', + 'rel_id' => $ticket4, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::where('email', 'jane.mason@acme.corp')->firstOrFail()->id, + 'user_name' => User::where('email', 'jane.mason@acme.corp')->firstOrFail()->formatted_name, + 'event_name' => 'ticket_feedback_rating', + 'extra' => json_encode([ + 'rel' => [ + [ + 'name' => FeedbackRating::GOOD->toLanguageVariable(), + 'name_options' => (new RelNameOptions) + ->useLocalisation(true) + ->convertToLowercase(true) + ->toArray(), + ], + ], + ]), + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 86400, + 'updated_at' => $time - 86400 + ]); + + // Ticket 5 - status changed and tags added after the last operator reply. + $addEventWithTimelineEntry([ + 'type' => 1, + 'rel_name' => '1354619', + 'rel_id' => $ticket5, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::operator()->firstOrFail()->id, + 'user_name' => User::operator()->firstOrFail()->formatted_name, + 'event_name' => 'ticket_status_updated', + 'extra' => json_encode([ + 'old_value' => $statusValue('Open'), + 'new_value' => $statusValue('Awaiting Reply'), + ]), + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 6795, + 'updated_at' => $time - 6795 + ]); + + $addEventWithTimelineEntry([ + 'type' => 1, + 'rel_name' => '1354619', + 'rel_id' => $ticket5, + 'rel_route' => 'ticket.operator.ticket.show', + 'section' => 'ticket.ticket', + 'user_id' => User::operator()->firstOrFail()->id, + 'user_name' => User::operator()->firstOrFail()->formatted_name, + 'event_name' => 'ticket_tag_added_multiple', + 'extra' => json_encode([ + 'formatted_items' => Tag::formatCollectionForActivityLog( + Tag::whereIn('name', ['Feature Request', 'Logged'])->get() + ), + ]), + 'ip' => inet_pton('81.8.12.192'), + 'created_at' => $time - 6795, + 'updated_at' => $time - 6795 + ]); } }