view plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb @ 1270:b2f7f52a164d redmine-2.2-integration

Fix project members page: update editlist partial following changes to project member settings partial; update mailer class and templates; make editlist forms not be remote (we just reload page)
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 02 May 2013 16:24:09 +0100
parents b4b72f1eb644
children d0d6bbe9f2e0
line wrap: on
line source
require_dependency 'user'

module Bibliography
  module UserAuthorPatch
    def self.included(base)
      base.send(:include, InstanceMethods)
      extend ClassMethods

    end #self.included

    module ClassMethods
    end

    module InstanceMethods

      def institution
        unless self.ssamr_user_detail.nil?
          institution_name = self.ssamr_user_detail.institution_name
        else
          institution_name = "No Institution Set"
        end
        return institution_name
      end

      def get_author_info
        # TODO: DELETE THIS METHOD??
        info = {
          :name_on_paper =>  self.name,
          :email => self.mail,
          :institution => "",
          :author_user_id => self.id,
          :is_user => "1"
        }

        if not self.ssamr_user_detail.nil?
          info[:institution]  = self.ssamr_user_detail.institution_name
        end

        return info
      end

    end #InstanceMethods

  end #UserPublicationsPatch
end #RedmineBibliography