Revision 1070:858f042e8d11 vendor/plugins

View differences:

vendor/plugins/redmine_bibliography/init.rb
25 25
    Mailer.send(:include, Bibliography::MailerPatch)
26 26
  end
27 27

  
28
  unless ProjectsController.included_modules.include?(Bibliography::ProjectsControllerPatch)
29
   ProjectsController.send(:include, Bibliography::ProjectsControllerPatch)
28
  unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch)
29
    ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch)
30 30
  end
31

  
32 31
end
33 32

  
34 33

  
vendor/plugins/redmine_bibliography/lib/bibliography/projects_controller_patch.rb
1
# -*- coding: utf-8 -*-
2
require_dependency 'projects_controller'
3

  
4
module Bibliography
5
    module ProjectsControllerPatch
6
      def self.included(base)
7
        base.send(:include, InstanceMethods)
8

  
9
        base.class_eval do
10
          unloadable
11

  
12
          # reads the publications helper on the projects controller
13
          helper :publications
14
          include PublicationsHelper
15

  
16
        end
17
      end
18

  
19
      module InstanceMethods
20

  
21
      end
22

  
23
    end
24
end
vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb
1
module Bibliography
2
  module ProjectsHelperPatch
3

  
4
    def self.included(base) # :nodoc:
5
      base.send(:include, InstanceMethods)
6
      base.send(:include, PublicationsHelper)
7

  
8
      base.class_eval do
9
        unloadable
10
      end
11
    end
12

  
13
    module InstanceMethods
14
    end
15
  end
16
end
17

  
vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb
1 1
require_dependency 'user'
2 2

  
3 3
module Bibliography
4
  module UserAuthorPatch    
4
  module UserAuthorPatch
5 5
    def self.included(base)
6
      base.send(:include, InstanceMethods) 
7
      extend ClassMethods     
8
          
6
      base.send(:include, InstanceMethods)
7
      extend ClassMethods
8

  
9 9
    end #self.included
10
    
10

  
11 11
    module ClassMethods
12
    end  
13
    
12
    end
13

  
14 14
    module InstanceMethods
15 15

  
16 16
      def institution
......
18 18
          institution_name = self.ssamr_user_detail.institution_name
19 19
        else
20 20
          institution_name = "No Institution Set"
21
        end        
22
        return institution_name        
21
        end
22
        return institution_name
23 23
      end
24 24

  
25 25
      def get_author_info
26 26
        # TODO: DELETE THIS METHOD??
27
        info = { 
27
        info = {
28 28
          :name_on_paper =>  self.name,
29 29
          :email => self.mail,
30 30
          :institution => "",
31 31
          :author_user_id => self.id,
32
          :is_user => "1"                    
32
          :is_user => "1"
33 33
        }
34 34

  
35 35
        if not self.ssamr_user_detail.nil?
36 36
          info[:institution]  = self.ssamr_user_detail.institution_name
37 37
        end
38 38

  
39
        return info        
39
        return info
40 40
      end
41
                
41

  
42 42
    end #InstanceMethods
43
    
43

  
44 44
  end #UserPublicationsPatch
45 45
end #RedmineBibliography

Also available in: Unified diff