diff --git a/helpdesk/templates/helpdesk/report_output.html b/helpdesk/templates/helpdesk/report_output.html index dedc0aba..47bf49ac 100644 --- a/helpdesk/templates/helpdesk/report_output.html +++ b/helpdesk/templates/helpdesk/report_output.html @@ -15,6 +15,20 @@ {% block helpdesk_body %}

{% trans "Reports & Statistics" %}

+{% if user_saved_queries_ %} +

{% trans "You can run this query on filtered data by using one of your saved queries." %}

+
+ + + +
+{% else %} +

{% trans "Want to filter this report to just show a subset of data? Go to the Ticket List, filter your query, and save your query." %}

+{% endif %} + {% for h in headings %}{% endfor %} diff --git a/helpdesk/templates/helpdesk/ticket_list.html b/helpdesk/templates/helpdesk/ticket_list.html index 17d1f354..c921b2d7 100644 --- a/helpdesk/templates/helpdesk/ticket_list.html +++ b/helpdesk/templates/helpdesk/ticket_list.html @@ -42,7 +42,9 @@ $(document).ready(function() { {% if not from_saved_query %}
  • Save This Query
  • {% endif %} + {% if user_saved_queries %}
  • Load Saved Query
  • + {% endif %}
    @@ -54,6 +56,7 @@ $(document).ready(function() { + {% if tags_enabled %} {% endif %} @@ -114,6 +117,13 @@ $(document).ready(function() {

    Ctrl-click to select multiple options

    + +
    + + +

    Use YYYY-MM-DD date format, eg 2011-05-29

    + +
    {% if tags_enabled %}
    @@ -133,6 +143,9 @@ $(document).ready(function() { {% if from_saved_query and saved_query.user = user %}

    {% blocktrans with saved_query.title as query_name %}You are currently viewing saved query {{ query_name }}.{% endblocktrans %} {% trans "Delete Saved Query" %}

    {% endif %} + {% if from_saved_query %} +

    {% blocktrans with saved_query.id as query_id %}Run a report on this query to see stats and charts for the data listed below.{% endblocktrans %}

    + {% endif %} {% csrf_token %}
    diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 1814b8e6..e3f43e9b 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -558,6 +558,14 @@ def ticket_list(request): statuses = [int(s) for s in statuses] query_params['filtering']['status__in'] = statuses + date_from = request.GET.get('date_from') + if date_from: + query_params['filtering']['created__gte'] = date_from + + date_to = request.GET.get('date_to') + if date_to: + query_params['filtering']['created__lte'] = date_to + ### KEYWORD SEARCHING q = request.GET.get('q', None) @@ -582,6 +590,7 @@ def ticket_list(request): query_params['sortreverse'] = sortreverse ticket_qs = apply_query(Ticket.objects.select_related(), query_params) + print str(ticket_qs.query) ## TAG MATCHING if HAS_TAG_SUPPORT:
    {{ title }}
    {% if forloop.first %}{{ h|title }}{% else %}{{ h }}{% endif %}