<% if authorize_for(:issues, :send_helpdesk_response) && @issue.customer && @issue.customer.primary_email %> <% send_note_checked = (params[:helpdesk].try(:[], :is_send_mail) || @issue.helpdesk_ticket.is_send_mail || HelpdeskSettings["send_note_by_default", @project]).to_s.to_i > 0 %> <% unless HelpdeskSettings["helpdesk_emails_header", @project].blank? %> <% end %> <% unless HelpdeskSettings["helpdesk_emails_footer", @project].blank? %> <% end %>
<%= hidden_field_tag 'helpdesk[is_send_mail]', 0, id: nil %> <%= check_box_tag 'helpdesk[is_send_mail]', 1, send_note_checked, :onclick => "toggleSendMail(this);" %> <%= label_tag :helpdesk_is_send_mail, l(:label_is_send_mail), :class => "icon icon-email-to" %>
<% end %> <% content_for :header_tags do %> <%= javascript_include_tag :redmine_helpdesk, :plugin => 'redmine_contacts_helpdesk' %> <%= stylesheet_link_tag :helpdesk, :plugin => 'redmine_contacts_helpdesk' %> <% if @issue.is_ticket? %> <% canned_responses = CannedResponse.visible.in_project_or_public(@project).order("#{CannedResponse.table_name}.name") %> <% if canned_responses.any? %> <%= javascript_tag do %> addCannedResponseButton(<%= { url: escape_javascript(add_canned_responses_path(project_id: @project, issue_id: @issue, format: 'js')), responses: canned_responses.map { |cr| {id: cr.id, name: cr.name} } }.to_json.html_safe %>); <% end %> <% end %> <% end %> <% end %> <% if authorize_for(:issues, :send_helpdesk_response) && @issue.customer && @issue.customer.primary_email %> <%= javascript_tag do %> $.each($(".contextual .icon.icon-edit"), function(index, link){ $(link).before('<%= helpdesk_reply_link %>') }) var original_scroll_to = showAndScrollTo; showAndScrollTo = function(id, focus){ original_scroll_to(id, focus); showConfiguredSend("update", "issue_notes", <%= send_note_checked %>); return false; } <% end %> <% end %>