Mercurial > hg > soundsoftware-site
changeset 1070:858f042e8d11 bibplugin_cache
Created a patch for the ProjectsHelper to replace the one previously created for the Projects controller.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 21 Nov 2012 14:42:12 +0000 |
parents | 734fe0c6b3e4 |
children | fe32745aaa3d |
files | vendor/plugins/redmine_bibliography/init.rb vendor/plugins/redmine_bibliography/lib/bibliography/projects_controller_patch.rb vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb |
diffstat | 4 files changed, 33 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/init.rb Wed Nov 21 11:24:42 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/init.rb Wed Nov 21 14:42:12 2012 +0000 @@ -25,10 +25,9 @@ Mailer.send(:include, Bibliography::MailerPatch) end - unless ProjectsController.included_modules.include?(Bibliography::ProjectsControllerPatch) - ProjectsController.send(:include, Bibliography::ProjectsControllerPatch) + unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) + ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) end - end
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/projects_controller_patch.rb Wed Nov 21 11:24:42 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -require_dependency 'projects_controller' - -module Bibliography - module ProjectsControllerPatch - def self.included(base) - base.send(:include, InstanceMethods) - - base.class_eval do - unloadable - - # reads the publications helper on the projects controller - helper :publications - include PublicationsHelper - - end - end - - module InstanceMethods - - end - - end -end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb Wed Nov 21 14:42:12 2012 +0000 @@ -0,0 +1,17 @@ +module Bibliography + module ProjectsHelperPatch + + def self.included(base) # :nodoc: + base.send(:include, InstanceMethods) + base.send(:include, PublicationsHelper) + + base.class_eval do + unloadable + end + end + + module InstanceMethods + end + end +end +
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Wed Nov 21 11:24:42 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Wed Nov 21 14:42:12 2012 +0000 @@ -1,16 +1,16 @@ require_dependency 'user' module Bibliography - module UserAuthorPatch + module UserAuthorPatch def self.included(base) - base.send(:include, InstanceMethods) - extend ClassMethods - + base.send(:include, InstanceMethods) + extend ClassMethods + end #self.included - + module ClassMethods - end - + end + module InstanceMethods def institution @@ -18,28 +18,28 @@ institution_name = self.ssamr_user_detail.institution_name else institution_name = "No Institution Set" - end - return institution_name + end + return institution_name end def get_author_info # TODO: DELETE THIS METHOD?? - info = { + info = { :name_on_paper => self.name, :email => self.mail, :institution => "", :author_user_id => self.id, - :is_user => "1" + :is_user => "1" } if not self.ssamr_user_detail.nil? info[:institution] = self.ssamr_user_detail.institution_name end - return info + return info end - + end #InstanceMethods - + end #UserPublicationsPatch end #RedmineBibliography