From bbb2456f0bf78c61bb638cf5c997ce32dd9f7d2b Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 15 Oct 2026 16:35:00 -0400 Subject: [PATCH] Projects modernization: projects list with Active/Mine/Overdue/Due soon/Stalled/Over budget/Ready to close/Completed/Archived/All views, ticket and task progress bars, time logged against budget with unbilled hours, due badges, manager changed in place, manager/client/created filters, bulk set manager, set due date, complete, reopen, archive, restore and delete, CSV/PDF export; project page with header actions, attention banners, tickets/tasks/time/due stat cards, Tickets/Tasks/Activity tabs, scope, details and team with hours; project quick look; New/Edit Project with client contact, start date, budget hours and template that can assign its tickets to the manager; Add tickets by picking or by number; add a project template's tickets to an existing project; template ticket subjects fill in [Client], [Project], [Month], [Quarter] and [Year]; project templates admin rework with ordered ticket templates, multi-add, duplicate, archive and restore; projects on the ticket page, client overview, dashboard, calendar, global search and client actions menu; New Ticket offers internal projects; tickets only join a project of their own client or an internal one; completing a project is checked on the server and completed projects can be reopened; deleting a project keeps its tickets; deleting a client deletes its projects; bulk ticket creation limits project choices to matching clients; project template reordering limited to admins; new manager notifications; new functions/project.php; removed project_link_closed_ticket.php; DB 2.8.6 adds project_start, project_budget_hours, project_contact_id and a ticket_project_id index, and cleans up orphaned projects, ticket project links and template links --- admin/database_updates/2.8.6.php | 27 + .../project_template/project_template_add.php | 20 +- .../project_template_edit.php | 30 +- .../project_template_ticket_template_add.php | 72 +- admin/post/demo_data_model.php | 24 +- admin/post/project_template.php | 133 ++- admin/post/ticket_template.php | 6 +- admin/project_template.php | 373 +++--- admin/project_templates.php | 190 +-- agent/ajax.php | 19 +- agent/calendar.php | 22 + agent/client_overview.php | 26 +- agent/includes/client_actions_menu.php | 5 +- agent/js/project_modal.js | 97 ++ agent/js/tickets_add_modal.js | 7 +- agent/modals/asset/asset_bulk_add_ticket.php | 11 +- .../modals/client/client_bulk_add_ticket.php | 6 +- agent/modals/project/project.php | 113 ++ agent/modals/project/project_add.php | 110 +- .../modals/project/project_apply_template.php | 59 + agent/modals/project/project_bulk_due.php | 41 + agent/modals/project/project_bulk_manager.php | 50 + agent/modals/project/project_edit.php | 86 +- agent/modals/project/project_export.php | 94 ++ agent/modals/project/project_form.php | 124 ++ .../project/project_link_closed_ticket.php | 60 - agent/modals/project/project_link_ticket.php | 94 +- agent/modals/ticket/ticket.php | 4 +- agent/post/client.php | 8 +- agent/post/project.php | 686 +++++++---- agent/project.php | 1023 ++++++++++------- agent/projects.php | 665 +++++++---- agent/ticket.php | 11 +- agent/ticket_list.php | 2 +- css/itflow_custom.css | 64 ++ db.sql | 6 +- functions.php | 1 + functions/client_overview.php | 45 +- functions/dashboard.php | 35 +- functions/export.php | 21 + functions/notifications.php | 3 +- functions/project.php | 661 +++++++++++ functions/search.php | 26 +- functions/ticket_fields.php | 7 +- 44 files changed, 3617 insertions(+), 1550 deletions(-) create mode 100644 admin/database_updates/2.8.6.php create mode 100644 agent/js/project_modal.js create mode 100644 agent/modals/project/project.php create mode 100644 agent/modals/project/project_apply_template.php create mode 100644 agent/modals/project/project_bulk_due.php create mode 100644 agent/modals/project/project_bulk_manager.php create mode 100644 agent/modals/project/project_export.php create mode 100644 agent/modals/project/project_form.php delete mode 100644 agent/modals/project/project_link_closed_ticket.php create mode 100644 functions/project.php diff --git a/admin/database_updates/2.8.6.php b/admin/database_updates/2.8.6.php new file mode 100644 index 000000000..19364a99d --- /dev/null +++ b/admin/database_updates/2.8.6.php @@ -0,0 +1,27 @@ + 0 AND `client_id` IS NULL"); + mysqli_query($mysqli, "UPDATE `tickets` LEFT JOIN `projects` ON `project_id` = `ticket_project_id` SET `ticket_project_id` = 0 WHERE `ticket_project_id` > 0 AND `project_id` IS NULL"); + + // A project template's ticket templates whose template is gone + mysqli_query($mysqli, "DELETE `project_template_ticket_templates` FROM `project_template_ticket_templates` + LEFT JOIN `project_templates` ON `project_templates`.`project_template_id` = `project_template_ticket_templates`.`project_template_id` + LEFT JOIN `ticket_templates` ON `ticket_templates`.`ticket_template_id` = `project_template_ticket_templates`.`ticket_template_id` + WHERE `project_templates`.`project_template_id` IS NULL OR `ticket_templates`.`ticket_template_id` IS NULL"); diff --git a/admin/modals/project_template/project_template_add.php b/admin/modals/project_template/project_template_add.php index f58e2ec0f..cdf0c6fad 100644 --- a/admin/modals/project_template/project_template_add.php +++ b/admin/modals/project_template/project_template_add.php @@ -6,7 +6,7 @@ ob_start(); ?>
@@ -14,21 +14,15 @@ ob_start();