Merge pull request #1268 from django-helpdesk/fix_my_tickets_showing_for_staff

Allow "My Tickets" visibility for staff users to be controlled by a setting
This commit is contained in:
David Vadnais 2025-05-15 10:33:10 -10:00 committed by GitHub
commit 185dc48232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,9 @@
API
===
.. contents:: In this document...
:depth: 2
A REST API (built with ``djangorestframework``) is available in order to list, create, update and delete tickets from
other tools thanks to HTTP requests.

View File

@ -1,10 +1,13 @@
Installation/integration into an existing Django application
============
============================================================
.. note::
For standalone installation, refer to the :doc:`standalone installation docs <standalone>`.
.. contents:: In this document...
:depth: 2
``django-helpdesk`` installation isn't difficult, but it requires you have a bit
of existing know-how about Django.

View File

@ -1,6 +1,9 @@
Settings
========
.. contents:: In this document...
:depth: 2
First, django-helpdesk needs ``django.core.context_processors.request`` activated, so you must add it to the ``settings.py``. Add the following::
TEMPLATES = [
@ -86,6 +89,10 @@ These changes are visible throughout django-helpdesk
- **HELPDESK_NAVIGATION_ENABLED** Show extended navigation by default, to all users, irrespective of staff status?
**Default:** ``HELPDESK_NAVIGATION_ENABLED = False``
- **HELPDESK_SHOW_MY_TICKETS_IN_NAV_FOR_STAFF** Show "My tickets" for staff. Typically used for help desk deployments that allow staff to create tickets to action other staff members.
**Default:** ``HELPDESK_SHOW_MY_TICKETS_IN_NAV_FOR_STAFF = True``
- **HELPDESK_TRANSLATE_TICKET_COMMENTS** Show dropdown list of languages that ticket comments can be translated into via Google Translate?

View File

@ -91,6 +91,12 @@ HELPDESK_TICKETS_TIMELINE_ENABLED = getattr(
# status?
HELPDESK_NAVIGATION_ENABLED = getattr(settings, "HELPDESK_NAVIGATION_ENABLED", False)
# Show the "My Tickets" navigation option for staff members - typically this is for when
# staff can create tickets to action other staff.
HELPDESK_SHOW_MY_TICKETS_IN_NAV_FOR_STAFF = getattr(
settings, "HELPDESK_SHOW_MY_TICKETS_IN_NAV_FOR_STAFF", True
)
# use public CDNs to serve jquery and other javascript by default?
# otherwise, use built-in static copy
HELPDESK_USE_CDN = getattr(settings, "HELPDESK_USE_CDN", False)

View File

@ -40,12 +40,14 @@
<span>{% trans "New Ticket" %}</span>
</a>
</li>
{% if helpdesk_settings.HELPDESK_SHOW_MY_TICKETS_IN_NAV_FOR_STAFF %}
<li class="nav-item{% if 'my-tickets' in request.path %} active{% endif %}">
<a class="nav-link" href="{% url 'helpdesk:my-tickets' %}">
<i class="fas fa-fw fa-tasks"></i>
<span>{% trans "My Tickets" %}</span>
</a>
</li>
{% endif %}
<li class="nav-item{% if 'reports' in request.path %} active{% endif %}">
<a class="nav-link" href="{% url 'helpdesk:report_index' %}">
<i class="fas fa-fw fa-chart-area"></i>