# HG changeset patch # User luisf # Date 1312998240 -3600 # Node ID bed7ea82663d3d373073a2d478f85313a51f521b # Parent 4ee092298206203ed1f503c18eb307990b35960a Some Author/User logic. diff -r 4ee092298206 -r bed7ea82663d vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Aug 10 17:58:16 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Aug 10 18:44:00 2011 +0100 @@ -21,38 +21,33 @@ # fc defined in the users_author_patch author_info = author.get_author_info - - link_text = h(author.name) - - user = author - + elsif author.class == Author Rails.logger.debug { "Identify Author: AUTHOR" } author_info = { :name_on_paper => author.name, - :author_user_id => author.user_id, - :id => author.id, - :is_user => "0" + :author_user_id => '', + :is_user => '0', + :institution => "", + :email => "" } - link_text = h(author.name) - - user = author.user - end + link_text = h(author.name) - unless user.nil? - author_info[:email] = user.mail - unless user.ssamr_user_detail.nil? - author_info[:institution] = user.ssamr_user_detail.institution_name - suffix = '' + h(author_info[:institution]) + '' + if author.user.nil? + author_info[:author_user_id] = author.id + # TODO: AUTHORSHIPS INFORMATION +# else +# author_info[:email] = author.user.mail +# author_info[:institution] = author.user.institution_name end end - unless link_text.empty? - link_to_function(link_text, "update_author_info(this," + author_info.to_json + ")") + ' ' + suffix - end + suffix = '' + h(author_info[:institution]) + '' + + link_to_function(link_text, "update_author_info(this," + author_info.to_json + ")") + ' ' + suffix end def choose_author_link(name, authors_users) diff -r 4ee092298206 -r bed7ea82663d vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb --- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Wed Aug 10 17:58:16 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Wed Aug 10 18:44:00 2011 +0100 @@ -22,7 +22,7 @@ :is_user => "1" } - unless self.ssamr_user_detail.nil? + if not self.ssamr_user_detail.nil? info[:institution] = self.ssamr_user_detail.institution_name end