<%= link_to l(:button_update),
{:controller => 'helpdesk_tickets',
:action => 'edit',
:issue_id => @issue},
:remote => true if User.current.allowed_to?(:edit_helpdesk_tickets, @project) %>
<%= l(:label_helpdesk_contact) %>
<% unless !(@show_form == "true") %>
<%= form_for @helpdesk_ticket, :url => {:controller => 'helpdesk_tickets',
:action => 'update',
:issue_id => @issue},
:html => {:id => 'ticket_data_form',
:method => :put} do |f| %>
<% unless @helpdesk_ticket.new_record? %>
<%= link_to image_tag('link_break.png'),
{:controller => 'helpdesk_tickets', :action => 'destroy', :id => @issue},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:label_relation_delete) %>
<% end %>
<%= label_tag :helpdesk_ticket_contact_id, l(:label_helpdesk_contact)%>
<%= helpdesk_select_customer_tag('helpdesk_ticket[from_address]', [["#{@helpdesk_ticket.customer.try(:name)} <#{@helpdesk_ticket.from_address}>", @helpdesk_ticket.from_address || @helpdesk_ticket.customer.try(:id)]], selected: @helpdesk_ticket.from_address || @helpdesk_ticket.customer.try(:id), include_blank: false, multiaddress: true, add_contact: true, style: 'width: 80%;', width: '85%') %>
<%= label_tag :helpdesk_ticket_source, l(:label_helpdesk_ticket_source)%>
<%= f.select :source, helpdesk_tickets_source_for_select %>
<%= f.text_field :ticket_date, :size => 12, :required => true, :value => @helpdesk_ticket.ticket_date.to_date, :label => l(:label_helpdesk_ticket_date) %> <%= f.text_field :ticket_time, :value => @helpdesk_ticket.ticket_date.to_s(:time), :size => 5 %><%= calendar_for('helpdesk_ticket_ticket_date') %>
<%= label_tag :helpdesk_ticket_cc_address, l(:label_helpdesk_cc_address) %>
<% @cc_address = @helpdesk_ticket.cc_address.try(:split, ',') || [] %>
<%= f.select :cc_address, options_for_select(@cc_address.map { |email|[email, email] }, @cc_address), {}, {:multiple => true } %>
<%= submit_tag l(:button_update) %>
<%= link_to l(:button_cancel), {}, :onclick => "$('#ticket_data_form').hide(); return false;" %>
<% end %>
<% end %>
<%= render :partial => 'contacts/contact_card', :object => @issue.customer if @issue.customer %>
<% if @issue.customer && (customer_issues = @issue.customer.all_tickets.preload(:status, :tracker, :helpdesk_ticket).visible.order_by_status.to_a).count - 1 > 0 %>
<%= link_to l(:label_helpdesk_all) + " (#{customer_issues.count})", {:controller => 'issues',
:action => 'index',
:set_filter => 1,
:f => [:customer, :status_id],
:v => {:customer => [@issue.customer.id]},
:op => {:customer => '=', :status_id => '*'}} %>
<%= l(:label_helpdesk_contact_activity) %>
<% (customer_issues.first(5)).each do |issue| %>
- " >
<%= link_to_issue(issue, :truncate => 60, :project => (@project != issue.project), :tracker => false) %>
<%= format_time(issue.created_on) %>
<%= "- #{issue.assigned_to.name}" if issue.assigned_to %>
<% end %>
<% end %>