2012-01-03 16:18:32 +00:00
|
|
|
<%= error_messages_for 'contact', 'note' %>
|
|
|
|
|
<%= error_messages_for %>
|
|
|
|
|
|
|
|
|
|
<% html_title "#{l(:label_contact)} ##{@contact.id}: #{@contact.name}" %>
|
|
|
|
|
|
|
|
|
|
<div class="contextual">
|
|
|
|
|
<% replace_watcher ||= 'watcher' %>
|
|
|
|
|
<%= link_to l(:label_profile), user_path(@contact.redmine_user), :class => 'icon icon-user' unless @contact.redmine_user.blank? %>
|
|
|
|
|
<%= link_to(l(:button_create), {:controller => 'users', :action => 'new_from_contact', :contact_id => @contact.id, :id => 'current'}, :class => 'icon icon-user') if (User.current.admin? && @contact.redmine_user.blank? && !@contact.email.blank?) %>
|
|
|
|
|
<%= link_to_if_authorized l(:label_send_mail), {:controller => 'contacts', :action => 'edit_mails', :ids => [@contact.id], :project_id => @project}, :class => 'icon icon-email' unless @contact.emails.first.blank? %>
|
|
|
|
|
|
|
|
|
|
<%= watcher_tag(@contact, User.current, {:id => replace_watcher, :replace => ['watcher','watcher2']}) %>
|
|
|
|
|
<%= link_to_if_authorized l(:button_edit), {:controller => 'contacts', :action => 'edit', :project_id => @project, :id => @contact}, :class => 'icon icon-edit' unless @contact.nil? %>
|
|
|
|
|
<%= link_to_if_authorized l(:button_delete), {:controller => 'contacts', :action => 'destroy', :project_id => @project, :id => @contact}, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' unless @contact.nil? %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h2><%= !@contact.is_company ? l(:label_contact) : l(:label_company) %> #<%= @contact.id %></h2>
|
|
|
|
|
<% unless @contact.nil? -%>
|
|
|
|
|
<div class="contact details">
|
|
|
|
|
<table class="subject_header">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="avatar"><%= avatar_to(@contact, :size => "64", :full_size => true) %></td>
|
|
|
|
|
<td class="name" style="vertical-align: top;">
|
|
|
|
|
<h1><%= h @contact.name %></h1>
|
|
|
|
|
<% if !@contact.is_company %>
|
|
|
|
|
<p>
|
|
|
|
|
<%= h @contact.job_title %>
|
|
|
|
|
<%= " #{l(:label_at_company)} " unless (@contact.job_title.blank? or @contact.company.blank?) %>
|
|
|
|
|
<% if @contact.contact_company %>
|
|
|
|
|
<%= link_to @contact.contact_company.name, {:controller => 'contacts', :action => 'show', :project_id => @contact.contact_company.project(@project), :id => @contact.contact_company.id } %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= h @contact.company %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<%= render :partial => 'form_tags' %>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
<% if @contact.phones.any? || @contact.emails.any? %>
|
|
|
|
|
<td class="subject_info">
|
|
|
|
|
<ul>
|
|
|
|
|
<% if @contact.phones.any? %>
|
|
|
|
|
<li class="phone icon icon-phone"><%= @contact.phones.first %></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% if @contact.emails.any? %>
|
|
|
|
|
<li class="email icon icon-email"><%= mail_to @contact.emails.first %></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</td>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<%= call_hook(:view_contacts_show_details_bottom, :contact => @contact) %>
|
|
|
|
|
|
|
|
|
|
<% if authorize_for(:notes, :add_note) %>
|
|
|
|
|
<hr />
|
|
|
|
|
<%= render :partial => 'notes/add', :locals => {:note_source => @contact} %>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <% contacts_tabs = [{:name => 'general', :partial => 'common/recently_viewed', :label => :label_note_plural},
|
|
|
|
|
{:name => 'tags', :partial => 'employees', :label => :label_tags_plural},
|
2012-01-03 21:11:44 +00:00
|
|
|
{:name => 'deal_statuses', :partial => 'attributes', :label => :label_deal_status_plural},
|
|
|
|
|
{:name => 'contract_statuses', :partial => 'attributes', :label => :label_contract_status_plural}
|
2012-01-03 16:18:32 +00:00
|
|
|
] %>
|
|
|
|
|
|
|
|
|
|
<%= render_tabs contacts_tabs %> -->
|
|
|
|
|
|
|
|
|
|
<% if authorize_for(:notes, :show) %>
|
|
|
|
|
<div id="comments">
|
|
|
|
|
<h3><%= l(:label_note_plural) %></h3>
|
|
|
|
|
<div id="notes">
|
|
|
|
|
<%= render :partial => 'notes/note_item', :collection => @notes, :locals => {:show_info => @contact.is_company, :note_source => @contact} %>
|
|
|
|
|
<p class="pagination"><%= pagination_links @notes_pages, :params => {:project_id => params[:project_id]}%></p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
<p class="nodata"><%=l(:label_no_data)%></p>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% content_for :sidebar do %>
|
|
|
|
|
|
|
|
|
|
<%= render :partial => 'common/sidebar' %>
|
|
|
|
|
<%= render :partial => 'attributes' %>
|
|
|
|
|
<%= call_hook(:view_contacts_sidebar_after_attributes, :contact => @contact) %>
|
|
|
|
|
<%= render :partial => 'contacts_tasks/related', :locals => {:contact => @contact, :tasks => @open_issues} %>
|
|
|
|
|
<%= call_hook(:view_contacts_sidebar_after_tasks, :contact => @contact) %>
|
|
|
|
|
<%= render :partial => 'common/notes_attachments', :object => @contact.notes_attachments %>
|
|
|
|
|
<%= call_hook(:view_contacts_sidebar_after_notes_attachments, :contact => @contact) %>
|
|
|
|
|
<%= render :partial => 'deals/related_deals', :object => @contact.all_visible_deals %>
|
2012-01-03 21:11:44 +00:00
|
|
|
<%= render :partial => 'contracts/related_contracts', :object => @contact.all_visible_contracts %>
|
2012-01-03 16:18:32 +00:00
|
|
|
<%= render :partial => 'employees' %>
|
|
|
|
|
<% if !@contact.background.blank? %>
|
|
|
|
|
<h3><%= l(:label_contact_background_info) %></h3>
|
|
|
|
|
<div class="wiki"><%= textilizable(@contact, :background) %></div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= render :partial => 'common/recently_viewed' %>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% other_formats_links do |f| %>
|
|
|
|
|
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
|
|
|
|
|
<%- if Gem.available?('vpim') -%>
|
|
|
|
|
<%= f.link_to 'VCF', :url => params %>
|
|
|
|
|
<%- end -%>
|
|
|
|
|
<!-- <%= f.link_to 'PDF', :url => params %> -->
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% content_for :header_tags do %>
|
|
|
|
|
<%= javascript_include_tag :defaults %>
|
|
|
|
|
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
|
|
|
|
|
<%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %>
|
|
|
|
|
<%= stylesheet_link_tag :contacts_sidebar, :plugin => 'redmine_contacts' %>
|
|
|
|
|
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@contact.name} - ##{@contact.id}") %>
|
|
|
|
|
|
|
|
|
|
<% end %>
|