mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-12 18:00:45 +01:00
* Added ability for tickets to be placed on hold
This commit is contained in:
parent
9c2fd9e87b
commit
041272ce1b
@ -164,7 +164,7 @@ class Ticket(models.Model):
|
||||
def _get_status(self):
|
||||
held_msg = ''
|
||||
if self.on_hold: held_msg = ' - On Hold'
|
||||
return '%s%s' % (self.get_status_display, held_msg)
|
||||
return '%s%s' % (self.get_status_display(), held_msg)
|
||||
get_status = property(_get_status)
|
||||
|
||||
def _get_ticket_url(self):
|
||||
|
@ -25,7 +25,7 @@
|
||||
<td><img src='{{ ticket.get_priority_img }}' alt='Priority {{ ticket.priority }}' title='Priority {{ ticket.priority }}' height='16' width='16' /></td>
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<td>{{ ticket.queue }}</td>
|
||||
<td>{{ ticket.get_status_display }}</td>
|
||||
<td>{{ ticket.get_status }}</td>
|
||||
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -51,13 +51,13 @@
|
||||
{% load ticket_to_link %}
|
||||
{% for followup in ticket.followup_set.public_followups %}
|
||||
<div class='followup'>
|
||||
<div class='title'>{{ followup.title }} <span class='byline'>by {{ followup.user }} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span></span></div>
|
||||
<div class='title'>{{ followup.title }} <span class='byline'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span></span></div>
|
||||
{{ followup.comment|num_to_link }}
|
||||
{% if followup.ticketchange_set.all %}<div class='changes'>
|
||||
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
||||
{% for change in followup.ticketchange_set.all %}
|
||||
Changed {{ change.field }} from {{ change.old_value }} to {{ change.new_value }}.<br />
|
||||
<li>Changed {{ change.field }} from {{ change.old_value }} to {{ change.new_value }}.</li>
|
||||
{% endfor %}
|
||||
</div>{% endif %}
|
||||
</div></ul>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
@ -69,13 +69,13 @@
|
||||
{% load ticket_to_link %}
|
||||
{% for followup in ticket.followup_set.all %}
|
||||
<div class='followup'>
|
||||
<div class='title'>{{ followup.title }} <span class='byline'>by {{ followup.user }} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span>{% if not followup.public %} <span class='private'>(Private)</span>{% endif %}</span></div>
|
||||
{{ followup.comment|num_to_link }}
|
||||
{% if followup.ticketchange_set.all %}<div class='changes'>
|
||||
<div class='title'>{{ followup.title }} <span class='byline'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span>{% if not followup.public %} <span class='private'>(Private)</span>{% endif %}</span></div>
|
||||
{% if followup.comment %}{{ followup.comment|num_to_link }}{% endif %}
|
||||
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
||||
{% for change in followup.ticketchange_set.all %}
|
||||
Changed {{ change.field }} from {{ change.old_value }} to {{ change.new_value }}.<br />
|
||||
<li>Changed {{ change.field }} from {{ change.old_value }} to {{ change.new_value }}.</li>
|
||||
{% endfor %}
|
||||
</div>{% endif %}
|
||||
</div></ul>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
@ -63,7 +63,7 @@
|
||||
<td><img src='{{ ticket.get_priority_img }}' alt='Priority {{ ticket.priority }}' title='Priority {{ ticket.priority }}' height='16' width='16' /></td>
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<td>{{ ticket.queue }}</td>
|
||||
<td>{{ ticket.get_status_display }}</td>
|
||||
<td>{{ ticket.get_status }}</td>
|
||||
<td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|timesince }} ago</span></td>
|
||||
<td>{{ ticket.get_assigned_to }}</td>
|
||||
</tr>
|
||||
|
@ -42,6 +42,8 @@ class ReverseProxy:
|
||||
yield self.sequence[i]
|
||||
|
||||
def num_to_link(text):
|
||||
if text == '':
|
||||
return text
|
||||
import re
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
|
5
views.py
5
views.py
@ -309,16 +309,17 @@ def hold_ticket(request, ticket_id, unhold=False):
|
||||
|
||||
if unhold:
|
||||
ticket.on_hold = False
|
||||
title = 'Ticket placed on hold'
|
||||
title = 'Ticket taken off hold'
|
||||
else:
|
||||
ticket.on_hold = True
|
||||
title = 'Ticket taken off hold'
|
||||
title = 'Ticket placed on hold'
|
||||
|
||||
f = FollowUp(
|
||||
ticket = ticket,
|
||||
user = request.user,
|
||||
title = title,
|
||||
date = datetime.now(),
|
||||
public = True,
|
||||
)
|
||||
f.save()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user