Initial Redmine tooling and local plugin forks
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<% content_for :header_tags do %>
|
||||
<%= select2_assets %>
|
||||
<%= stylesheet_link_tag(:contacts, :plugin => 'redmine_contacts') %>
|
||||
<%= javascript_include_tag(:contacts_select2, :plugin => 'redmine_contacts') %>
|
||||
<%= javascript_include_tag(:contacts, :plugin => 'redmine_contacts') %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,35 @@
|
||||
<%= fields_for "issue" do |ff| %>
|
||||
|
||||
<%= label_tag 'task_subject', l(:field_subject)%> <br>
|
||||
<%= ff.text_field :subject %>
|
||||
|
||||
<p>
|
||||
<%= label_tag :assigned_to_id, l(:field_assigned_to)%> <br>
|
||||
<%= ff.select :assigned_to_id, @project.assignable_users.collect {|m| [m.name, m.id]}, :selected => User.current.id, :include_blank => true %>
|
||||
</p>
|
||||
<%= label_tag 'due_date', l(:field_due_date)%> <br>
|
||||
<%= ff.text_field :due_date, :value => Date.today, :size => 12 %><%= calendar_for('issue_due_date') %><br>
|
||||
|
||||
<p>
|
||||
<%= label_tag :description, l(:field_description)%> <br>
|
||||
<%= ff.text_area :description, :value => "", :rows => 6, :class => 'wiki-edit' , :style => "width: 98%;" %><br>
|
||||
</p>
|
||||
|
||||
<% if @project.issue_categories.any? %>
|
||||
<p>
|
||||
<%= label_tag :category_id, l(:field_category)%> <br>
|
||||
<%= ff.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= label_tag :tracker_id, l(:field_tracker)%> <br>
|
||||
<%= ff.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]} %>
|
||||
</p>
|
||||
|
||||
<% end %>
|
||||
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
<%= submit_tag l(:button_add), :class => "button-small" %>
|
||||
@@ -0,0 +1,45 @@
|
||||
<% if !@issue.blank? && User.current.allowed_to?(:view_contacts, @project) %>
|
||||
|
||||
<div id="issue_contacts">
|
||||
|
||||
|
||||
|
||||
|
||||
<% if User.current.allowed_to?(:manage_contact_issue_relations, @project) %>
|
||||
<div class="contextual">
|
||||
<%= link_to l(:button_add),
|
||||
{:controller => 'contacts_issues', :action => 'new', :issue_id => @issue},
|
||||
:remote => true,
|
||||
:method => 'get' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<h3><%= l(:label_contact_plural) %> </h3>
|
||||
|
||||
<ul>
|
||||
<% @issue.contacts.order_by_name.visible.each do |contact| %>
|
||||
<li id="contact_<%= contact.id%>">
|
||||
<%= contact_tag(contact) %>
|
||||
<%= "(#{contact.job_title}) " unless contact.job_title.blank? %>
|
||||
<% if User.current.allowed_to?(:delete_contacts, @project) %>
|
||||
<%= link_to(image_tag('delete.png'),
|
||||
{ :controller => 'contacts_issues',
|
||||
:action => 'delete',
|
||||
:issue_id => @issue,
|
||||
:project_id => @project,
|
||||
:id => contact.id},
|
||||
:remote => true,
|
||||
:method => :delete,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => "delete",
|
||||
:title => l(:button_delete) ) %>
|
||||
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
@@ -0,0 +1,11 @@
|
||||
<tr id=<%="contact_issue_#{issue_item.id}"%>>
|
||||
<td class="done_checkbox">
|
||||
<%= check_box_tag :close, '', issue_item.closed?, :disabled => (issue_item.assigned_to != User.current) || issue_item.closed?, :onclick => "$(this).attr('disabled', 'disabled'); $('#contact_issue_#{issue_item.id}').css('text-decoration', 'line-through');$.post('#{url_for({:controller => "contacts_issues", :action => "close", :issue_id => issue_item.id})}');".html_safe unless Setting.plugin_redmine_contacts[:one_click_close] %>
|
||||
</td>
|
||||
|
||||
<td class="issue_item_subject">
|
||||
<%= link_to(issue_item.subject, {:controller => :issues, :action => :show, :id => issue_item}, :class => "issue status-#{issue_item.status_id} priority-#{issue_item.priority_id} #{'closed' if issue_item.closed?}") %>
|
||||
<%= avatar(issue_item.assigned_to, :size => "14", :title => issue_item.assigned_to.name).to_s.html_safe if issue_item.assigned_to %>
|
||||
</td>
|
||||
<td style="vertical-align: top; text-align: right;"><%= format_date(issue_item.due_date) %></td>
|
||||
</tr>
|
||||
@@ -0,0 +1,35 @@
|
||||
<div id="contact_issues" class="contact-issues">
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_issue_new), {}, :onclick => "$('#add_issue').show(); $('#add_issue_link').hide(); return false;", :id => 'add_issue_link' if User.current.allowed_to?(:add_issues, @project) && User.current.allowed_to?(:manage_contact_issue_relations, @project) %>
|
||||
</div>
|
||||
|
||||
<h3><%= @contact_issues_count > 0 ? link_to("#{l(:label_issue_plural)} (#{@contact_issues_count})", {:controller => 'issues',
|
||||
:action => 'index',
|
||||
:set_filter => 1,
|
||||
:f => [:contacts, :status_id],
|
||||
:v => {:contacts => [@contact.id]},
|
||||
:op => {:contacts => '=', :status_id => '*'}}) : "#{l(:label_issue_plural)} (#{@contact_issues_count})" %> </h3>
|
||||
|
||||
|
||||
<%= error_messages_for 'issue' %>
|
||||
|
||||
<% if User.current.allowed_to?(:add_issues, @project) %>
|
||||
<div id="add_issue" style="display:none;">
|
||||
<%= form_tag({ :controller => "contacts_issues", :action => "create_issue", :project_id => @project, :id => contact}, :multipart => true, :id => "add_issue_form") do %>
|
||||
|
||||
<%= render :partial => 'contacts_issues/attributes' %>
|
||||
|
||||
<%= link_to l(:button_cancel), {}, :onclick => "$('#add_issue').hide(); $('#add_issue_link').show(); return false;" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if issues.any? %>
|
||||
<table style="width:100%">
|
||||
<%= render :partial => 'contacts_issues/issue_item', :collection => issues %>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<h3 class="title"><%= l(:label_crm_add_contact_plural) %></h3>
|
||||
|
||||
<%= form_tag({:controller => 'contacts_issues',
|
||||
:action => 'create',
|
||||
:issue_id => @issue,
|
||||
:project_id => @project},
|
||||
:remote => true,
|
||||
:method => :post,
|
||||
:id => 'add-contact-form') do %>
|
||||
|
||||
<p><%= label_tag 'contact_search', l(:label_crm_search_for_contact) %>:<%= text_field_tag 'contact_search', nil, :placeholder => l(:label_crm_contact_search) %></p>
|
||||
<%= 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 => ContactsSetting.cross_project_contacts? ? '1' : '0')}')" %>
|
||||
|
||||
<div id="contacts_for_issue">
|
||||
<%= contacts_check_box_tags 'contacts_issue[contact_ids][]', Contact.includes(:avatar).by_project(ContactsSetting.cross_project_contacts? ? nil : @project).visible.first(100) - @issue.contacts %>
|
||||
</div>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_add), :name => nil, :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
|
||||
<% end %>
|
||||
@@ -0,0 +1 @@
|
||||
<%= contacts_check_box_tags 'contacts_issue[contact_ids][]', @contacts %>
|
||||
@@ -0,0 +1,5 @@
|
||||
<% if RedmineContacts.settings[:show_closed_issues] %>
|
||||
$('#contact_issue_<%= params[:issue_id] %> td.task_item_subject a').toggleClass('closed');
|
||||
<% else %>
|
||||
$('#contact_issue_<%= params[:issue_id] %>').effect('fade', {}, 1000);
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'contacts_issues/new_modal') %>');
|
||||
$('#issue_contacts').html('<%= escape_javascript(render :partial => 'contacts_issues/contacts') %>');
|
||||
@@ -0,0 +1 @@
|
||||
$('#issue_contacts #contact_<%= @contact.id %>').effect('fade');
|
||||
@@ -0,0 +1,3 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'contacts_issues/new_modal') %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').addClass('new-contacts-issue');
|
||||
Reference in New Issue
Block a user