changeset 528:7c7199e1f174 cannam_integration

Merge from branch "feature_36"
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Mon, 25 Jul 2011 15:00:31 +0100
parents ceca8eb1ac6e (current diff) af95d9a7507a (diff)
children 0058debf7871
files config/locales/en-GB.yml
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/ssamr_user_detail.rb	Mon Jul 25 13:17:08 2011 +0100
+++ b/app/models/ssamr_user_detail.rb	Mon Jul 25 15:00:31 2011 +0100
@@ -10,5 +10,15 @@
       institution_id.blank? and other_institution.blank?
   end
 
-
+  def institution_name()
+    if not self.institution_type.nil?
+      if self.institution_type
+        Institution.find(self.institution_id).name
+      else
+        self.other_institution
+      end
+    else
+      ""
+    end
+  end
 end
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb	Mon Jul 25 13:17:08 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb	Mon Jul 25 15:00:31 2011 +0100
@@ -39,10 +39,8 @@
           
           info[:name_on_paper] = "No Name"
           info[:email] = self.mail
-          if self.ssamr_user_detail
-            info[:institution]  = self.ssamr_user_detail.institution
-          else
-            info[:institution] = "No institution"
+          if not self.ssamr_user_detail.nil?
+            info[:institution]  = self.ssamr_user_detail.institution_name
           end
         end