%= render :partial => 'issues/action_menu' %>
<% unless HelpdeskSettings["helpdesk_emails_header", @project].blank? %>
<% end %>
<% unless HelpdeskSettings["helpdesk_emails_footer", @project].blank? %>
<% end %>
<%= issue_heading(@issue) %>
<% if @prev_issue_id || @next_issue_id %>
<%= link_to_if @prev_issue_id,
"\xc2\xab #{l(:label_previous)}",
(@prev_issue_id ? issue_path(@prev_issue_id) : nil),
:title => "##{@prev_issue_id}" %> |
<% if @issue && @issue %>
<%= l(:label_item_position, :position => @issue, :count => @issue) %> |
<% end %>
<%= link_to_if @next_issue_id,
"#{l(:label_next)} \xc2\xbb",
(@next_issue_id ? issue_path(@next_issue_id) : nil),
:title => "##{@next_issue_id}" %>
<% end %>
<%= render_issue_subject_with_tree(@issue) %>
<%= l(:label_added_time_by, :author => @issue.author.instance_of?(AnonymousUser) ? link_to_source(@issue.contacts.first) : link_to_user(@issue.author), :age => time_tag(@issue.created_on)).html_safe %>
<% if @issue.created_on != @issue.updated_on %>
<%= l(:label_updated_time, time_tag(@issue.updated_on)).html_safe %>.
<% end %>
<% if @issue.description? || @issue.attachments.any? -%>
<% if @issue.description? %>
<%= link_to l(:button_quote),
{:controller => 'journals', :action => 'new', :id => @issue},
:remote => true,
:method => 'post',
:class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
<%= textilizable @issue, :description, :attachments => @issue.attachments %>
<% end %>
<%= link_to_attachments @issue, :thumbnails => true %>
<% end -%>
<% if @journals.present? %>
<%=l(:label_history)%>
<% reply_links = authorize_for('issues', 'edit') -%>
<% for journal in @journals.select{|j| !j.notes.blank? } %>
<% if journal.is_incoming? %>
<%= link_to avatar_to(journal.contacts.first, :size => "32"), {:controller => 'contacts', :action => 'show', :project_id => @project, :id => journal.contacts.first.id}, :id => "avatar", :class => "ticket-avatar gravatar" unless journal.contacts.blank? %>
<% else %>
<%= avatar(journal.user, :size => "32x32", :height => 32, :width => 32, :class => "ticket-avatar gravatar") %>
<% end %>
<%= link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
{ :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' },
:title => l(:button_edit),
:class => "journal-link") if reply_links %>
<%= link_to(image_tag('comment.png'),
{:controller => 'journals', :action => 'new', :id => @issue, :journal_id => journal},
:remote => true,
:method => 'post',
:title => l(:button_quote),
:class => "journal-link") %>
<% if journal.contacts && journal.contacts.any? && User.current.allowed_to?(:view_helpdesk_tickets, @project) %>
<% if journal.is_incoming? %>
<%= "#{link_to_source journal.contacts.first} (#{journal.journal_messages.first.email})".html_safe unless journal.contacts.blank? %>
<% if journal.journal_messages.first.attachments.any? %>
<% attachment = journal.journal_messages.first.attachments.first %>
<%= link_to_attachment attachment, :text => l(:label_helpdesk_original), :class => 'icon icon-attachment' -%>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
(<%= number_to_human_size attachment.filesize %>)
<%= link_to_if_authorized image_tag('magnifier.png', :plugin => "redmine_contacts_helpdesk"),
:controller => 'helpdesk', :action => 'show_original',
:id => attachment, :project_id => @project %>
<% end %>
<% else %>
<%= link_to_user journal.user %>
<%= l(:label_sent_to) %>
<% journal.journal_messages.each do |journal_message| %>
<%= link_to_source(journal_message.contact) %>
(<%= journal_message.email %>)
<% end %>
<% end %>
- <%= format_time(@issue.updated_on).html_safe %>.
<%# authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
<% end %>
<%= textilizable(journal, :notes) %>
<% end %>
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, @issue.project) || User.current.allowed_to?(:edit_own_issue_notes, @issue.project) %>
<% end %>
<%= render :partial => 'issues/action_menu' %>
<% if authorize_for('issues', 'edit') %>
<%= l(:button_update) %>
<%# labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= form_tag({:controller => "helpdesk_tickets", :action => "update"}, :id => 'issue-form', :multipart => true, :method => :put) do |f| %>
<%= error_messages_for 'issue' %>
<%= render :partial => 'issues/conflict' if @conflict %>
<%= label_tag :is_send_mail, l(:label_is_send_mail), :class => "icon icon-email-to", :style => "" %>
<%= check_box_tag 'is_send_mail', 1, HelpdeskSettings["send_note_by_default", @project], :onclick => "toggleSendMail(this);" %>
<% @issue.contacts.each do |contact| %>
<%= contact_tag(contact) %>
(<%= contact.emails.first %>)
<% end %>
<%= label_tag :email_cc, l(:label_email_cc) %>
<%= text_field_tag :email_cc, '', :size => "80%" %>
<%= label_tag :email_bcc, l(:label_email_bcc) %>
<%= text_field_tag :email_bcc, '', :size => "80%" %>
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'notes' %>
<%=l(:label_attachment_plural)%>
<%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
<%# f.hidden_field :lock_version %>
<%# hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= submit_tag l(:button_submit) %>
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' %>
<% end %>
<% end %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<%= f.link_to 'PDF' %>
<% end %>
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<% content_for :sidebar do %>
<% if authorize_for('issues', 'edit') %>
<%= link_to l(:button_update), :onclick => '#' %>
<% end %>
<%= l(:label_helpdesk_ticket_attributes) %>
<%= issue_fields_rows do |rows|
rows.left l(:field_status), h(@issue.status.name), :class => 'status'
rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority'
unless @issue.disabled_core_fields.include?('assigned_to_id')
rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
end
unless @issue.disabled_core_fields.include?('category_id') || @issue.category.blank?
rows.left l(:field_category), h(@issue.category ? @issue.category.name : "-"), :class => 'category'
end
unless @issue.disabled_core_fields.include?('fixed_version_id') || @issue.fixed_version.blank?
rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version'
end
unless @issue.disabled_core_fields.include?('start_date') || @issue.start_date.blank?
rows.left l(:field_start_date), format_date(@issue.start_date), :class => 'start-date'
end
unless @issue.disabled_core_fields.include?('due_date') || @issue.due_date.blank?
rows.left l(:field_due_date), format_date(@issue.due_date), :class => 'due-date'
end
unless @issue.disabled_core_fields.include?('done_ratio')
rows.left l(:field_done_ratio), progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%"), :class => 'progress'
end
unless @issue.disabled_core_fields.include?('estimated_hours')
unless @issue.estimated_hours.nil?
rows.left l(:field_estimated_hours), l_hours(@issue.estimated_hours), :class => 'estimated-hours'
end
end
if User.current.allowed_to?(:view_time_entries, @project) && @issue.total_spent_hours > 0
rows.left l(:label_spent_time), (@issue.total_spent_hours > 0 ? (link_to l_hours(@issue.total_spent_hours), {:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue}) : "-"), :class => 'spent-time'
end
end %>
<%= render_custom_fields_rows(@issue) %>
<% if User.current.allowed_to?(:add_issue_watchers, @project) ||
(@issue.watchers.present? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
<%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
<% end %>
<% end %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %>
<%= stylesheet_link_tag :helpdesk, :plugin => 'redmine_contacts_helpdesk' %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
<% end %>
<%= context_menu issues_context_menu_path %>