Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make checklist plugin compatible to Redmine 4.0.4 #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/models/issue_checklist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ class IssueChecklist < ActiveRecord::Base
belongs_to :issue
belongs_to :author, class_name: 'User', foreign_key: 'author_id'
has_one :comment, as: :commented, dependent: :delete
acts_as_list

attr_accessible :is_done, :subject
attr_protected :id
acts_as_tree

validates_presence_of :subject

Expand Down
8 changes: 2 additions & 6 deletions app/views/issues/_checklist.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
<% end %>

<% content_for :header_tags do %>
<% if Redmine::VERSION::MAJOR == 3 || (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 1) %>
<%= javascript_include_tag 'jquery.klass.js', plugin: 'redmine_issue_checklist' %>
<%= javascript_include_tag 'issue_checklist.jquery.js', plugin: 'redmine_issue_checklist' %>
<% else %>
<%= javascript_include_tag 'issue_checklist.prototype.js', plugin: 'redmine_issue_checklist' %>
<% end %>
<%= javascript_include_tag 'jquery.klass.js', plugin: 'redmine_issue_checklist' %>
<%= javascript_include_tag 'issue_checklist.jquery.js', plugin: 'redmine_issue_checklist' %>
<%= stylesheet_link_tag :issue_checklist, plugin: 'redmine_issue_checklist' %>
<% end %>
8 changes: 2 additions & 6 deletions app/views/issues/_checklist_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@


<% content_for :header_tags do %>
<% if Redmine::VERSION::MAJOR == 3 || (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 1) %>
<%= javascript_include_tag 'jquery.klass.js', plugin: 'redmine_issue_checklist' %>
<%= javascript_include_tag 'issue_checklist.jquery.js', plugin: 'redmine_issue_checklist' %>
<% else %>
<%= javascript_include_tag 'issue_checklist.prototype.js', plugin: 'redmine_issue_checklist' %>
<% end %>
<%= javascript_include_tag 'jquery.klass.js', plugin: 'redmine_issue_checklist' %>
<%= javascript_include_tag 'issue_checklist.jquery.js', plugin: 'redmine_issue_checklist' %>
<%= stylesheet_link_tag :issue_checklist, plugin: 'redmine_issue_checklist' %>
<% end %>
89 changes: 0 additions & 89 deletions assets/javascripts/issue_checklist.js

This file was deleted.

108 changes: 0 additions & 108 deletions assets/javascripts/issue_checklist.prototype.js

This file was deleted.

2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
map.project_module :issue_tracking do |map|
map.permission :view_checklists, {}
map.permission :done_checklists, { issue_checklist: :done }
map.permission :edit_checklists, { issue_checklist: :delete, issue_checklist: :done }
map.permission :edit_checklists, { issue_checklist: [:delete, :done] }
end
end

Expand Down
3 changes: 2 additions & 1 deletion lib/redmine_issue_checklist/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module IssuePatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :copy_from, :checklist
alias_method :copy_from_with_checklist, :copy_from
alias_method :copy_from, :copy_from_with_checklist
has_many :checklist, class_name: 'IssueChecklist', dependent: :destroy
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module IssuesControllerPatch
extend ActiveSupport::Concern

included do
alias_method_chain :build_new_issue_from_params, :checklist
alias_method :build_new_issue_from_params_with_checklist, :build_new_issue_from_params
alias_method :build_new_issue_from_params, :build_new_issue_from_params_with_checklist
end

def build_new_issue_from_params_with_checklist
Expand Down