forked from extern/django-helpdesk
add option 'HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO' to hide the 'case owner' on create_view if necessary.
This commit is contained in:
parent
c79ba8de01
commit
b73d7df064
@ -28,6 +28,8 @@ if type(DEFAULT_USER_SETTINGS) != type(dict()):
|
||||
'tickets_per_page': 25
|
||||
}
|
||||
|
||||
|
||||
|
||||
''' generic options - visible on all pages '''
|
||||
# redirect to login page instead of the default homepage when users visits "/"?
|
||||
HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = getattr(settings, 'HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT', False)
|
||||
@ -71,6 +73,7 @@ HELPDESK_VIEW_A_TICKET_PUBLIC = getattr(settings, 'HELPDESK_VIEW_A_TICKET_PUBLIC
|
||||
HELPDESK_SUBMIT_A_TICKET_PUBLIC = getattr(settings, 'HELPDESK_SUBMIT_A_TICKET_PUBLIC', True)
|
||||
|
||||
|
||||
|
||||
''' options for update_ticket views '''
|
||||
# allow non-staff users to interact with tickets? this will also change how 'staff_member_required'
|
||||
# in staff.py will be defined.
|
||||
@ -92,11 +95,19 @@ HELPDESK_SHOW_HOLD_BUTTON_TICKET_TOP = getattr(settings, 'HELPDESK_SHOW_HOLD_BUT
|
||||
HELPDESK_UPDATE_PUBLIC_DEFAULT = getattr(settings, 'HELPDESK_UPDATE_PUBLIC_DEFAULT', True)
|
||||
|
||||
|
||||
|
||||
''' options for staff.create_ticket view '''
|
||||
# hide the 'assigned to' / 'Case owner' field from the 'create_ticket' view?
|
||||
HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO = getattr(settings, 'HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO', False)
|
||||
|
||||
|
||||
|
||||
''' options for dashboard '''
|
||||
# show delete button next to unassigned tickets
|
||||
HELPDESK_DASHBOARD_SHOW_DELETE_UNASSIGNED = getattr(settings, 'HELPDESK_DASHBOARD_SHOW_DELETE_UNASSIGNED', True)
|
||||
|
||||
|
||||
|
||||
''' options for footer '''
|
||||
# show 'API' link at bottom of page
|
||||
HELPDESK_FOOTER_SHOW_API_LINK = getattr(settings, 'HELPDESK_FOOTER_SHOW_API_LINK', True)
|
||||
|
@ -23,6 +23,7 @@ from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.template import loader, Context, RequestContext
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.html import escape
|
||||
from django import forms
|
||||
|
||||
from helpdesk.forms import TicketForm, UserSettingsForm, EmailIgnoreForm, EditTicketForm, TicketCCForm, EditFollowUpForm, TicketDependencyForm
|
||||
from helpdesk.lib import send_templated_mail, query_to_dict, apply_query, safe_template_context
|
||||
@ -723,6 +724,8 @@ def create_ticket(request):
|
||||
form = TicketForm(initial=initial_data)
|
||||
form.fields['queue'].choices = [('', '--------')] + [[q.id, q.title] for q in Queue.objects.all()]
|
||||
form.fields['assigned_to'].choices = [('', '--------')] + [[u.id, u.username] for u in User.objects.filter(is_active=True).order_by('username')]
|
||||
if helpdesk_settings.HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO:
|
||||
form.fields['assigned_to'].widget = forms.HiddenInput()
|
||||
|
||||
return render_to_response('helpdesk/create_ticket.html',
|
||||
RequestContext(request, {
|
||||
|
Loading…
Reference in New Issue
Block a user