app/helpers/marc_heading_helper.rb
# Returns titles based on any linked 880's for the 245.
# Too hard to do this with MarcPresenter, we do it by hand, sorry
# it results in confusing code. 
Returns titles based on any linked 880's for the 245.
Too hard to do this with MarcPresenter, we do it by hand, sorry
it results in confusing code.
Returns titles based on any linked 880 ' s for the 245 . Too hard to do this with MarcPresenter we do it by hand sorry it results in confusing code .
def heading_linked_titles(document)
    marc = document_to_marc(document)
    return linked_marc_fields(marc, marc['245']).collect do |field|
      title =  field.find_all do |subfield|
        "a".include?( subfield.code)
      end.collect {|sv| sv.value}.join(" ")  
      subtitle = field.find_all do |subfield|
      "bfnps".include?(subfield.code)
      end.collect {|sv| sv.value}.join(" ")
      strip_edge_punctuation( title ) + 
      (subtitle.empty? ? "" : ":") + 
      strip_edge_punctuation( subtitle )
    end    
  end
def heading_linked_titles ( document ) marc = document_to_marc ( document ) return linked_marc_fields ( marc , marc [ '245' ] ) . collect do | field | title = field . find_all do | subfield | "a" . include? ( subfield . code ) end . collect { | sv | sv . value } . join ( " " ) subtitle = field . find_all do | subfield | "bfnps" . include? ( subfield . code ) end . collect { | sv | sv . value } . join ( " " ) strip_edge_punctuation ( title ) + ( subtitle . empty? ? "" : ":" ) + strip_edge_punctuation ( subtitle ) end end
Returns titles based on any linked 880's for the 245.
Returns titles based on any linked 880 ' s for the 245 .
document
<not_specific>