From eaf3f5abd15872abc923a932e3d6aaf2132dcc7d Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 29 Jul 2026 16:28:17 -0400 Subject: [PATCH] Add Badge next to recurring tickets with a template --- CHANGELOG.md | 3 ++- agent/recurring_tickets.php | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c930efb8..7ba28b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,7 +77,8 @@ This file documents all notable changes made to ITFlow. - **Ticket templates on recurring tickets.** A recurring ticket can now be assigned a ticket template. Picking one fills in the subject and details, and the template's task list is stamped onto every ticket the schedule raises - from the nightly cron run and from a forced run alike. - Clearing the template leaves the recurring ticket's own subject and details untouched. + Clearing the template leaves the recurring ticket's own subject and details untouched. The + recurring ticket list shows which schedules carry a template and how many tasks it adds. - Added **ticket reply API endpoints** for creating and reading replies. - Payments and Revenues have been combined into a single **Income** page, keeping all income in one place, with CSV export. Revenue not tied to an invoice can still be added there; payments diff --git a/agent/recurring_tickets.php b/agent/recurring_tickets.php index 9f3aef1f..97d33479 100644 --- a/agent/recurring_tickets.php +++ b/agent/recurring_tickets.php @@ -54,10 +54,13 @@ if (isset($_GET['billable']) && $_GET['billable'] == 1) { // SQL $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM recurring_tickets + "SELECT SQL_CALC_FOUND_ROWS *, + (SELECT COUNT(task_template_id) FROM task_templates WHERE task_template_ticket_template_id = recurring_ticket_ticket_template_id) AS template_task_count + FROM recurring_tickets LEFT JOIN clients ON recurring_ticket_client_id = client_id LEFT JOIN categories ON category_id = recurring_ticket_category LEFT JOIN users ON user_id = recurring_ticket_assigned_to + LEFT JOIN ticket_templates ON ticket_template_id = recurring_ticket_ticket_template_id WHERE (recurring_tickets.recurring_ticket_subject LIKE '%$q%' OR category_name LIKE '%$q%') $access_permission_query $category_query @@ -295,6 +298,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $recurring_ticket_category = escapeHtml($row['category_name']) ?: '-'; $recurring_ticket_client_name = escapeHtml($row['client_name']); $assigned_to = escapeHtml($row['user_name']) ?: '-'; + $recurring_ticket_template_name = escapeHtml($row['ticket_template_name']); + $recurring_ticket_template_task_count = intval($row['template_task_count']); ?> @@ -310,6 +315,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); data-modal-url="modals/recurring_ticket/recurring_ticket_edit.php?id="> + + to each ticket raised"> + + +