Defect #28252

Updated by Mischa The Evil over 1 year ago


my patch.rb

<pre><code class="ruby">

=================================================================
require_dependency 'projects_helper'

module SampleProjectsHelperPatch
def self.included(base)
base.send(:include, ProjectsHelperMethodsSample)
base.class_eval do
alias_method_chain :project_settings_tabs, :redmine_dfi_category
end
end
end

module ProjectsHelperMethodsSample
def project_settings_tabs_with_redmine_dfi_category
tabs = project_settings_tabs_without_redmine_dfi_category
action = {:name => 'sample_plugin',
:controller => 'example',
:action => :show,
:partial => 'sample_settings/sample_plugin_settings', :label => :label_plugin_example}
tabs << action #if User.current.allowed_to?(action, @project)
tabs
end
end
</code></pre>

_________________________________________________________________________

my init.rb

<pre><code class="ruby">
adding
=========================================================================
require 'redmine'
#require 'tasks\dfi_category_helper_patch'
require 'dfi_category_issues_hook'
require 'dfi_category_controller_issue_hook'
require 'sample_projects_helper_patch'
Redmine::Plugin.register :redmine_dfi_category do
name 'Redmine Dfi Category plugin'
author 'Tony'
description 'This is a plugin for Redmine'
version '0.0.1'
url 'http://example.com/path/to/plugin'
author_url 'http://example.com/about'

menu :project_menu, :categories,{ :controller =>'dfi_categories', :action=>'index' }

project_module :dfi_categories do
permission :dfi, :dfi_categories => :index
permission :redmine_dfi_category, {:categories_setting => [:show, :edit]}, :require => :member
end

Rails.configuration.to_prepare do
require_dependency 'projects_helper'
unless ProjectsHelper.included_modules.include? SampleProjectsHelperPatch
ProjectsHelper.send(:include, SampleProjectsHelperPatch)
end
end
end
</code></pre>

_____________________________________________________________________________


I follow the plugin's patch of content
(https://github.com/akiko-pusu/redmine_issue_templates/blob/master/lib/issue_templates/projects_helper_patch.rb)

but my tab can't work...

thinks

Back