Update public ticket view with new settings statuses logic

This commit is contained in:
Sam Splunks 2024-02-02 15:40:08 +01:00 committed by GitHub
parent 71047e1fac
commit 827c0b7ed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,33 +107,23 @@
{% if not ticket.can_be_resolved %}<dd>{% trans "This ticket cannot be resolved or closed until the tickets it depends on are resolved." %}</dd>{% endif %}
{% if ticket.status == 1 %}
<input type="hidden" name="new_status" value="{{ ticket.status }}" />
{% endif %}
{% if ticket.status == 2 %}
<input type="hidden" name="new_status" value="{{ ticket.status }}" />
{% else %}
<dd><div class="form-group">
<label for='st_reopened' class='active radio-inline'><input type='radio' name='new_status' value='2' id='st_reopened' checked='checked'>{% trans "Reopened" %} &raquo;</label>
<label class="radio-inline" for='st_resolved'><input type='radio' name='new_status' value='3' id='st_resolved'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}>{% trans "Resolved" %} &raquo;</label>
<label class="radio-inline" for='st_closed'><input type='radio' name='new_status' value='4' id='st_closed'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}>{% trans "Closed" %} &raquo;</label>
<label class="radio-inline" for='st_duplicate'><input type='radio' name='new_status' value='5' id='st_duplicate'>{% trans "Duplicate" %}</label>
{% 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 %}
<label for='st_{{ status_choice.1|lower }}' class='{% if ticket.status == status_choice.0 %}active {% endif %}radio-inline'><input type='radio' name='new_status' value='{{ status_choice.0 }}' id='st_{{ status_choice.1|lower }}'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}{% if ticket.status == status_choice.0 %} checked='checked'{% endif %}>{{ status_choice.1 }} &raquo;</label>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endwith %}
{% endfor %}
</div></dd>
{% endif %}
{% if ticket.status == 3 %}
<dd><div class="form-group">
<label for='st_reopened' class="radio-inline"><input type='radio' name='new_status' value='2' id='st_reopened'>{% trans "Reopened" %} &laquo;</label>
<label for='st_resolved' class='active radio-inline'><input type='radio' name='new_status' value='3' id='st_resolved' checked='checked'>{% trans "Resolved" %} &raquo;</label>
<label class="radio-inline" for='st_closed'><input type='radio' name='new_status' value='4' id='st_closed'>{% trans "Closed" %}</label>
</div></dd>
{% endif %}
{% if ticket.status == 4 %}
<dd><div class="form-group"><label for='st_reopened' class="radio-inline"><input type='radio' name='new_status' value='2' id='st_reopened'>{% trans "Reopened" %} &laquo;</label>
<label class="radio-inline" for='st_closed'><input type='radio' name='new_status' value='4' id='st_closed' checked='checked'>{% trans "Closed" %}</label></div></dd>
{% endif %}
{% if ticket.status == 5 %}
<dd><div class="form-group">
<label class="radio-inline" for='st_reopened'><input type='radio' name='new_status' value='2' id='st_reopened'>{% trans "Reopened" %} &laquo;</label>
<label class="radio-inline" for='st_duplicate'><input type='radio' name='new_status' value='5' id='st_duplicate' checked='checked'>{% trans "Duplicate" %}</label>
</div></dd>
{% endif %}
<input type='hidden' name='public' value='1'>