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
|
|
|
"""
|
|
|
|
|
2008-11-18 00:51:09 +01:00
|
|
|
from django.conf import settings
|
2013-03-18 19:58:07 +01:00
|
|
|
import django
|
|
|
|
if django.get_version().startswith("1.3"):
|
|
|
|
from django.conf.urls.defaults import *
|
|
|
|
else:
|
|
|
|
from django.conf.urls import *
|
2008-02-08 06:29:51 +01:00
|
|
|
from django.contrib.auth.decorators import login_required
|
|
|
|
|
2011-06-09 17:24:33 +02:00
|
|
|
from helpdesk import settings as helpdesk_settings
|
2012-04-25 09:55:38 +02:00
|
|
|
from helpdesk.views import feeds
|
2008-02-08 06:29:51 +01:00
|
|
|
|
2013-03-18 18:57:39 +01:00
|
|
|
from django.views.generic import TemplateView
|
|
|
|
class DirectTemplateView(TemplateView):
|
|
|
|
extra_context = None
|
|
|
|
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
|
|
|
|
|
2008-05-21 23:16:44 +02:00
|
|
|
urlpatterns = patterns('helpdesk.views.staff',
|
2008-08-19 10:50:38 +02:00
|
|
|
url(r'^dashboard/$',
|
2007-12-27 01:29:17 +01:00
|
|
|
'dashboard',
|
2008-05-21 23:16:44 +02:00
|
|
|
name='helpdesk_dashboard'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
|
|
|
url(r'^tickets/$',
|
2007-12-27 01:29:17 +01:00
|
|
|
'ticket_list',
|
|
|
|
name='helpdesk_list'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2009-03-08 06:58:26 +01:00
|
|
|
url(r'^tickets/update/$',
|
|
|
|
'mass_update',
|
|
|
|
name='helpdesk_mass_update'),
|
|
|
|
|
2008-08-19 10:50:38 +02:00
|
|
|
url(r'^tickets/submit/$',
|
2007-12-27 01:29:17 +01:00
|
|
|
'create_ticket',
|
|
|
|
name='helpdesk_submit'),
|
|
|
|
|
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/$',
|
|
|
|
'view_ticket',
|
|
|
|
name='helpdesk_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]+)/$',
|
|
|
|
'followup_edit',
|
|
|
|
name='helpdesk_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]+)/$',
|
|
|
|
'followup_delete',
|
|
|
|
name='helpdesk_followup_delete'),
|
|
|
|
|
2009-06-03 13:43:46 +02:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/edit/$',
|
|
|
|
'edit_ticket',
|
|
|
|
name='helpdesk_edit'),
|
|
|
|
|
2007-12-27 01:29:17 +01:00
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/update/$',
|
|
|
|
'update_ticket',
|
2008-01-07 21:22:13 +01:00
|
|
|
name='helpdesk_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/$',
|
|
|
|
'delete_ticket',
|
|
|
|
name='helpdesk_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/$',
|
|
|
|
'hold_ticket',
|
|
|
|
name='helpdesk_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/$',
|
|
|
|
'unhold_ticket',
|
|
|
|
name='helpdesk_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/$',
|
|
|
|
'ticket_cc',
|
|
|
|
name='helpdesk_ticket_cc'),
|
|
|
|
|
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/cc/add/$',
|
|
|
|
'ticket_cc_add',
|
|
|
|
name='helpdesk_ticket_cc_add'),
|
|
|
|
|
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/cc/delete/(?P<cc_id>[0-9]+)/$',
|
|
|
|
'ticket_cc_del',
|
|
|
|
name='helpdesk_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/$',
|
|
|
|
'ticket_dependency_add',
|
|
|
|
name='helpdesk_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]+)/$',
|
|
|
|
'ticket_dependency_del',
|
|
|
|
name='helpdesk_ticket_dependency_del'),
|
2011-11-19 09:34:07 +01:00
|
|
|
|
|
|
|
url(r'^tickets/(?P<ticket_id>[0-9]+)/attachment_delete/(?P<attachment_id>[0-9]+)/$',
|
|
|
|
'attachment_del',
|
|
|
|
name='helpdesk_attachment_del'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2008-01-11 02:00:01 +01:00
|
|
|
url(r'^raw/(?P<type>\w+)/$',
|
|
|
|
'raw_details',
|
|
|
|
name='helpdesk_raw'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2008-02-08 06:29:51 +01:00
|
|
|
url(r'^rss/$',
|
|
|
|
'rss_list',
|
|
|
|
name='helpdesk_rss_index'),
|
2008-04-02 01:26:12 +02:00
|
|
|
|
|
|
|
url(r'^reports/$',
|
|
|
|
'report_index',
|
|
|
|
name='helpdesk_report_index'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2008-04-02 01:26:12 +02:00
|
|
|
url(r'^reports/(?P<report>\w+)/$',
|
|
|
|
'run_report',
|
|
|
|
name='helpdesk_run_report'),
|
2008-08-28 11:06:24 +02:00
|
|
|
|
|
|
|
url(r'^save_query/$',
|
|
|
|
'save_query',
|
|
|
|
name='helpdesk_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]+)/$',
|
|
|
|
'delete_saved_query',
|
|
|
|
name='helpdesk_delete_query'),
|
2008-09-09 10:32:01 +02:00
|
|
|
|
|
|
|
url(r'^settings/$',
|
|
|
|
'user_settings',
|
|
|
|
name='helpdesk_user_settings'),
|
2008-10-25 00:52:34 +02:00
|
|
|
|
|
|
|
url(r'^ignore/$',
|
|
|
|
'email_ignore',
|
|
|
|
name='helpdesk_email_ignore'),
|
|
|
|
|
|
|
|
url(r'^ignore/add/$',
|
|
|
|
'email_ignore_add',
|
|
|
|
name='helpdesk_email_ignore_add'),
|
|
|
|
|
|
|
|
url(r'^ignore/delete/(?P<id>[0-9]+)/$',
|
|
|
|
'email_ignore_del',
|
|
|
|
name='helpdesk_email_ignore_del'),
|
2007-12-27 01:29:17 +01:00
|
|
|
)
|
|
|
|
|
2008-05-21 23:16:44 +02:00
|
|
|
urlpatterns += patterns('helpdesk.views.public',
|
2008-08-19 10:50:38 +02:00
|
|
|
url(r'^$',
|
2008-05-21 23:16:44 +02:00
|
|
|
'homepage',
|
|
|
|
name='helpdesk_home'),
|
|
|
|
|
|
|
|
url(r'^view/$',
|
|
|
|
'view_ticket',
|
|
|
|
name='helpdesk_public_view'),
|
2011-11-27 09:26:56 +01:00
|
|
|
|
|
|
|
url(r'^change_language/$',
|
|
|
|
'change_language',
|
|
|
|
name='helpdesk_public_change_language'),
|
2008-05-21 23:16:44 +02:00
|
|
|
)
|
|
|
|
|
2008-02-08 06:29:51 +01:00
|
|
|
urlpatterns += patterns('',
|
2012-08-07 12:32:23 +02:00
|
|
|
url(r'^rss/user/(?P<user_name>[\.A-Za-z0-9_-]+)/$',
|
2012-04-25 09:55:38 +02:00
|
|
|
login_required(feeds.OpenTicketsByUser()),
|
|
|
|
name='helpdesk_rss_user'),
|
|
|
|
|
2012-08-07 12:32:23 +02:00
|
|
|
url(r'^rss/user/(?P<user_name>[\.A-Za-z0-9_-]+)/(?P<queue_slug>[A-Za-z0-9_-]+)/$',
|
2012-04-25 09:55:38 +02:00
|
|
|
login_required(feeds.OpenTicketsByUser()),
|
|
|
|
name='helpdesk_rss_user_queue'),
|
|
|
|
|
|
|
|
url(r'^rss/queue/(?P<queue_slug>[A-Za-z0-9_-]+)/$',
|
|
|
|
login_required(feeds.OpenTicketsByQueue()),
|
|
|
|
name='helpdesk_rss_queue'),
|
|
|
|
|
|
|
|
url(r'^rss/unassigned/$',
|
|
|
|
login_required(feeds.UnassignedTickets()),
|
|
|
|
name='helpdesk_rss_unassigned'),
|
|
|
|
|
|
|
|
url(r'^rss/recent_activity/$',
|
|
|
|
login_required(feeds.RecentFollowUps()),
|
|
|
|
name='helpdesk_rss_activity'),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2012-04-25 09:55:38 +02:00
|
|
|
urlpatterns += patterns('',
|
2008-02-06 05:36:07 +01:00
|
|
|
url(r'^api/(?P<method>[a-z_-]+)/$',
|
2008-05-21 23:16:44 +02:00
|
|
|
'helpdesk.views.api.api',
|
2008-02-06 05:36:07 +01:00
|
|
|
name='helpdesk_api'),
|
2008-04-02 01:34:24 +02:00
|
|
|
|
2008-02-06 05:36:07 +01:00
|
|
|
url(r'^login/$',
|
|
|
|
'django.contrib.auth.views.login',
|
2011-02-02 09:05:33 +01:00
|
|
|
{'template_name': 'helpdesk/registration/login.html'},
|
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/$',
|
|
|
|
'django.contrib.auth.views.logout',
|
2011-02-02 09:05:33 +01:00
|
|
|
{'template_name': 'helpdesk/registration/login.html', 'next_page': '../'},
|
2008-02-06 05:36:07 +01:00
|
|
|
name='logout'),
|
2007-12-27 01:29:17 +01:00
|
|
|
)
|
2008-05-21 23:16:44 +02:00
|
|
|
|
2011-06-09 17:24:33 +02:00
|
|
|
if helpdesk_settings.HELPDESK_KB_ENABLED:
|
|
|
|
urlpatterns += patterns('helpdesk.views.kb',
|
|
|
|
url(r'^kb/$',
|
|
|
|
'index', name='helpdesk_kb_index'),
|
2011-11-05 02:23:35 +01:00
|
|
|
|
2011-06-09 17:24:33 +02:00
|
|
|
url(r'^kb/(?P<item>[0-9]+)/$',
|
|
|
|
'item', name='helpdesk_kb_item'),
|
2008-08-19 10:50:38 +02:00
|
|
|
|
2011-06-09 17:24:33 +02:00
|
|
|
url(r'^kb/(?P<item>[0-9]+)/vote/$',
|
|
|
|
'vote', name='helpdesk_kb_vote'),
|
2011-11-05 02:23:35 +01:00
|
|
|
|
|
|
|
url(r'^kb/(?P<slug>[A-Za-z0-9_-]+)/$',
|
|
|
|
'category', name='helpdesk_kb_category'),
|
2011-06-09 17:24:33 +02:00
|
|
|
)
|
2008-08-29 11:11:02 +02:00
|
|
|
|
|
|
|
urlpatterns += patterns('',
|
2013-03-18 18:57:39 +01:00
|
|
|
url(r'^api/$',TemplateView.as_view(template_name='helpdesk/help_api.html'),
|
2008-08-29 11:11:02 +02:00
|
|
|
name='helpdesk_api_help'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2013-03-18 18:57:39 +01:00
|
|
|
url(r'^help/context/$',TemplateView.as_view(template_name='helpdesk/help_context.html'),
|
2008-08-29 11:11:02 +02:00
|
|
|
name='helpdesk_help_context'),
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2013-03-18 18:57:39 +01:00
|
|
|
url(r'^system_settings/$',DirectTemplateView.as_view(template_name='helpdesk/system_settings.html',
|
|
|
|
extra_context={'ADMIN_URL': getattr(settings, 'ADMIN_URL', '/admin/')}),
|
|
|
|
name='helpdesk_system_settings'),
|
2008-08-29 11:11:02 +02:00
|
|
|
)
|