From c7a9a1ab541aa9f40c45976842b6cd0069d3031f Mon Sep 17 00:00:00 2001
From: Sam Splunks <72095718+samsplunks@users.noreply.github.com>
Date: Mon, 5 Feb 2024 11:34:56 +0100
Subject: [PATCH] Removed ticket new status logic from templates
---
.../templates/helpdesk/public_view_ticket.html | 16 +++-------------
helpdesk/templates/helpdesk/ticket.html | 16 ++--------------
2 files changed, 5 insertions(+), 27 deletions(-)
diff --git a/helpdesk/templates/helpdesk/public_view_ticket.html b/helpdesk/templates/helpdesk/public_view_ticket.html
index 3c3467a7..62f37a43 100644
--- a/helpdesk/templates/helpdesk/public_view_ticket.html
+++ b/helpdesk/templates/helpdesk/public_view_ticket.html
@@ -110,19 +110,9 @@
{% else %}
- {% for status_choice in ticket.STATUS_CHOICES %}
- {% with status_choice_strfmt_s=status_choice.0|stringformat:"s" %}
- {% if ticket.status == 2 and status_choice_strfmt_s in "1" %}{% else %}
- {% if ticket.status == 3 and status_choice_strfmt_s not in "2,3,4" %}{% else %}
- {% if ticket.status == 4 and status_choice_strfmt_s not in "2,4" %}{% else %}
- {% if ticket.status == 5 and status_choice_strfmt_s not in "2,5" %}{% else %}
-
- {% endif %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endwith %}
- {% endfor %}
+ {% for status_choice in ticket.get_allowed_status_flow %}
+
+ {% endfor %}
{% endif %}
diff --git a/helpdesk/templates/helpdesk/ticket.html b/helpdesk/templates/helpdesk/ticket.html
index 50a61a4f..b4eb61db 100644
--- a/helpdesk/templates/helpdesk/ticket.html
+++ b/helpdesk/templates/helpdesk/ticket.html
@@ -110,20 +110,8 @@
{% if not ticket.can_be_resolved %}{% trans "This ticket cannot be resolved or closed until the tickets it depends on are resolved." %}{% endif %}
- {% for status_choice in ticket.STATUS_CHOICES %}
- {% with status_choice_strfmt_s=status_choice.0|stringformat:"s" %}
- {% if ticket.status == 1 and status_choice_strfmt_s in "2" %}{% else %}
- {% if ticket.status == 2 and status_choice_strfmt_s in "1" %}{% else %}
- {% if ticket.status == 3 and status_choice_strfmt_s not in "2,3,4" %}{% else %}
- {% if ticket.status == 4 and status_choice_strfmt_s not in "2,4" %}{% else %}
- {% if ticket.status == 5 and status_choice_strfmt_s not in "2,5" %}{% else %}
-
- {% endif %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endwith %}
+ {% for status_choice in ticket.get_allowed_status_flow %}
+
{% endfor %}