<%= l(:label_crm_add_contact_plural) %>

<%= form_tag({:controller => 'contacts_issues', :action => 'create', :issue_id => @issue, :project_id => @project}, :remote => true, :method => :post, :id => 'add-contact-form') do %>

<%= label_tag 'contact_search', l(:label_crm_search_for_contact) %>:<%= text_field_tag 'contact_search', nil, :placeholder => l(:label_crm_contact_search) %>

<%= javascript_tag "observeSearchfield('contact_search', 'contacts_for_issue', '#{escape_javascript url_for(:controller => 'contacts_issues', :action => 'autocomplete_for_contact', :project_id => @project, :issue_id => @issue, :cross_project_contacts => RedmineContacts.cross_project_contacts? ? '1' : '0')}')" %>
<%= contacts_check_box_tags 'contacts_issue[contact_ids][]', Contact.includes(:avatar).by_project(RedmineContacts.cross_project_contacts? ? nil : @project).visible.first(100) - @issue.contacts %>

<%= submit_tag l(:button_add), :name => nil, :onclick => "hideModal(this);" %> <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>

<% end %> <% content_for :header_tags do %> <%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %> <% end %>