mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-16 18:20:48 +01:00
commit
e52471b49b
File diff suppressed because it is too large
Load Diff
@ -83,6 +83,12 @@ class CustomFieldMixin(object):
|
|||||||
|
|
||||||
|
|
||||||
class EditTicketForm(CustomFieldMixin, forms.ModelForm):
|
class EditTicketForm(CustomFieldMixin, forms.ModelForm):
|
||||||
|
merged_to = forms.ModelChoiceField(
|
||||||
|
label=_('Merged to'),
|
||||||
|
help_text=_('This ticket is merged into the selected ticket.'),
|
||||||
|
queryset=Ticket.objects.all(),
|
||||||
|
disabled=True
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Ticket
|
model = Ticket
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from celery import task
|
from celery.decorators import task
|
||||||
|
|
||||||
from .email import process_email
|
from .email import process_email
|
||||||
|
|
||||||
|
@ -1,58 +1,52 @@
|
|||||||
{% extends "helpdesk/base.html" %}{% load i18n bootstrap4form %}
|
{% extends "helpdesk/base.html" %}
|
||||||
|
|
||||||
|
{% load i18n bootstrap4form %}
|
||||||
|
|
||||||
{% block helpdesk_title %}{% trans "Edit Ticket" %}{% endblock %}
|
{% block helpdesk_title %}{% trans "Edit Ticket" %}{% endblock %}
|
||||||
|
|
||||||
{% block helpdesk_breadcrumb %}
|
{% block helpdesk_breadcrumb %}
|
||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="{% url 'helpdesk:list' %}">{% trans "Tickets" %}</a>
|
<a href="{% url 'helpdesk:list' %}">{% trans "Tickets" %}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="{% url 'helpdesk:list' %}{{ ticket.id }}/">{{ ticket.queue.slug }}-{{ ticket.id }}</a>
|
<a href="{% url 'helpdesk:list' %}{{ ticket.id }}/">{{ ticket.queue.slug }}-{{ ticket.id }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="breadcrumb-item active">{% trans "Edit Ticket" %}</li>
|
<li class="breadcrumb-item active">{% trans "Edit Ticket" %}</li>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block helpdesk_body %}
|
{% block helpdesk_body %}
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-body"><h2>{% trans "Edit a Ticket" %}</h2>
|
||||||
<div class="panel-body"><h2>{% trans "Edit a Ticket" %}</h2>
|
<p>
|
||||||
|
{% trans "Unless otherwise stated, all fields are required." %}
|
||||||
<p>{% trans "Unless otherwise stated, all fields are required." %} {% trans "Please provide as descriptive a title and description as possible." %}</p>
|
{% trans "Please provide as descriptive a title and description as possible." %}
|
||||||
|
</p>
|
||||||
<p><strong>{% trans "Note" %}:</strong> {% blocktrans %}Editing a ticket does <em>not</em> send an e-mail to the ticket owner or submitter. No new details should be entered, this form should only be used to fix incorrect details or clean up the submission.{% endblocktrans %}</p>
|
<p>
|
||||||
|
<strong>{% trans "Note" %}:</strong>
|
||||||
<form method='post' action='./'>
|
{% blocktrans %}Editing a ticket does <em>not</em> send an e-mail to the ticket owner or submitter. No new details should be entered, this form should only be used to fix incorrect details or clean up the submission.{% endblocktrans %}
|
||||||
<fieldset>
|
</p>
|
||||||
{{ form|bootstrap4form }}
|
<form method='post'>
|
||||||
{% comment %}
|
{% csrf_token %}
|
||||||
{% for field in form %}
|
<fieldset>
|
||||||
{% if field.is_hidden %}
|
{{ form|bootstrap4form }}
|
||||||
{{ field }}
|
<div class='buttons form-group'>
|
||||||
{% else %}
|
<input type='submit' class="btn btn-primary btn-sm" value='{% trans "Save Changes" %}'/>
|
||||||
<dt><label for='id_{{ field.name }}'>{{ field.label }}</label>{% if not field.field.required %} <span class='form_optional'>{% trans "(Optional)" %}</span>{% endif %}</dt>
|
<a href='{{ ticket.get_absolute_url }}'>
|
||||||
<dd>{{ field }}</dd>
|
<button class="btn btn-danger">{% trans "Cancel Changes" %}</button>
|
||||||
{% if field.errors %}<dd class='error'>{{ field.errors }}</dd>{% endif %}
|
</a>
|
||||||
{% if field.help_text %}<dd class='form_help_text'>{{ field.help_text }}</dd>{% endif %}</label>
|
</div>
|
||||||
{% endif %}
|
</fieldset>
|
||||||
{% endfor %}
|
</form>
|
||||||
</dl>
|
</div>
|
||||||
{% endcomment %}
|
</div>
|
||||||
<div class='buttons form-group'>
|
|
||||||
<input type='submit' class="btn btn-primary btn-sm" value='{% trans "Save Changes" %}' />
|
|
||||||
<a href='{{ ticket.get_absolute_url }}'><button class="btn btn-danger">{% trans "Cancel Changes" %}</button></a>
|
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
{% endblock %}
|
||||||
|
|
||||||
{% csrf_token %}</form>
|
{% block helpdesk_js %}
|
||||||
</div>
|
<script>
|
||||||
</div>
|
$(() => {
|
||||||
</div>
|
$("#id_due_date").datepicker({dateFormat: 'yy-mm-dd'});
|
||||||
|
})
|
||||||
<script>
|
</script>
|
||||||
$( function() {
|
|
||||||
$( "#id_due_date" ).datepicker({dateFormat: 'yy-mm-dd'});
|
|
||||||
} );
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<td>{{ ticket.priority }}</td>
|
<td>{{ ticket.priority }}</td>
|
||||||
<td>{{ ticket.queue }}</td>
|
<td>{{ ticket.queue }}</td>
|
||||||
<td>{{ ticket.get_status }}</td>
|
<td>{{ ticket.get_status }}</td>
|
||||||
<td><span title='{{ ticket.modified|date }}'>{{ ticket.modified|naturaltime }}</span></td>
|
<td><span title='{{ ticket.modified|date:"DATETIME_FORMAT" }}'>{{ ticket.modified|naturaltime }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>{% if ticket_list_empty_message %}<td colspan='6'>{{ ticket_list_empty_message }}</td>{% else %}<td colspan='6'>{% trans "You do not have any pending tickets." %}</td>{% endif %}</tr>
|
<tr>{% if ticket_list_empty_message %}<td colspan='6'>{{ ticket_list_empty_message }}</td>{% else %}<td colspan='6'>{% trans "You do not have any pending tickets." %}</td>{% endif %}</tr>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<td class="tickettitle"><a href='{{ ticket.get_absolute_url }}'>{{ ticket.id }}. {{ ticket.title }} </a></td>
|
<td class="tickettitle"><a href='{{ ticket.get_absolute_url }}'>{{ ticket.id }}. {{ ticket.title }} </a></td>
|
||||||
<td>{{ ticket.priority }}</td>
|
<td>{{ ticket.priority }}</td>
|
||||||
<td>{{ ticket.queue }}</td>
|
<td>{{ ticket.queue }}</td>
|
||||||
<td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|naturaltime }}</span></td>
|
<td><span title='{{ ticket.created|date:"DATETIME_FORMAT" }}'>{{ ticket.created|naturaltime }}</span></td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href='{{ ticket.get_absolute_url }}?take'><button class='btn btn-primary btn-sm'><i class="fas fa-hand-paper"></i> {% trans "Take" %}</button></a>
|
<a href='{{ ticket.get_absolute_url }}?take'><button class='btn btn-primary btn-sm'><i class="fas fa-hand-paper"></i> {% trans "Take" %}</button></a>
|
||||||
<a href='{% url 'helpdesk:delete' ticket.id %}?next=dashboard'><button class='btn btn-danger btn-sm'><i class="fas fa-trash"></i> {% trans "Delete" %}</button></a>
|
<a href='{% url 'helpdesk:delete' ticket.id %}?next=dashboard'><button class='btn btn-danger btn-sm'><i class="fas fa-trash"></i> {% trans "Delete" %}</button></a>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<td class="tickettitle"><a href='{{ ticket.get_absolute_url }}'>{{ ticket.id }}. {{ ticket.title }} </a></td>
|
<td class="tickettitle"><a href='{{ ticket.get_absolute_url }}'>{{ ticket.id }}. {{ ticket.title }} </a></td>
|
||||||
<td>{{ ticket.priority }}</td>
|
<td>{{ ticket.priority }}</td>
|
||||||
<td>{{ ticket.queue }}</td>
|
<td>{{ ticket.queue }}</td>
|
||||||
<td><span title='{{ ticket.created|date }}'>{{ ticket.created|naturaltime }}</span></td>
|
<td><span title='{{ ticket.created|date:"DATETIME_FORMAT" }}'>{{ ticket.created|naturaltime }}</span></td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href='{{ ticket.get_absolute_url }}?take'><button class='btn btn-primary btn-sm'><i class="fas fa-hand-paper"></i> {% trans "Take" %}</button></a>
|
<a href='{{ ticket.get_absolute_url }}?take'><button class='btn btn-primary btn-sm'><i class="fas fa-hand-paper"></i> {% trans "Take" %}</button></a>
|
||||||
<a href='{% url 'helpdesk:delete' ticket.id %}?next=dashboard'><button class='btn btn-danger btn-sm'><i class="fas fa-trash"></i> {% trans "Delete" %}</button></a>
|
<a href='{% url 'helpdesk:delete' ticket.id %}?next=dashboard'><button class='btn btn-danger btn-sm'><i class="fas fa-trash"></i> {% trans "Delete" %}</button></a>
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href='{% if iframe %}{% url 'helpdesk:submit_iframe' %}{% else %}{% url 'helpdesk:submit' %}{%endif%}?{% if category.queue %}queue={{category.queue.pk}};_readonly_fields_=queue;{%endif%}kbitem={{item.id}};{{query_param_string}}' class="col-sm">
|
<a href='{% if iframe %}{% url 'helpdesk:submit_iframe' %}{% else %}{% url 'helpdesk:submit' %}{%endif%}?{% if category.queue %}queue={{category.queue.pk}};_readonly_fields_=queue;{%endif%}kbitem={{item.id}};{{query_param_string}}' class="col-sm">
|
||||||
<div class="btn btn-success btn-circle btn-xl float-right"><i class="fa fa-envelope fa-lg"></i> {% trans 'Contact a human' %}</div>
|
<div class="btn btn-success btn-circle btn-xl float-right"><i class="fa fa-plus-circle fa-lg"></i> {% trans 'Create New Ticket' %}{% trans " Queue: " %}{{item}}</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
{% if category.queue %}
|
{% if category.queue %}
|
||||||
<a href='{% if iframe %}{% url 'helpdesk:submit_iframe' %}{% else %}{% url 'helpdesk:submit' %}{%endif%}?queue={{category.queue.pk}};_readonly_fields_=queue;{{query_param_string}}'>
|
<a href='{% if iframe %}{% url 'helpdesk:submit_iframe' %}{% else %}{% url 'helpdesk:submit' %}{%endif%}?queue={{category.queue.pk}};_readonly_fields_=queue;{{query_param_string}}'>
|
||||||
{% block submit_button %}
|
{% block submit_button %}
|
||||||
<div class="btn btn-danger btn-circle btn-xl float-right"><i class="fa fa-envelope fa-lg"></i> {% trans 'Contact a human' %}</div>
|
<div class="btn btn-danger btn-circle btn-xl float-right"><i class="fa fa-plus-circle fa-lg"></i> {% trans 'Create New Ticket' %}{% if category.queue %}{% trans " Queue: " %}{{category.queue}}{% endif %}</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -12,13 +12,13 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Submitted On" %}</th>
|
<th>{% trans "Submitted On" %}</th>
|
||||||
<td>{{ ticket.created|date }} ({{ ticket.created|naturaltime }})</td>
|
<td>{{ ticket.created|date:"DATETIME_FORMAT" }} ({{ ticket.created|naturaltime }})</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% if ticket.due_date %}
|
{% if ticket.due_date %}
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Due On" %}</th>
|
<th>{% trans "Due On" %}</th>
|
||||||
<td>{{ ticket.due_date|date }} ({{ ticket.due_date|naturaltime }})</td>
|
<td>{{ ticket.due_date|date:"DATETIME_FORMAT" }} ({{ ticket.due_date|naturaltime }})</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@
|
|||||||
{% load ticket_to_link %}
|
{% load ticket_to_link %}
|
||||||
{% for followup in ticket.followup_set.public_followups %}
|
{% for followup in ticket.followup_set.public_followups %}
|
||||||
<div class='followup well'>
|
<div class='followup well'>
|
||||||
<div class='title'>{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date }}'>{{ followup.date|naturaltime }}</span></span></div>
|
<div class='title'>{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"DATETIME_FORMAT" }}'>{{ followup.date|naturaltime }}</span></span></div>
|
||||||
{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}
|
{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}
|
||||||
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
||||||
{% for change in followup.ticketchange_set.all %}
|
{% for change in followup.ticketchange_set.all %}
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<div class="list-group-item list-group-item-action">
|
<div class="list-group-item list-group-item-action">
|
||||||
<div class="d-flex w-100 justify-content-between">
|
<div class="d-flex w-100 justify-content-between">
|
||||||
<h5 class="mb-1">{{ followup.title|num_to_link }}</h5>
|
<h5 class="mb-1">{{ followup.title|num_to_link }}</h5>
|
||||||
<small><i class="fas fa-clock"></i> <span class='byline text-info'>{% if followup.user %}by {{ followup.user }},{% endif %} <span title='{{ followup.date|date }}'>{{ followup.date|naturaltime }}</span>{% if followup.time_spent %}, <span>{% trans "time spent" %}: {{ followup.time_spent_formated }}</span>{% endif %} {% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}</span></small>
|
<small><i class="fas fa-clock"></i> <span class='byline text-info'>{% if followup.user %}by {{ followup.user }},{% endif %} <span title='{{ followup.date|date:"DATETIME_FORMAT" }}'>{{ followup.date|naturaltime }}</span>{% if followup.time_spent %}, <span>{% trans "time spent" %}: {{ followup.time_spent_formated }}</span>{% endif %} {% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}</span></small>
|
||||||
</div>
|
</div>
|
||||||
<p class="mb-1">
|
<p class="mb-1">
|
||||||
{% if followup.comment %}
|
{% if followup.comment %}
|
||||||
|
@ -33,15 +33,15 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="table-active">{% trans "Assigned To" %}</th>
|
<th class="table-active">{% trans "Assigned To" %}</th>
|
||||||
<td>{{ ticket.get_assigned_to }}{% ifequal ticket.get_assigned_to _('Unassigned') %} <strong>
|
<td>{{ ticket.get_assigned_to }}{% ifequal ticket.get_assigned_to _('Unassigned') %} <strong>
|
||||||
<a href='?take'><button type="button" class="btn btn-primary btn-sm float-right"><i class="fas fa-hand-paper"></i></button></a>
|
<a data-toggle="tooltip" href='?take' title='{% trans "Assign this ticket to " %}{{ request.user.email }}'><button type="button" class="btn btn-primary btn-sm float-right"><i class="fas fa-hand-paper"></i></button></a>
|
||||||
</strong>{% endifequal %}
|
</strong>{% endifequal %}
|
||||||
</td>
|
</td>
|
||||||
<th class="table-active">{% trans "Submitter E-Mail" %}</th>
|
<th class="table-active">{% trans "Submitter E-Mail" %}</th>
|
||||||
<td> {{ ticket.submitter_email }}
|
<td> {{ ticket.submitter_email }}
|
||||||
{% if user.is_superuser %} {% if submitter_userprofile_url %}<strong><a href='{{submitter_userprofile_url}}'><button type="button" class="btn btn-primary btn-sm"><i class="fas fa-address-book"></i></button></a></strong>{% endif %}
|
{% if user.is_superuser %} {% if submitter_userprofile_url %}<strong><a data-toggle="tooltip" href='{{submitter_userprofile_url}}' title='{% trans "Edit " %}{{ ticket.submitter_email }}{% trans " user profile" %}'><button type="button" class="btn btn-primary btn-sm"><i class="fas fa-address-book"></i></button></a></strong>{% endif %}
|
||||||
<strong><a href ="{% url 'helpdesk:list'%}?q={{ticket.submitter_email}}">
|
<strong><a data-toggle="tooltip" href ="{% url 'helpdesk:list'%}?q={{ticket.submitter_email}}" title='{% trans "Display tickets filtered for " %}{{ ticket.submitter_email }}{% trans " as a keyword" %}'>
|
||||||
<button type="button" class="btn btn-primary btn-sm"><i class="fas fa-search"></i></button></a></strong>
|
<button type="button" class="btn btn-primary btn-sm"><i class="fas fa-search"></i></button></a></strong>
|
||||||
<strong><a href='{% url 'helpdesk:email_ignore_add' %}?email={{ ticket.submitter_email }}'>
|
<strong><a data-toggle="tooltip" href='{% url 'helpdesk:email_ignore_add' %}?email={{ ticket.submitter_email }}' title='{% trans "Add email address for the ticket system to ignore." %}'>
|
||||||
<button type="button" class="btn btn-warning btn-sm float-right"><i class="fas fa-eye-slash"></i></button></a></strong>{% endif %}
|
<button type="button" class="btn btn-warning btn-sm float-right"><i class="fas fa-eye-slash"></i></button></a></strong>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -1213,13 +1213,10 @@ def edit_ticket(request, ticket_id):
|
|||||||
ticket = get_object_or_404(Ticket, id=ticket_id)
|
ticket = get_object_or_404(Ticket, id=ticket_id)
|
||||||
ticket_perm_check(request, ticket)
|
ticket_perm_check(request, ticket)
|
||||||
|
|
||||||
if request.method == 'POST':
|
form = EditTicketForm(request.POST or None, instance=ticket)
|
||||||
form = EditTicketForm(request.POST, instance=ticket)
|
if form.is_valid():
|
||||||
if form.is_valid():
|
ticket = form.save()
|
||||||
ticket = form.save()
|
return redirect(ticket)
|
||||||
return HttpResponseRedirect(ticket.get_absolute_url())
|
|
||||||
else:
|
|
||||||
form = EditTicketForm(instance=ticket)
|
|
||||||
|
|
||||||
return render(request, 'helpdesk/edit_ticket.html', {'form': form, 'ticket': ticket})
|
return render(request, 'helpdesk/edit_ticket.html', {'form': form, 'ticket': ticket})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user