Merge branch 'develop' of github.com:martini/zammad into develop
# Conflicts: # app/assets/javascripts/app/views/profile/calendar_subscriptions.jst.eco
This commit is contained in:
commit
f28ab344f5
4 changed files with 25 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
|||
<div class="btn">Default Button</div>
|
||||
<div class="btn btn--slim">Slim Button</div>
|
||||
<div class="btn is-disabled">Disabled Button</div>
|
||||
<div class="btn" disabled>Disabled Button</div>
|
||||
|
||||
<h3>Primary</h3>
|
||||
<div class="btn btn--primary">Primary Button</div>
|
||||
|
|
|
@ -8,10 +8,7 @@
|
|||
<p><%= @T('See your tickets from within your favorite calendar by adding the following url to your calendar app.') %></p>
|
||||
|
||||
<h3><%= @T('URL') %></h3>
|
||||
<div class="output-input">
|
||||
<output class="js-output"></output>
|
||||
<input class="form-control js-select" readonly value="<%= @baseurl %>/calendar_subscriptions/tickets">
|
||||
</div>
|
||||
<input class="form-control js-select" readonly value="<%= @baseurl %>/ical/tickets">
|
||||
|
||||
<h3><%= @T('Subscription Settings') %></h3>
|
||||
<table class="settings-list">
|
||||
|
@ -28,7 +25,7 @@
|
|||
<td style="text-transform: capitalize"><%= @translationTable[stateType] %>
|
||||
<td><label class="inline-label"><input type="checkbox" name="<%= stateType %>/own"<%= if options.own then ' checked' %>> <%= @T('own tickets') %></label>
|
||||
<td><label class="inline-label"><input type="checkbox" name="<%= stateType %>/not_assigned"<%= if options.not_assigned then ' checked' %>> <%= @T('not assigned tickets') %></label>
|
||||
<td><div class="btn btn--table btn--text js-showLink"><%= @T('Show') %></div><input class="form-control form-control--borderless js-select is-hidden" readonly value="<%= @baseurl %>/calendar_subscriptions/tickets/<%= stateType %>">
|
||||
<td><div class="btn btn--table btn--text js-showLink"><%= @T('Show') %></div><input class="form-control form-control--borderless js-select is-hidden" readonly value="<%= @baseurl %>/ical/tickets/<%= stateType %>">
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
Zammad::Application.routes.draw do
|
||||
|
||||
# shorter version
|
||||
match '/ical', to: 'calendar_subscriptions#all', via: :get
|
||||
match '/ical/:object', to: 'calendar_subscriptions#object', via: :get
|
||||
match '/ical/:object/:method', to: 'calendar_subscriptions#object', via: :get
|
||||
|
||||
# wording version
|
||||
match '/calendar_subscriptions', to: 'calendar_subscriptions#all', via: :get
|
||||
match '/calendar_subscriptions/:object', to: 'calendar_subscriptions#object', via: :get
|
||||
match '/calendar_subscriptions/:object/:method', to: 'calendar_subscriptions#object', via: :get
|
||||
|
|
|
@ -59,14 +59,19 @@ class CalendarSubscriptions::Tickets
|
|||
condition: condition,
|
||||
)
|
||||
|
||||
user_locale = @user.preferences['locale'] || 'en'
|
||||
translated_ticket = Translation.translate(user_locale, 'ticket')
|
||||
|
||||
events_data = []
|
||||
tickets.each do |ticket|
|
||||
|
||||
event_data = {}
|
||||
|
||||
translated_state = Translation.translate(user_locale, ticket.state.name)
|
||||
|
||||
event_data[:dtstart] = Icalendar::Values::Date.new( Time.zone.today )
|
||||
event_data[:dtend] = Icalendar::Values::Date.new( Time.zone.today )
|
||||
event_data[:summary] = "#{ticket.state.name} ticket: '#{ticket.title}'"
|
||||
event_data[:summary] = "#{translated_state} #{translated_ticket}: '#{ticket.title}'"
|
||||
event_data[:description] = "T##{ticket.number}"
|
||||
|
||||
events_data.push event_data
|
||||
|
@ -98,6 +103,9 @@ class CalendarSubscriptions::Tickets
|
|||
condition: condition,
|
||||
)
|
||||
|
||||
user_locale = @user.preferences['locale'] || 'en'
|
||||
translated_ticket = Translation.translate(user_locale, 'ticket')
|
||||
|
||||
events_data = []
|
||||
tickets.each do |ticket|
|
||||
|
||||
|
@ -110,11 +118,13 @@ class CalendarSubscriptions::Tickets
|
|||
pending_time = Time.zone.today
|
||||
end
|
||||
|
||||
translated_state = Translation.translate(user_locale, ticket.state.name)
|
||||
|
||||
# rubocop:disable Rails/TimeZone
|
||||
event_data[:dtstart] = Icalendar::Values::DateTime.new( pending_time )
|
||||
event_data[:dtend] = Icalendar::Values::DateTime.new( pending_time )
|
||||
# rubocop:enable Rails/TimeZone
|
||||
event_data[:summary] = "#{ticket.state.name} ticket: '#{ticket.title}'"
|
||||
event_data[:summary] = "#{translated_state} #{translated_ticket}: '#{ticket.title}'"
|
||||
event_data[:description] = "T##{ticket.number}"
|
||||
|
||||
events_data.push event_data
|
||||
|
@ -138,6 +148,9 @@ class CalendarSubscriptions::Tickets
|
|||
condition: condition,
|
||||
)
|
||||
|
||||
user_locale = @user.preferences['locale'] || 'en'
|
||||
translated_ticket_escalation = Translation.translate(user_locale, 'ticket escalation')
|
||||
|
||||
tickets.each do |ticket|
|
||||
|
||||
next if !ticket.escalation_time
|
||||
|
@ -153,7 +166,7 @@ class CalendarSubscriptions::Tickets
|
|||
event_data[:dtstart] = Icalendar::Values::DateTime.new( escalation_time )
|
||||
event_data[:dtend] = Icalendar::Values::DateTime.new( escalation_time )
|
||||
# rubocop:enable Rails/TimeZone
|
||||
event_data[:summary] = "ticket escalation: '#{ticket.title}'"
|
||||
event_data[:summary] = "#{translated_ticket_escalation}: '#{ticket.title}'"
|
||||
event_data[:description] = "T##{ticket.number}"
|
||||
|
||||
events_data.push event_data
|
||||
|
|
Loading…
Reference in a new issue