From 3b68357b97d75ae97be9efbd63337341eb43a586 Mon Sep 17 00:00:00 2001 From: Remizov N Date: Mon, 18 Jun 2018 16:40:39 +0300 Subject: [PATCH 1/3] Delete issues_controller_patch.rb --- lib/issues_controller_patch.rb | 48 ---------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 lib/issues_controller_patch.rb diff --git a/lib/issues_controller_patch.rb b/lib/issues_controller_patch.rb deleted file mode 100644 index 7acc504..0000000 --- a/lib/issues_controller_patch.rb +++ /dev/null @@ -1,48 +0,0 @@ -module IssueHotButtons - module IssuesControllerPatch - - def self.included(base) - base.send(:helper, :sort) - base.send(:include, SortHelper) - base.send(:include, InstanceMethods) - base.class_eval do - before_filter :nearby_issues, :only => :show - before_filter :store_last_seen_project, :only => :index - end - end - - module InstanceMethods - def nearby_issues - restore_project = nil - unless session[:last_seen_project].nil? - last_seen_project = Project.find(session[:last_seen_project]) - if @project.self_and_ancestors.include? last_seen_project - restore_project = @project - @project = last_seen_project - end - end - - session['issues_show_sort'] = session['issues_index_sort'] unless session['issues_index_sort'].nil? - retrieve_query - sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) - sort_update(@query.sortable_columns) - - @nearby_issues = []; - if @query.valid? - @issues = @query.issues( - :include => [:assigned_to, :tracker, :priority, :category, :fixed_version], - :order => sort_clause - ) - @issues.uniq! - @issues.each {|issue| @nearby_issues.push issue.id} - end - - @project = restore_project unless restore_project.nil? - end - - def store_last_seen_project - session[:last_seen_project] = @project.id unless @project.nil? - end - end - end -end \ No newline at end of file From 38b788e496aeca35f6ee30779c625c581537b339 Mon Sep 17 00:00:00 2001 From: Remizov N Date: Mon, 18 Jun 2018 16:43:35 +0300 Subject: [PATCH 2/3] Removed include of issues_controller_patch --- init.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/init.rb b/init.rb index 3142c4c..5cd5767 100644 --- a/init.rb +++ b/init.rb @@ -7,11 +7,6 @@ object_to_prepare = Rails.configuration end -object_to_prepare.to_prepare do - require File.dirname(__FILE__) + '/lib/issues_controller_patch.rb' - IssuesController.send(:include, IssueHotButtons::IssuesControllerPatch) -end - class Hooks < Redmine::Hook::ViewListener render_on :view_issues_show_details_bottom, :partial => 'hot_buttons/assets', From 1fc3061d9734a50f257e51520ea858a9aeeb5d0e Mon Sep 17 00:00:00 2001 From: Remizov N Date: Wed, 27 Jun 2018 11:55:25 +0300 Subject: [PATCH 3/3] Update hot_buttons.js --- assets/javascripts/hot_buttons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/hot_buttons.js b/assets/javascripts/hot_buttons.js index 03b4f86..e439bba 100755 --- a/assets/javascripts/hot_buttons.js +++ b/assets/javascripts/hot_buttons.js @@ -580,7 +580,7 @@ jQuery(document).ready(function() { var include_comment = button.config.get('include_comment').evalJSON(); if (include_comment) { //Fix to make this plugin compatible with CKEditor plugin - if (CKEDITOR && CKEDITOR.instances["issue_notes"]) { + if (typeof CKEDITOR != "undefined" && CKEDITOR && CKEDITOR.instances["issue_notes"]) { //destroy CKEDITOR so it won't replace notes text with his empty value on submit try { CKEDITOR.instances["issue_notes"].destroy()