diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.coffee
index fa1537d5c..d3cbd8b90 100644
--- a/app/assets/javascripts/app/controllers/widget/online_notification.coffee
+++ b/app/assets/javascripts/app/controllers/widget/online_notification.coffee
@@ -154,6 +154,7 @@ class App.OnlineNotificationWidget extends App.Controller
title = item.objectNative.activityMessage(item)
else
title = "Need objectNative in item #{item.object}.find(#{item.o_id})"
+ title = title.replace(/<.+?>/g, '"')
@notifyDesktop(
url: item.link
title: title
diff --git a/app/models/observer/ticket/notification/background_job.rb b/app/models/observer/ticket/notification/background_job.rb
index 78c0b9b41..433828b4a 100644
--- a/app/models/observer/ticket/notification/background_job.rb
+++ b/app/models/observer/ticket/notification/background_job.rb
@@ -130,7 +130,7 @@ class Observer::Ticket::Notification::BackgroundJob
next if @p[:type] == 'update' && !article && ( !changes || changes.empty? )
# check if today already notified
- if @p[:type] == 'reminder_reached' || @p[:type] == 'escalation'
+ if @p[:type] == 'reminder_reached' || @p[:type] == 'escalation' || @p[:type] == 'escalation_warning'
identifier = user.email
if !identifier || identifier == ''
identifier = user.login
@@ -154,11 +154,17 @@ class Observer::Ticket::Notification::BackgroundJob
created_by_id = ticket.updated_by_id || 1
# delete old notifications
- if @p[:type] == 'reminder_reached' || @p[:type] == 'escalation'
+ if @p[:type] == 'reminder_reached'
seen = false
created_by_id = 1
OnlineNotification.remove_by_type('Ticket', ticket.id, @p[:type], user)
+ elsif @p[:type] == 'escalation' || @p[:type] == 'escalation_warning'
+ seen = false
+ created_by_id = 1
+ OnlineNotification.remove_by_type('Ticket', ticket.id, 'escalation', user)
+ OnlineNotification.remove_by_type('Ticket', ticket.id, 'escalation_warning', user)
+
# on updates without state changes create unseen messages
elsif @p[:type] != 'create' && (!@p[:changes] || @p[:changes].empty? || !@p[:changes]['state_id'])
seen = false
@@ -197,6 +203,8 @@ class Observer::Ticket::Notification::BackgroundJob
template = 'ticket_reminder_reached'
elsif @p[:type] == 'escalation'
template = 'ticket_escalation'
+ elsif @p[:type] == 'escalation_warning'
+ template = 'ticket_escalation_warning'
else
fail "unknown type for notification #{@p[:type]}"
end
diff --git a/app/models/ticket.rb b/app/models/ticket.rb
index 3bae8b73d..8019fd071 100644
--- a/app/models/ticket.rb
+++ b/app/models/ticket.rb
@@ -126,7 +126,7 @@ returns
processes tickets which have reached their pending time and sets next state_id
- processed_tickets = Ticket.process_pending()
+ processed_tickets = Ticket.process_pending
returns
@@ -196,6 +196,54 @@ returns
=begin
+processes escalated tickets
+
+ processed_tickets = Ticket.process_escalation
+
+returns
+
+ processed_tickets = [ Hallo <%= d 'recipient.firstname' %>, Ticket (<%= d 'ticket.title' %>) von "<%= d 'ticket.customer.longname' %>" ist seit "<%= d 'ticket.escalation_time' %>" eskaliert!
+ <%= t 'Information' %>:
+
+
+<% if @objects[:article] %>
+
+ <%= a 'article' %>
+
+
+ <%= t 'View this in Zammad' %> +
diff --git a/app/views/mailer/ticket_escalation/en.html.erb b/app/views/mailer/ticket_escalation/en.html.erb new file mode 100644 index 000000000..ac382fdf7 --- /dev/null +++ b/app/views/mailer/ticket_escalation/en.html.erb @@ -0,0 +1,18 @@ +Ticket is escalated (<%= d 'ticket.title' %>) + +Hi <%= d 'recipient.firstname' %>,
+Ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" is escalated since "<%= d 'ticket.escalation_time' %>"!
++ <%= t 'Information' %>: +
+ <%= a 'article' %> ++ +<% end %> +
+ <%= t 'View this in Zammad' %> +
diff --git a/app/views/mailer/ticket_escalation_warning/de.html.erb b/app/views/mailer/ticket_escalation_warning/de.html.erb new file mode 100644 index 000000000..4ee2e9671 --- /dev/null +++ b/app/views/mailer/ticket_escalation_warning/de.html.erb @@ -0,0 +1,18 @@ +Ticket wird eskalieren (<%= d 'ticket.title' %>) + +Hallo <%= d 'recipient.firstname' %>,
+Ticket (<%= d 'ticket.title' %>) von "<%= d 'ticket.customer.longname' %>" wird um "<%= d 'ticket.escalation_time' %>" eskalieren!
++ <%= t 'Information' %>: +
+ <%= a 'article' %> ++ +<% end %> +
+ <%= t 'View this in Zammad' %> +
diff --git a/app/views/mailer/ticket_escalation_warning/en.html.erb b/app/views/mailer/ticket_escalation_warning/en.html.erb new file mode 100644 index 000000000..7914b6fa1 --- /dev/null +++ b/app/views/mailer/ticket_escalation_warning/en.html.erb @@ -0,0 +1,18 @@ +Ticket will escalated (<%= d 'ticket.title' %>) + +Hi <%= d 'recipient.firstname' %>,
+Ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" will escalated at "<%= d 'ticket.escalation_time' %>"!
++ <%= t 'Information' %>: +
+ <%= a 'article' %> ++ +<% end %> +