2008-02-06 05:36:07 +01:00
|
|
|
"""
|
2011-01-26 00:08:41 +01:00
|
|
|
django-helpdesk - A Django powered ticket tracker for small enterprise.
|
2007-12-27 01:29:17 +01:00
|
|
|
|
2008-02-06 05:36:07 +01:00
|
|
|
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
|
2007-12-27 01:29:17 +01:00
|
|
|
|
2008-08-19 10:50:38 +02:00
|
|
|
urls.py - Mapping of URL's to our various views. Note we always used NAMED
|
2008-02-06 05:36:07 +01:00
|
|
|
views for simplicity in linking later on.
|
2007-12-27 01:29:17 +01:00
|
|
|
"""
|
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
from django.conf.urls import url
|
2008-02-08 06:29:51 +01:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2016-10-21 17:14:12 +02:00
|
|
|
from django.contrib.auth import views as auth_views
|
|
|
|
from django.views.generic import TemplateView
|
2008-02-08 06:29:51 +01:00
|
|
|
|
2018-09-07 19:05:16 +02:00
|
|
|
from helpdesk.decorators import helpdesk_staff_member_required, protect_view
|
2011-06-09 17:24:33 +02:00
|
|
|
from helpdesk import settings as helpdesk_settings
|
2019-08-22 14:16:51 +02:00
|
|
|
from helpdesk.views import feeds, staff, public, kb, login
|
2018-11-07 15:01:41 +01:00
|
|
|
try:
|
|
|
|
import helpdesk.tasks
|
|
|
|
except ImportError:
|
|
|
|
pass
|
2008-02-08 06:29:51 +01:00
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
|
2013-03-18 18:57:39 +01:00
|
|
|
class DirectTemplateView(TemplateView):
|
|
|
|
extra_context = None
|
2016-10-21 17:14:12 +02:00
|
|
|
|
2013-03-18 18:57:39 +01:00
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
context = super(self.__class__, self).get_context_data(**kwargs)
|
|
|
|
if self.extra_context is not None:
|
|
|
|
for key, value in self.extra_context.items():
|
|
|
|
if callable(value):
|
|
|
|
context[key] = value()
|
|
|
|
else:
|
|
|
|
context[key] = value
|
|
|
|
return context
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2017-12-06 08:06:07 +01:00
|
|
|
|
2015-12-22 10:10:00 +01:00
|
|
|
app_name = 'helpdesk'
|
|
|
|
|
2019-10-11 15:50:35 +02:00
|
|
|
base64_pattern = r'(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$'
|
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
urlpatterns = [
|
2008-08-19 10:50:38 +02:00
|
|
|
url(r'^dashboard/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.dashboard,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='dashboard'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
|
|
|
url(r'^tickets/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.ticket_list,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='list'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2009-03-08 06:58:26 +01:00
|
|
|
url(r'^tickets/update/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.mass_update,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='mass_update'),
|
2009-03-08 06:58:26 +01:00
|
|
|
|
2020-10-29 23:32:02 +01:00
|
|
|
url(r'^tickets/merge$',
|
|
|
|
staff.merge_tickets,
|
|
|
|
name='merge_tickets'),
|
|
|
|
|
2007-12-27 01:29:17 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.view_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='view'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2011-01-29 07:02:03 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/followup_edit/(?P<followup_id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.followup_edit,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='followup_edit'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2012-08-07 15:32:45 +02:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/followup_delete/(?P<followup_id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.followup_delete,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='followup_delete'),
|
2012-08-07 15:32:45 +02:00
|
|
|
|
2009-06-03 13:43:46 +02:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/edit/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.edit_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='edit'),
|
2009-06-03 13:43:46 +02:00
|
|
|
|
2007-12-27 01:29:17 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/update/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.update_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='update'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2008-01-15 05:00:19 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/delete/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.delete_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='delete'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2008-01-16 05:52:30 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/hold/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.hold_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='hold'),
|
2008-01-15 05:00:19 +01:00
|
|
|
|
2008-01-16 05:52:30 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/unhold/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.unhold_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='unhold'),
|
2008-01-11 02:00:01 +01:00
|
|
|
|
2009-09-09 10:47:48 +02:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/cc/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.ticket_cc,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='ticket_cc'),
|
2009-09-09 10:47:48 +02:00
|
|
|
|
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/cc/add/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.ticket_cc_add,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='ticket_cc_add'),
|
2009-09-09 10:47:48 +02:00
|
|
|
|
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/cc/delete/(?P<cc_id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.ticket_cc_del,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='ticket_cc_del'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2011-05-10 11:27:11 +02:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/dependency/add/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.ticket_dependency_add,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='ticket_dependency_add'),
|
2009-09-09 10:47:48 +02:00
|
|
|
|
2011-05-10 11:27:11 +02:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/dependency/delete/(?P<dependency_id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.ticket_dependency_del,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='ticket_dependency_del'),
|
2012-04-20 00:02:28 +02:00
|
|
|
|
2011-11-19 09:34:07 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/attachment_delete/(?P<attachment_id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.attachment_del,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='attachment_del'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2008-01-11 02:00:01 +01:00
|
|
|
url(r'^raw/(?P<type>\w+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.raw_details,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='raw'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2008-02-08 06:29:51 +01:00
|
|
|
url(r'^rss/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.rss_list,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='rss_index'),
|
2008-04-02 01:26:12 +02:00
|
|
|
|
|
|
|
url(r'^reports/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.report_index,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='report_index'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2008-04-02 01:26:12 +02:00
|
|
|
url(r'^reports/(?P<report>\w+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.run_report,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='run_report'),
|
2008-08-28 11:06:24 +02:00
|
|
|
|
|
|
|
url(r'^save_query/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.save_query,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='savequery'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2008-08-28 11:06:24 +02:00
|
|
|
url(r'^delete_query/(?P<id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.delete_saved_query,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='delete_query'),
|
2008-09-09 10:32:01 +02:00
|
|
|
|
|
|
|
url(r'^settings/$',
|
2018-10-05 14:54:22 +02:00
|
|
|
staff.EditUserSettingsView.as_view(),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='user_settings'),
|
2008-10-25 00:52:34 +02:00
|
|
|
|
|
|
|
url(r'^ignore/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.email_ignore,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='email_ignore'),
|
2008-10-25 00:52:34 +02:00
|
|
|
|
|
|
|
url(r'^ignore/add/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.email_ignore_add,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='email_ignore_add'),
|
2008-10-25 00:52:34 +02:00
|
|
|
|
|
|
|
url(r'^ignore/delete/(?P<id>[0-9]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
staff.email_ignore_del,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='email_ignore_del'),
|
2018-10-15 02:23:28 +02:00
|
|
|
|
2019-10-11 15:50:35 +02:00
|
|
|
url(r'^datatables_ticket_list/(?P<query>{})$'.format(base64_pattern),
|
2018-10-15 02:23:28 +02:00
|
|
|
staff.datatables_ticket_list,
|
|
|
|
name="datatables_ticket_list"),
|
2019-10-21 19:21:22 +02:00
|
|
|
|
|
|
|
url(r'^timeline_ticket_list/(?P<query>{})$'.format(base64_pattern),
|
|
|
|
staff.timeline_ticket_list,
|
|
|
|
name="timeline_ticket_list"),
|
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
]
|
2007-12-27 01:29:17 +01:00
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
urlpatterns += [
|
2008-08-19 10:50:38 +02:00
|
|
|
url(r'^$',
|
2018-09-07 19:05:16 +02:00
|
|
|
protect_view(public.Homepage.as_view()),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='home'),
|
2008-05-21 23:16:44 +02:00
|
|
|
|
2018-09-07 19:05:16 +02:00
|
|
|
url(r'^tickets/submit/$',
|
|
|
|
public.create_ticket,
|
|
|
|
name='submit'),
|
|
|
|
|
2019-12-12 15:22:12 +01:00
|
|
|
url(r'^tickets/submit_iframe/$',
|
|
|
|
public.CreateTicketIframeView.as_view(),
|
|
|
|
name='submit_iframe'),
|
|
|
|
|
2020-01-14 17:41:55 +01:00
|
|
|
url(r'^tickets/success_iframe/$', # Ticket was submitted successfully
|
|
|
|
public.SuccessIframeView.as_view(),
|
|
|
|
name='success_iframe'),
|
|
|
|
|
2008-05-21 23:16:44 +02:00
|
|
|
url(r'^view/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
public.view_ticket,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='public_view'),
|
2011-11-27 09:26:56 +01:00
|
|
|
|
|
|
|
url(r'^change_language/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
public.change_language,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='public_change_language'),
|
2015-12-10 13:36:24 +01:00
|
|
|
]
|
2008-05-21 23:16:44 +02:00
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
urlpatterns += [
|
2014-07-15 23:02:31 +02:00
|
|
|
url(r'^rss/user/(?P<user_name>[^/]+)/$',
|
2018-08-21 16:23:25 +02:00
|
|
|
helpdesk_staff_member_required(feeds.OpenTicketsByUser()),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='rss_user'),
|
2014-07-15 23:02:31 +02:00
|
|
|
|
|
|
|
url(r'^rss/user/(?P<user_name>[^/]+)/(?P<queue_slug>[A-Za-z0-9_-]+)/$',
|
2018-08-21 16:23:25 +02:00
|
|
|
helpdesk_staff_member_required(feeds.OpenTicketsByUser()),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='rss_user_queue'),
|
2015-12-10 13:36:24 +01:00
|
|
|
|
2012-04-25 09:55:38 +02:00
|
|
|
url(r'^rss/queue/(?P<queue_slug>[A-Za-z0-9_-]+)/$',
|
2018-08-21 16:23:25 +02:00
|
|
|
helpdesk_staff_member_required(feeds.OpenTicketsByQueue()),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='rss_queue'),
|
2015-12-10 13:36:24 +01:00
|
|
|
|
2012-04-25 09:55:38 +02:00
|
|
|
url(r'^rss/unassigned/$',
|
2018-08-21 16:23:25 +02:00
|
|
|
helpdesk_staff_member_required(feeds.UnassignedTickets()),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='rss_unassigned'),
|
2015-12-10 13:36:24 +01:00
|
|
|
|
2012-04-25 09:55:38 +02:00
|
|
|
url(r'^rss/recent_activity/$',
|
2018-08-21 16:23:25 +02:00
|
|
|
helpdesk_staff_member_required(feeds.RecentFollowUps()),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='rss_activity'),
|
2015-12-10 13:36:24 +01:00
|
|
|
]
|
2008-08-19 10:50:38 +02:00
|
|
|
|
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
urlpatterns += [
|
2008-02-06 05:36:07 +01:00
|
|
|
url(r'^login/$',
|
2019-08-22 14:16:51 +02:00
|
|
|
login.login,
|
2008-02-06 05:36:07 +01:00
|
|
|
name='login'),
|
2007-12-27 01:29:17 +01:00
|
|
|
|
2008-02-06 05:36:07 +01:00
|
|
|
url(r'^logout/$',
|
2018-08-20 03:59:08 +02:00
|
|
|
auth_views.LogoutView.as_view(
|
|
|
|
template_name='helpdesk/registration/login.html',
|
|
|
|
next_page='../'),
|
2008-02-06 05:36:07 +01:00
|
|
|
name='logout'),
|
2019-03-10 00:42:10 +01:00
|
|
|
|
2019-03-10 00:38:24 +01:00
|
|
|
url(r'^password_change/$',
|
|
|
|
auth_views.PasswordChangeView.as_view(
|
|
|
|
template_name='helpdesk/registration/change_password.html',
|
|
|
|
success_url='./done'),
|
|
|
|
name='password_change'),
|
2019-03-10 00:42:10 +01:00
|
|
|
|
2019-03-10 00:38:24 +01:00
|
|
|
url(r'^password_change/done$',
|
|
|
|
auth_views.PasswordChangeDoneView.as_view(
|
|
|
|
template_name='helpdesk/registration/change_password_done.html',),
|
|
|
|
name='password_change_done'),
|
2015-12-10 13:36:24 +01:00
|
|
|
]
|
2008-05-21 23:16:44 +02:00
|
|
|
|
2011-06-09 17:24:33 +02:00
|
|
|
if helpdesk_settings.HELPDESK_KB_ENABLED:
|
2015-12-10 13:36:24 +01:00
|
|
|
urlpatterns += [
|
2011-06-09 17:24:33 +02:00
|
|
|
url(r'^kb/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
kb.index,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='kb_index'),
|
2012-04-20 00:02:28 +02:00
|
|
|
|
2011-11-05 02:23:35 +01:00
|
|
|
url(r'^kb/(?P<slug>[A-Za-z0-9_-]+)/$',
|
2015-12-10 13:36:24 +01:00
|
|
|
kb.category,
|
2015-12-22 10:10:00 +01:00
|
|
|
name='kb_category'),
|
2020-01-08 19:36:48 +01:00
|
|
|
|
2020-01-09 17:35:05 +01:00
|
|
|
url(r'^kb/(?P<item>[0-9]+)/vote/$',
|
|
|
|
kb.vote,
|
|
|
|
name='kb_vote'),
|
|
|
|
|
2020-01-08 19:36:48 +01:00
|
|
|
url(r'^kb_iframe/(?P<slug>[A-Za-z0-9_-]+)/$',
|
|
|
|
kb.category_iframe,
|
|
|
|
name='kb_category_iframe'),
|
2015-12-10 13:36:24 +01:00
|
|
|
]
|
2008-08-29 11:11:02 +02:00
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
urlpatterns += [
|
|
|
|
url(r'^help/context/$',
|
|
|
|
TemplateView.as_view(template_name='helpdesk/help_context.html'),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='help_context'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2015-12-10 13:36:24 +01:00
|
|
|
url(r'^system_settings/$',
|
2018-09-12 14:43:57 +02:00
|
|
|
login_required(DirectTemplateView.as_view(template_name='helpdesk/system_settings.html')),
|
2015-12-22 10:10:00 +01:00
|
|
|
name='system_settings'),
|
2015-12-10 13:36:24 +01:00
|
|
|
]
|