mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-16 10:19:17 +01:00
Automatic absolute time_spent calculation for ticket FollowUp
This commit is contained in:
parent
f379bbe80e
commit
f7e3a2b8aa
@ -1000,8 +1000,11 @@ class FollowUp(models.Model):
|
|||||||
return u"%s#followup%s" % (self.ticket.get_absolute_url(), self.id)
|
return u"%s#followup%s" % (self.ticket.get_absolute_url(), self.id)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
now = timezone.now()
|
||||||
t = self.ticket
|
t = self.ticket
|
||||||
t.modified = timezone.now()
|
if helpdesk_settings.FOLLOWUP_TIME_SPENT_AUTO and not self.time_spent:
|
||||||
|
self.time_spent = now - t.modified
|
||||||
|
t.modified = now
|
||||||
t.save()
|
t.save()
|
||||||
super(FollowUp, self).save(*args, **kwargs)
|
super(FollowUp, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
@ -151,6 +151,11 @@ TICKET_PRIORITY_CHOICES = getattr(settings,
|
|||||||
'HELPDESK_TICKET_PRIORITY_CHOICES',
|
'HELPDESK_TICKET_PRIORITY_CHOICES',
|
||||||
DEFAULT_TICKET_PRIORITY_CHOICES)
|
DEFAULT_TICKET_PRIORITY_CHOICES)
|
||||||
|
|
||||||
|
# Follow-ups automatic time_spent calculation
|
||||||
|
FOLLOWUP_TIME_SPENT_AUTO = getattr(settings,
|
||||||
|
'HELPDESK_FOLLOWUP_TIME_SPENT_AUTO',
|
||||||
|
False)
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# options for public pages #
|
# options for public pages #
|
||||||
############################
|
############################
|
||||||
|
Loading…
Reference in New Issue
Block a user