From 5d80a689d9c14f173f0ca702a9751edcb0235d48 Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Sat, 15 Aug 2020 16:16:30 +0100
Subject: [PATCH 01/11] Update configuration.rst
Added a couple of sentences to explain that creation of a queue is a prerequisite for automatically creating tickets from e-mail.
---
docs/configuration.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/configuration.rst b/docs/configuration.rst
index 8c30b5f9..d3613f23 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -19,6 +19,8 @@ Before django-helpdesk will be much use, you need to do some basic configuration
**IMPORTANT NOTE**: Any tickets created via POP3 or IMAP mailboxes will DELETE the original e-mail from the mail server.
+ You will need to create a support queue, and associated login/host values, in the Django admin interface, in order for mail to be picked-up from the mail server and placed in the tickets table of your database. The values in the settings file alone, will not create the necessary values to trigger the get_email function.
+
4. If you wish to automatically escalate tickets based on their age, set up a cronjob to run the escalation command on a regular basis::
0 * * * * /path/to/helpdesksite/manage.py escalate_tickets
From eef16be1a4da1a96ad5869885bddf28ce69369a1 Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Sat, 15 Aug 2020 16:28:29 +0100
Subject: [PATCH 02/11] Update kb_category.html
Fixed a minor typo: space after colon in H2 heading.
---
helpdesk/templates/helpdesk/kb_category.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helpdesk/templates/helpdesk/kb_category.html b/helpdesk/templates/helpdesk/kb_category.html
index e3859c90..d782ae9e 100644
--- a/helpdesk/templates/helpdesk/kb_category.html
+++ b/helpdesk/templates/helpdesk/kb_category.html
@@ -1,7 +1,7 @@
{% extends "helpdesk/public_base.html" %}{% load i18n humanize %}
{% block helpdesk_body %}
-
{% trans 'Knowledgebase Category' %}:{% blocktrans with category.title as kbcat %}{{ kbcat }}{% endblocktrans %}
+{% trans 'Knowledgebase Category' %}: {% blocktrans with category.title as kbcat %}{{ kbcat }}{% endblocktrans %}
From 604306d7386b611ec1461134f70015ab2f5cd10d Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Sat, 15 Aug 2020 16:30:58 +0100
Subject: [PATCH 03/11] Update kb_item.html
Fixed a minor typo: space after colon in H2 heading
---
helpdesk/templates/helpdesk/kb_item.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helpdesk/templates/helpdesk/kb_item.html b/helpdesk/templates/helpdesk/kb_item.html
index fa4e85fb..6c127e03 100644
--- a/helpdesk/templates/helpdesk/kb_item.html
+++ b/helpdesk/templates/helpdesk/kb_item.html
@@ -1,7 +1,7 @@
{% extends "helpdesk/public_base.html" %}{% load i18n %}{% load markdown_deux_tags %}
{% block helpdesk_body %}
-
{% trans 'Knowledgebase' %}:{% blocktrans with item.title as item %}{{ item }}{% endblocktrans %}
+
{% trans 'Knowledgebase' %}: {% blocktrans with item.title as item %}{{ item }}{% endblocktrans %}
From 67bd484a3560b3047d1aa196ca57ba7a3e5c0e75 Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Wed, 19 Aug 2020 18:02:20 +0100
Subject: [PATCH 04/11] Update kb_category.html
Standardises output between KB listing and KB items rating display (so that both are "n/10", where the listing was previously a float), and captures case where there may be no votes cast.
---
helpdesk/templates/helpdesk/kb_category.html | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/helpdesk/templates/helpdesk/kb_category.html b/helpdesk/templates/helpdesk/kb_category.html
index d782ae9e..302f084c 100644
--- a/helpdesk/templates/helpdesk/kb_category.html
+++ b/helpdesk/templates/helpdesk/kb_category.html
@@ -26,7 +26,13 @@
{% blocktrans with item.get_absolute_url as url %}View
Answer {% endblocktrans %}
-
{% trans 'Rating' %}: {{ item.score }}
+
{% trans 'Rating' %}:
+ {% if item.votes > 0 %}
+ {{ item.score|floatformat }}/10
+ {% else %}
+ {% trans 'no score yet' %}
+ {% endif %}
+
{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}
From ff171e3c38a09691674f3d62f015366ccf6acb56 Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Wed, 19 Aug 2020 18:07:46 +0100
Subject: [PATCH 05/11] Update kb_item.html
Standardises output between KB listing and KB item, captures problem where there may be no votes cast.
---
helpdesk/templates/helpdesk/kb_item.html | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/helpdesk/templates/helpdesk/kb_item.html b/helpdesk/templates/helpdesk/kb_item.html
index 6c127e03..73b19a6f 100644
--- a/helpdesk/templates/helpdesk/kb_item.html
+++ b/helpdesk/templates/helpdesk/kb_item.html
@@ -29,7 +29,12 @@
- {% blocktrans with item.recommendations as recommendations %}Recommendations: {{ recommendations }}{% endblocktrans %}
- {% blocktrans with item.votes as votes %}Votes: {{ votes }}{% endblocktrans %}
- - {% blocktrans with item.score|floatformat as score %}Overall Rating: {{ score }}{% endblocktrans %}/10
+ - {% trans 'Rating' %}:
+ {% if item.votes > 0 %}
+ {{ item.score|floatformat }}/10
+ {% else %}
+ {% trans 'no score yet' %}
+ {% endif %}
From b772c6097b724aae3ee2aba69ef73f82e898d518 Mon Sep 17 00:00:00 2001
From: Thomas Weber
Date: Tue, 25 Aug 2020 16:11:50 -0600
Subject: [PATCH 06/11] Verify ticket.assigned_to is set before attempting to
access id property
---
helpdesk/views/staff.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py
index ba7ed16a..0676079a 100644
--- a/helpdesk/views/staff.py
+++ b/helpdesk/views/staff.py
@@ -79,7 +79,7 @@ def _has_access_to_queue(user, queue):
def _is_my_ticket(user, ticket):
"""Check to see if the user has permission to access
a ticket. If not then deny access."""
- if user.is_superuser or user.is_staff or user.id == ticket.assigned_to.id:
+ if user.is_superuser or user.is_staff or (ticket.assigned_to and user.id == ticket.assigned_to.id):
return True
else:
return False
From bcec57dafe6ab7a043979f852a2662ffa91c0aac Mon Sep 17 00:00:00 2001
From: bbe
Date: Mon, 5 Oct 2020 10:20:03 +0200
Subject: [PATCH 07/11] Display total row in report output.
---
helpdesk/templates/helpdesk/report_output.html | 4 ++--
helpdesk/views/staff.py | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/helpdesk/templates/helpdesk/report_output.html b/helpdesk/templates/helpdesk/report_output.html
index 6e036586..ea6e2fe6 100644
--- a/helpdesk/templates/helpdesk/report_output.html
+++ b/helpdesk/templates/helpdesk/report_output.html
@@ -96,7 +96,7 @@ Morris.Line({
element: 'chart-content',
data: {% autoescape on %}{{ morrisjs_data|safe }}{% endautoescape %},
xkey: 'x',
- ykeys: [{% for d in data %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
+ ykeys: [{% for d in data|slice:":-1" %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
labels: [{% for n in series_names %}"{{ n }}"{% if not forloop.last %}, {% endif %}{% endfor %}],
xLabels: "month"
});
@@ -110,7 +110,7 @@ Morris.Bar({
element: 'chart-content',
data: {% autoescape on %}{{ morrisjs_data|safe }}{% endautoescape %},
xkey: 'x',
- ykeys: [{% for d in data %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
+ ykeys: [{% for d in data|slice:":-1" %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
labels: [{% for n in series_names %}"{{ n }}"{% if not forloop.last %}, {% endif %}{% endfor %}]
});
diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py
index ba7ed16a..02c21580 100644
--- a/helpdesk/views/staff.py
+++ b/helpdesk/views/staff.py
@@ -1309,11 +1309,17 @@ def run_report(request, report):
column_headings = [col1heading] + possible_options
+ # Prepare a dict to store totals for each possible option
+ totals = {}
# Pivot the data so that 'header1' fields are always first column
# in the row, and 'possible_options' are always the 2nd - nth columns.
for item in header1:
data = []
for hdr in possible_options:
+ if hdr not in totals.keys():
+ totals[hdr] = summarytable[item, hdr]
+ else:
+ totals[hdr] += summarytable[item, hdr]
data.append(summarytable[item, hdr])
table.append([item] + data)
@@ -1332,6 +1338,12 @@ def run_report(request, report):
for series in table:
series_names.append(series[0])
+ # Add total row to table
+ total_data = []
+ for hdr in possible_options:
+ total_data.append(str(totals[hdr]))
+ table.append(['Total'] + total_data)
+
return render(request, 'helpdesk/report_output.html', {
'title': title,
'charttype': charttype,
From ecc7dcdc1729c0340174e2dd5651fce6d192df1b Mon Sep 17 00:00:00 2001
From: Benbb96
Date: Thu, 8 Oct 2020 00:48:03 +0200
Subject: [PATCH 08/11] Fix tests
---
helpdesk/templates/helpdesk/report_output.html | 8 ++++++--
helpdesk/views/staff.py | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/helpdesk/templates/helpdesk/report_output.html b/helpdesk/templates/helpdesk/report_output.html
index ea6e2fe6..5bbc81ca 100644
--- a/helpdesk/templates/helpdesk/report_output.html
+++ b/helpdesk/templates/helpdesk/report_output.html
@@ -75,6 +75,10 @@
{% for d in data %}
{% for f in d %}{{ f }} | {% endfor %}
{% endfor %}
+ {# Total row #}
+
+ {% for f in total_data %}{{ f }} | {% endfor %}
+
@@ -96,7 +100,7 @@ Morris.Line({
element: 'chart-content',
data: {% autoescape on %}{{ morrisjs_data|safe }}{% endautoescape %},
xkey: 'x',
- ykeys: [{% for d in data|slice:":-1" %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
+ ykeys: [{% for d in data %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
labels: [{% for n in series_names %}"{{ n }}"{% if not forloop.last %}, {% endif %}{% endfor %}],
xLabels: "month"
});
@@ -110,7 +114,7 @@ Morris.Bar({
element: 'chart-content',
data: {% autoescape on %}{{ morrisjs_data|safe }}{% endautoescape %},
xkey: 'x',
- ykeys: [{% for d in data|slice:":-1" %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
+ ykeys: [{% for d in data %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
labels: [{% for n in series_names %}"{{ n }}"{% if not forloop.last %}, {% endif %}{% endfor %}]
});
diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py
index 02c21580..292c3d30 100644
--- a/helpdesk/views/staff.py
+++ b/helpdesk/views/staff.py
@@ -1339,15 +1339,15 @@ def run_report(request, report):
series_names.append(series[0])
# Add total row to table
- total_data = []
+ total_data = ['Total']
for hdr in possible_options:
total_data.append(str(totals[hdr]))
- table.append(['Total'] + total_data)
return render(request, 'helpdesk/report_output.html', {
'title': title,
'charttype': charttype,
'data': table,
+ 'total_data': total_data,
'headings': column_headings,
'series_names': series_names,
'morrisjs_data': morrisjs_data,
From e83b00674fe063f3b2ffc480273432643f265b23 Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Thu, 8 Oct 2020 03:18:50 +0100
Subject: [PATCH 09/11] Update configuration.rst
Adds documentation as to the function of "E-Mail Check Interval" and its interaction with a crontab.
---
docs/configuration.rst | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/docs/configuration.rst b/docs/configuration.rst
index d3613f23..d1f4b63e 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -1,12 +1,12 @@
Configuration
=============
+ **IMPORTANT NOTE**: Any tickets created via POP3 or IMAP mailboxes will DELETE the original e-mail from the mail server.
+
Before django-helpdesk will be much use, you need to do some basic configuration. Most of this is done via the Django admin screens.
1. Visit ``http://yoursite/admin/`` and add a Helpdesk Queue. If you wish, enter your POP3 or IMAP server details.
- **IMPORTANT NOTE**: Any tickets created via POP3 or IMAP mailboxes will DELETE the original e-mail from the mail server.
-
2. Visit ``http://yoursite/helpdesk/`` (or whatever path as defined in your ``urls.py``)
3. If you wish to automatically create tickets from the contents of an e-mail inbox, set up a cronjob to run the management command on a regular basis.
@@ -17,8 +17,6 @@ Before django-helpdesk will be much use, you need to do some basic configuration
This will run the e-mail import every 5 minutes
- **IMPORTANT NOTE**: Any tickets created via POP3 or IMAP mailboxes will DELETE the original e-mail from the mail server.
-
You will need to create a support queue, and associated login/host values, in the Django admin interface, in order for mail to be picked-up from the mail server and placed in the tickets table of your database. The values in the settings file alone, will not create the necessary values to trigger the get_email function.
4. If you wish to automatically escalate tickets based on their age, set up a cronjob to run the escalation command on a regular basis::
@@ -44,3 +42,15 @@ Before django-helpdesk will be much use, you need to do some basic configuration
8. If you wish to use SOCKS4/5 proxy with Helpdesk Queue email operations, install PySocks manually. Please note that mixing both SOCKS and non-SOCKS email sources for different queues is only supported under Python 2; on Python 3, SOCKS proxy support is all-or-nothing: either all queue email sources must use SOCKS or none may use it. If you need this functionality on Python 3 please `let us know `_.
You're now up and running! Happy ticketing.
+
+Queue settings via admin interface
+----------------------------------
+E-Mail Check Interval
+^^^^^^^^^^^^^^^^^^^^^
+This setting does not trigger e-mail collection, it merely throttles it. In order to trigger e-mail collection you must run a crontab to trigger ``manage.py get_email``. The setting in *E-Mail Check Interval* prevents your crontab from running the e-mail trigger more often than the interval set.
+
+For example, setting *E-Mail Check Interval* to ``5`` will limit the collection of e-mail to once every five minutes, even if your crontab is firing every five seconds. If your cron job is set to fire once every hour, then e-mail will only be collected once every hour.
+
+The cron job triggers the collection of e-mail, *E-Mail Check Interval* restricts how often the trigger is effective.
+
+To remove this limit, set *E-Mail Check Interval* to ``0``.
From 3e91f35986d9027e12c0ee7767f06c5c86f9b2f8 Mon Sep 17 00:00:00 2001
From: typonaut <55769287+typonaut@users.noreply.github.com>
Date: Thu, 8 Oct 2020 16:12:35 +0100
Subject: [PATCH 10/11] Update configuration.rst, again
Improved documentation on e-mail check interval, added documentation on locale.
---
docs/configuration.rst | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/docs/configuration.rst b/docs/configuration.rst
index d1f4b63e..4d00af87 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -45,6 +45,12 @@ You're now up and running! Happy ticketing.
Queue settings via admin interface
----------------------------------
+Locale
+^^^^^^
+The *Locale* value must match the value in the ``locale`` column in the ``helpdesk_emailtemplate`` table if you wish to use those templates. For default installations/templates those values are ``cs``, ``de``, ``en``, ``es``, ``fi``, ``fr``, ``it``, ``pl``, ``ru`` and ``zh``.
+
+If you want to use a different *Local* then you will need to generate/edit the necessary templates (and set the value in the ``locale`` column) for those locales. This includes when using language variants, such as ``de-CH``, ``en-GB`` or ``fr-CA`` for example.
+
E-Mail Check Interval
^^^^^^^^^^^^^^^^^^^^^
This setting does not trigger e-mail collection, it merely throttles it. In order to trigger e-mail collection you must run a crontab to trigger ``manage.py get_email``. The setting in *E-Mail Check Interval* prevents your crontab from running the e-mail trigger more often than the interval set.
@@ -54,3 +60,13 @@ For example, setting *E-Mail Check Interval* to ``5`` will limit the collection
The cron job triggers the collection of e-mail, *E-Mail Check Interval* restricts how often the trigger is effective.
To remove this limit, set *E-Mail Check Interval* to ``0``.
+
+Potential problems
+""""""""""""""""""
+There is potential for a timing clash to prevent triggering of mail collection if *E-Mail Check Interval* and your crontab interval are identical. Because the crontab runs fractionally before, or at exactly the same time as *E-Mail Check Interval* is run, if the timings for both are identical then every second call by the crontab will be ignored by *E-Mail Check Interval* because its interval has yet to expire.
+
+The result is that if both crontab and *E-Mail Check Interval* are set to run at five minute intervals, then mail may actually only be collected every ten minutes. You will see the evidence of this in the helpdesk mail log, or in the logs of your mail server.
+
+To avoid this problem set the crontab and *E-Mail Check Interval* to marginally different values (or set *E-Mail Check Interval* to ``0``). *E-Mail Check Interval* will only take an integer value, in minutes, so if you want a five minute interval between mail checks, then you will either have to set *E-Mail Check Interval* to ``4`` and the crontab interval to ``300 seconds``, or the *E-Mail Check Interval* to ``5`` and the crontab interval to ``305 seconds``.
+
+The crontab interval overrides the *E-Mail Check Interval*, and resets the *E-Mail Check Interval* each time it fires, as long as the crontab interval is greater than *E-Mail Check Interval*.
From 306446b389e69ccaeff71989440e1fd52b370041 Mon Sep 17 00:00:00 2001
From: Jay Turner
Date: Sat, 10 Oct 2020 13:28:27 +0100
Subject: [PATCH 11/11] Fixes a missing migrations messages in 0.2.22 which is
caused by the careless changing of strings in models
---
helpdesk/migrations/0018_fix_migrations.py | 58 ++++++++++++++++++++++
1 file changed, 58 insertions(+)
create mode 100644 helpdesk/migrations/0018_fix_migrations.py
diff --git a/helpdesk/migrations/0018_fix_migrations.py b/helpdesk/migrations/0018_fix_migrations.py
new file mode 100644
index 00000000..05ee0011
--- /dev/null
+++ b/helpdesk/migrations/0018_fix_migrations.py
@@ -0,0 +1,58 @@
+# Generated by Django 2.2.16 on 2020-10-10 12:26
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('helpdesk', '0017_default_owner_on_delete_null'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='followup',
+ name='public',
+ field=models.BooleanField(blank=True, default=False, help_text='Public tickets are viewable by the submitter and all staff, but non-public tickets can only be seen by staff.', verbose_name='Public'),
+ ),
+ migrations.AlterField(
+ model_name='ignoreemail',
+ name='keep_in_mailbox',
+ field=models.BooleanField(blank=True, default=False, help_text='Do you want to save emails from this address in the mailbox? If this is unticked, emails from this address will be deleted.', verbose_name='Save Emails in Mailbox?'),
+ ),
+ migrations.AlterField(
+ model_name='queue',
+ name='allow_email_submission',
+ field=models.BooleanField(blank=True, default=False, help_text='Do you want to poll the e-mail box below for new tickets?', verbose_name='Allow E-Mail Submission?'),
+ ),
+ migrations.AlterField(
+ model_name='queue',
+ name='allow_public_submission',
+ field=models.BooleanField(blank=True, default=False, help_text='Should this queue be listed on the public submission form?', verbose_name='Allow Public Submission?'),
+ ),
+ migrations.AlterField(
+ model_name='queue',
+ name='email_box_ssl',
+ field=models.BooleanField(blank=True, default=False, help_text='Whether to use SSL for IMAP or POP3 - the default ports when using SSL are 993 for IMAP and 995 for POP3.', verbose_name='Use SSL for E-Mail?'),
+ ),
+ migrations.AlterField(
+ model_name='savedsearch',
+ name='shared',
+ field=models.BooleanField(blank=True, default=False, help_text='Should other users see this query?', verbose_name='Shared With Other Users?'),
+ ),
+ migrations.AlterField(
+ model_name='ticket',
+ name='on_hold',
+ field=models.BooleanField(blank=True, default=False, help_text='If a ticket is on hold, it will not automatically be escalated.', verbose_name='On Hold'),
+ ),
+ migrations.AlterField(
+ model_name='ticketcc',
+ name='can_update',
+ field=models.BooleanField(blank=True, default=False, help_text='Can this CC login and update the ticket?', verbose_name='Can Update Ticket?'),
+ ),
+ migrations.AlterField(
+ model_name='ticketcc',
+ name='can_view',
+ field=models.BooleanField(blank=True, default=False, help_text='Can this CC login to view the ticket details?', verbose_name='Can View Ticket?'),
+ ),
+ ]