mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-24 17:04:25 +01:00
Display custom fields in Follow-up form
This commit is contained in:
parent
4adcc7f3d3
commit
f8cccbcf0a
@ -180,6 +180,27 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm):
|
||||
return super(EditTicketForm, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class EditTicketCustomFieldForm(EditTicketForm):
|
||||
"""
|
||||
Uses the EditTicketForm logic to provide a form for Ticket custom fields.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
Add any custom fields that are defined to the form
|
||||
"""
|
||||
super(EditTicketCustomFieldForm, self).__init__(*args, **kwargs)
|
||||
|
||||
del self.fields['merged_to']
|
||||
|
||||
class Meta:
|
||||
model = Ticket
|
||||
exclude = ('title', 'queue', 'created', 'modified',
|
||||
'submitter_email', 'assigned_to', 'status',
|
||||
'on_hold', 'description', 'resolution', 'priority',
|
||||
'due_date', 'last_escalation', 'secret_key', 'kbitem')
|
||||
|
||||
|
||||
class EditFollowUpForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
|
@ -163,6 +163,10 @@
|
||||
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt>{{ customfields_form }}</dt>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
{% if ticket.checklists.exists %}
|
||||
|
@ -46,6 +46,7 @@ from helpdesk.forms import (
|
||||
CUSTOMFIELD_DATE_FORMAT,
|
||||
EditFollowUpForm,
|
||||
EditTicketForm,
|
||||
EditTicketCustomFieldForm,
|
||||
EmailIgnoreForm,
|
||||
FormControlDeleteFormSet,
|
||||
MultipleTicketSelectForm,
|
||||
@ -430,6 +431,9 @@ def view_ticket(request, ticket_id):
|
||||
default=2
|
||||
)).order_by('rank')
|
||||
|
||||
# add custom fields to further details panel
|
||||
customfields_form = EditTicketCustomFieldForm(None, instance=ticket)
|
||||
|
||||
return render(request, 'helpdesk/ticket.html', {
|
||||
'ticket': ticket,
|
||||
'dependencies': dependencies,
|
||||
@ -443,6 +447,7 @@ def view_ticket(request, ticket_id):
|
||||
'ticketcc_string': ticketcc_string,
|
||||
'SHOW_SUBSCRIBE': show_subscribe,
|
||||
'checklist_form': checklist_form,
|
||||
'customfields_form': customfields_form,
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user