diff --git a/README.rst b/README.rst index 59661e06..f094f27b 100644 --- a/README.rst +++ b/README.rst @@ -26,11 +26,11 @@ Dependencies (pre-flight checklist) ----------------------------------- 1. Python 2.5+ -2. Django (1.3 or newer) +2. Django (1.4 or newer) 3. South for database migrations (highly recommended, but not required). Download from http://south.aeracode.org/ 4. An existing WORKING Django project with database etc. If you cannot log into the Admin, you won't get this product working. -5. You must have ``django.contrib.markup`` in your ``settings.INSTALLED_APPS`` setting. +5. `pip install django-bootstrap-form` and add `bootstrapform` to `settings.INSTALLED_APPS` **NOTE REGARDING SQLITE AND SEARCHING:** If you use sqlite as your database, the search function will not work as @@ -55,13 +55,6 @@ If you do NOT do this step, and you only want to use English-language templates, you can continue however you will receive a warning when running the 'migrate' commands. -Tagging -------- - -If you use Django-tagging and want to tag your Helpdesk tickets, ensure that -django-tagging is installed and you have done a ``syncdb`` **before** you -add ``helpdesk`` to your ``INSTALLED_APPS``. - Fresh Django Installations -------------------------- diff --git a/helpdesk/forms.py b/helpdesk/forms.py index 545f60a7..11d94f45 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -22,7 +22,6 @@ except ImportError: from helpdesk.lib import send_templated_mail, safe_template_context from helpdesk.models import Ticket, Queue, FollowUp, Attachment, IgnoreEmail, TicketCC, CustomField, TicketCustomFieldValue, TicketDependency -from helpdesk.settings import HAS_TAG_SUPPORT from helpdesk import settings as helpdesk_settings class EditTicketForm(forms.ModelForm): @@ -176,17 +175,6 @@ class TicketForm(forms.Form): help_text=_('You can attach a file such as a document or screenshot to this ticket.'), ) - if HAS_TAG_SUPPORT: - tags = forms.CharField( - max_length=255, - required=False, - widget=forms.TextInput(), - label=_('Tags'), - help_text=_('Words, separated by spaces, or phrases separated by commas. ' - 'These should communicate significant characteristics of this ' - 'ticket'), - ) - def __init__(self, *args, **kwargs): """ Add any custom fields that are defined to the form @@ -255,9 +243,6 @@ class TicketForm(forms.Form): due_date = self.cleaned_data['due_date'], ) - if HAS_TAG_SUPPORT: - t.tags = self.cleaned_data['tags'] - if self.cleaned_data['assigned_to']: try: u = User.objects.get(id=self.cleaned_data['assigned_to']) diff --git a/helpdesk/models.py b/helpdesk/models.py index ad6ba7c4..4c5b2842 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -21,11 +21,6 @@ try: except ImportError: from datetime import datetime as timezone -from helpdesk.settings import HAS_TAG_SUPPORT - -if HAS_TAG_SUPPORT: - from tagging.fields import TagField - class Queue(models.Model): """ A queue is a collection of tickets into what would generally be business @@ -445,9 +440,6 @@ class Ticket(models.Model): return TicketDependency.objects.filter(ticket=self).filter(depends_on__status__in=OPEN_STATUSES).count() == 0 can_be_resolved = property(_can_be_resolved) - if HAS_TAG_SUPPORT: - tags = TagField(blank=True) - class Meta: get_latest_by = "created" diff --git a/helpdesk/settings.py b/helpdesk/settings.py index 9b05a5b0..d5bef863 100644 --- a/helpdesk/settings.py +++ b/helpdesk/settings.py @@ -6,12 +6,6 @@ Default settings for django-helpdesk. from django.conf import settings -# check for django-tagging support -HAS_TAG_SUPPORT = 'tagging' in settings.INSTALLED_APPS -try: - import tagging -except ImportError: - HAS_TAG_SUPPORT = False try: DEFAULT_USER_SETTINGS = settings.HELPDESK_DEFAULT_SETTINGS @@ -154,3 +148,5 @@ QUEUE_EMAIL_BOX_SSL = getattr(settings, 'QUEUE_EMAIL_BOX_SSL', None) QUEUE_EMAIL_BOX_HOST = getattr(settings, 'QUEUE_EMAIL_BOX_HOST', None) QUEUE_EMAIL_BOX_USER = getattr(settings, 'QUEUE_EMAIL_BOX_USER', None) QUEUE_EMAIL_BOX_PASSWORD = getattr(settings, 'QUEUE_EMAIL_BOX_PASSWORD', None) + +HAS_TAG_SUPPORT = False diff --git a/helpdesk/templates/helpdesk/ticket.html b/helpdesk/templates/helpdesk/ticket.html index ce9584c8..21c902cc 100644 --- a/helpdesk/templates/helpdesk/ticket.html +++ b/helpdesk/templates/helpdesk/ticket.html @@ -186,11 +186,6 @@ function googleTranslateElementInit() {
{{ form.due_date }}
- {% if tags_enabled %} -
-
- {% endif %} - diff --git a/helpdesk/templates/helpdesk/ticket_desc_table.html b/helpdesk/templates/helpdesk/ticket_desc_table.html index ea0c3393..b735e5dd 100644 --- a/helpdesk/templates/helpdesk/ticket_desc_table.html +++ b/helpdesk/templates/helpdesk/ticket_desc_table.html @@ -58,13 +58,6 @@ {{ ticketcc_string }} {% trans "Manage" %}{% trans "Click here to add / remove people who should receive an e-mail whenever this ticket is updated." %}{% if SHOW_SUBSCRIBE %}, {% trans "Subscribe" %}{% trans "Click here to subscribe yourself to this ticket, if you want to receive an e-mail whenever this ticket is updated." %}{% endif %} -{% if tags_enabled %} - - {% trans "Tags" %} - {{ ticket.tags }} - -{% endif %} - {% trans "Dependencies" %} {% for dep in ticket.ticketdependency.all %} diff --git a/helpdesk/templates/helpdesk/ticket_list.html b/helpdesk/templates/helpdesk/ticket_list.html index fa648611..159b28a2 100644 --- a/helpdesk/templates/helpdesk/ticket_list.html +++ b/helpdesk/templates/helpdesk/ticket_list.html @@ -69,9 +69,6 @@ $(document).ready(function() { - {% if tags_enabled %} - - {% endif %} {% csrf_token %} @@ -137,14 +134,6 @@ $(document).ready(function() { -{% if tags_enabled %} -
- -

{% trans "Ctrl-click to select multiple options" %}

- -
-{% endif %} -

{% trans "Keywords are case-insensitive, and will be looked for in the title, body and submitter fields." %}

@@ -232,7 +221,7 @@ $(document).ready(function() { -{% if tags_enabled %}{% endif %} + {% if tickets %}{% for ticket in tickets.object_list %} @@ -245,7 +234,6 @@ $(document).ready(function() { -{% if tags_enabled %}{% endif %} {% endfor %}{% else %} @@ -273,4 +261,4 @@ $(document).ready(function() {

{% csrf_token %} {% endblock %} - \ No newline at end of file + diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 2af5bd5d..8889e4ac 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -34,12 +34,8 @@ except ImportError: 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 from helpdesk.models import Ticket, Queue, FollowUp, TicketChange, PreSetReply, Attachment, SavedSearch, IgnoreEmail, TicketCC, TicketDependency -from helpdesk.settings import HAS_TAG_SUPPORT from helpdesk import settings as helpdesk_settings -if HAS_TAG_SUPPORT: - from tagging.models import Tag, TaggedItem - if helpdesk_settings.HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE: # treat 'normal' users like 'staff' staff_member_required = user_passes_test(lambda u: u.is_authenticated() and u.is_active) @@ -272,7 +268,6 @@ def view_ticket(request, ticket_id): 'active_users': users, 'priorities': Ticket.PRIORITY_CHOICES, 'preset_replies': PreSetReply.objects.filter(Q(queues=ticket.queue) | Q(queues__isnull=True)), - 'tags_enabled': HAS_TAG_SUPPORT, 'ticketcc_string': ticketcc_string, 'SHOW_SUBSCRIBE': SHOW_SUBSCRIBE, })) @@ -346,7 +341,6 @@ def update_ticket(request, ticket_id, public=False): else: due_date = timezone.now() due_date = due_date.replace(due_date_year, due_date_month, due_date_day) - tags = request.POST.get('tags', '') no_changes = all([ not request.FILES, @@ -356,7 +350,6 @@ def update_ticket(request, ticket_id, public=False): priority == int(ticket.priority), due_date == ticket.due_date, (owner == -1) or (not owner and not ticket.assigned_to) or (owner and User.objects.get(id=owner) == ticket.assigned_to), - (HAS_TAG_SUPPORT and tags == ticket.tags) or not HAS_TAG_SUPPORT, ]) if no_changes: return return_to_ticket(request.user, helpdesk_settings, ticket) @@ -463,17 +456,6 @@ def update_ticket(request, ticket_id, public=False): c.save() ticket.due_date = due_date - if HAS_TAG_SUPPORT: - if tags != ticket.tags: - c = TicketChange( - followup=f, - field=_('Tags'), - old_value=ticket.tags, - new_value=tags, - ) - c.save() - ticket.tags = tags - if new_status in [ Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS ]: if new_status == Ticket.RESOLVED_STATUS or ticket.resolution is None: ticket.resolution = comment @@ -745,7 +727,7 @@ def ticket_list(request): or request.GET.has_key('q') or request.GET.has_key('sort') or request.GET.has_key('sortreverse') - or request.GET.has_key('tags') ): + ): # Fall-back if no querying is being done, force the list to only # show open/reopened/resolved (not closed) cases sorted by creation @@ -821,13 +803,6 @@ def ticket_list(request): } ticket_qs = apply_query(Ticket.objects.select_related(), query_params) - ## TAG MATCHING - if HAS_TAG_SUPPORT: - tags = request.GET.getlist('tags') - if tags: - ticket_qs = TaggedItem.objects.get_by_model(ticket_qs, tags) - query_params['tags'] = tags - ticket_paginator = paginator.Paginator(ticket_qs, request.user.usersettings.settings.get('tickets_per_page') or 20) try: page = int(request.GET.get('page', '1')) @@ -853,10 +828,6 @@ def ticket_list(request): querydict = request.GET.copy() querydict.pop('page', 1) - tag_choices = [] - if HAS_TAG_SUPPORT: - # FIXME: restrict this to tags that are actually in use - tag_choices = Tag.objects.all() return render_to_response('helpdesk/ticket_list.html', RequestContext(request, dict( @@ -866,14 +837,12 @@ def ticket_list(request): user_choices=User.objects.filter(is_active=True,is_staff=True), queue_choices=Queue.objects.all(), status_choices=Ticket.STATUS_CHOICES, - tag_choices=tag_choices, urlsafe_query=urlsafe_query, user_saved_queries=user_saved_queries, query_params=query_params, from_saved_query=from_saved_query, saved_query=saved_query, search_message=search_message, - tags_enabled=HAS_TAG_SUPPORT ))) ticket_list = staff_member_required(ticket_list) @@ -891,7 +860,6 @@ def edit_ticket(request, ticket_id): return render_to_response('helpdesk/edit_ticket.html', RequestContext(request, { 'form': form, - 'tags_enabled': HAS_TAG_SUPPORT, })) edit_ticket = staff_member_required(edit_ticket) @@ -924,7 +892,6 @@ def create_ticket(request): return render_to_response('helpdesk/create_ticket.html', RequestContext(request, { 'form': form, - 'tags_enabled': HAS_TAG_SUPPORT, })) create_ticket = staff_member_required(create_ticket)
{% trans "Tickets" %}
# {% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Status" %}{% trans "Created" %}{% trans "Owner" %}{% trans "Tags" %}
# {% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Status" %}{% trans "Created" %}{% trans "Owner" %}
{{ ticket.get_status }} {{ ticket.created|timesince }} ago {{ ticket.get_assigned_to }}{{ ticket.tags }}
{% trans "No Tickets Match Your Selection" %}