<% tickets_scope = @contact.all_tickets.visible.order_by_status %> <% tickets = tickets_scope %>
<%= link_to l(:label_helpdesk_ticket_new), {:controller => 'issues', :action => 'new', :customer_id => @contact, :issue => { :tracker_id => HelpdeskSettings["helpdesk_tracker", @project.id] }, :project_id => @project} if User.current.allowed_to?(:add_issues, @project) && User.current.allowed_to?(:send_response, @project) && HelpdeskSettings["helpdesk_tracker", @project.id] %>

<%= link_to(l(:label_helpdesk_ticket_plural), {:controller => 'issues', :action => 'index', :set_filter => 1, :customer => [@contact.id], :status_id => "*", :c => ["project", "tracker", "status", "subject", "customer", "customer_company", "last_message"], :sort => 'priority:desc,updated_on:desc'}) %>

<% if tickets && tickets.any? %> <%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do %> <% for ticket in tickets %> <% if @contact.is_company %> <% end %> <% end %>
<%= check_box_tag("ids[]", ticket.id, false, :style => 'display:none;', :id => nil) %> <%= link_to "##{ticket.id} - #{truncate(ticket.subject, :length => 60)} (#{ticket.status})", issue_path(ticket), :class => ticket.css_classes %> <%= contact_tag(ticket.customer, :type => 'plain') %> <%= ticket.description.to_s.truncate(250) %>
<% end %> <% if Redmine::VERSION.to_s >= '3.4' || RedmineContacts.unstable_branch? %> <%= context_menu %> <% else %> <%= context_menu issues_context_menu_path %> <% end %> <% else %>

<%= l(:label_no_data) %>

<% end %>