To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / lib / bibliography / user_author_patch.rb @ 1074:b98e55985cb7
History | View | Annotate | Download (1002 Bytes)
| 1 | 466:a7dc708d48a1 | luis | require_dependency 'user'
|
|---|---|---|---|
| 2 | |||
| 3 | module Bibliography |
||
| 4 | 1070:858f042e8d11 | luis | module UserAuthorPatch |
| 5 | 466:a7dc708d48a1 | luis | def self.included(base) |
| 6 | 1070:858f042e8d11 | luis | base.send(:include, InstanceMethods) |
| 7 | extend ClassMethods
|
||
| 8 | |||
| 9 | 466:a7dc708d48a1 | luis | end #self.included |
| 10 | 1070:858f042e8d11 | luis | |
| 11 | 483:cc267eb99115 | luis | module ClassMethods |
| 12 | 1070:858f042e8d11 | luis | end
|
| 13 | |||
| 14 | 483:cc267eb99115 | luis | module InstanceMethods |
| 15 | 518:b24091590b63 | luis | |
| 16 | 600:c3c1091639ad | luis | def institution |
| 17 | unless self.ssamr_user_detail.nil? |
||
| 18 | institution_name = self.ssamr_user_detail.institution_name
|
||
| 19 | else
|
||
| 20 | institution_name = "No Institution Set"
|
||
| 21 | 1070:858f042e8d11 | luis | end
|
| 22 | return institution_name
|
||
| 23 | 600:c3c1091639ad | luis | end
|
| 24 | |||
| 25 | 518:b24091590b63 | luis | def get_author_info |
| 26 | 600:c3c1091639ad | luis | # TODO: DELETE THIS METHOD??
|
| 27 | 1070:858f042e8d11 | luis | info = {
|
| 28 | 583:4ee092298206 | luis | :name_on_paper => self.name, |
| 29 | :email => self.mail, |
||
| 30 | 518:b24091590b63 | luis | :institution => "", |
| 31 | 563:a76abc63257a | luis | :author_user_id => self.id, |
| 32 | 1070:858f042e8d11 | luis | :is_user => "1" |
| 33 | 518:b24091590b63 | luis | } |
| 34 | |||
| 35 | 584:bed7ea82663d | luis | if not self.ssamr_user_detail.nil? |
| 36 | 582:7cca1ac03f0c | chris | info[:institution] = self.ssamr_user_detail.institution_name |
| 37 | end
|
||
| 38 | |||
| 39 | 1070:858f042e8d11 | luis | return info
|
| 40 | 563:a76abc63257a | luis | end
|
| 41 | 1070:858f042e8d11 | luis | |
| 42 | 483:cc267eb99115 | luis | end #InstanceMethods |
| 43 | 1070:858f042e8d11 | luis | |
| 44 | 466:a7dc708d48a1 | luis | end #UserPublicationsPatch |
| 45 | 567:5404f7dfb4b3 | chris | end #RedmineBibliography |