mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-09 08:05:13 +02:00
Adds pre-defined values for public tickets
This commit adds three new settings that allow the operator to pre-define the `queue`, `priority` and `due_date` fields for public tickets. If one of these settings are present the corresponding input field is hidden from the form. The settings are the following: HELPDESK_PUBLIC_TICKET_QUEUE = 'website' HELPDESK_PUBLIC_TICKET_PRIORITY = 2 HELPDESK_PUBLIC_TICKET_DUE_DATE = '' If the due date is set to the empty string, no due date is saved in the ticket (analogously to the form). The other settings should be self-explanatory.
This commit is contained in:
@ -368,6 +368,14 @@ class PublicTicketForm(AbstractTicketForm):
|
||||
Add any (non-staff) custom fields that are defined to the form
|
||||
"""
|
||||
super(PublicTicketForm, self).__init__(*args, **kwargs)
|
||||
|
||||
if hasattr(settings, 'HELPDESK_PUBLIC_TICKET_QUEUE'):
|
||||
self.fields['queue'].widget = forms.HiddenInput()
|
||||
if hasattr(settings, 'HELPDESK_PUBLIC_TICKET_PRIORITY'):
|
||||
self.fields['priority'].widget = forms.HiddenInput()
|
||||
if hasattr(settings, 'HELPDESK_PUBLIC_TICKET_DUE_DATE'):
|
||||
self.fields['due_date'].widget = forms.HiddenInput()
|
||||
|
||||
self._add_form_custom_fields(False)
|
||||
|
||||
def save(self):
|
||||
|
Reference in New Issue
Block a user