[open-ils-commits] r15424 - trunk/Open-ILS/src/perlmods/OpenILS/Utils (djfiander)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Feb 1 19:49:09 EST 2010


Author: djfiander
Date: 2010-02-01 19:49:09 -0500 (Mon, 01 Feb 2010)
New Revision: 15424

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm
Log:
Include support for public notes in the formatted display


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm	2010-02-02 00:35:05 UTC (rev 15423)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD.pm	2010-02-02 00:49:09 UTC (rev 15424)
@@ -292,9 +292,14 @@
             # holdings statement, and this caption has the same one, then
             # we don't add the holdings again.
             if (!defined $last_txt || ($last_txt != $txt_link_ids{$cap_id})) {
+                my $txt = $txt_link_ids{$cap_id};
                 $holdings_stmt .= ',' if $holdings_stmt;
-                $holdings_stmt .= $txt_link_ids{$cap_id}->subfield('a');
-                $last_txt = $txt_link_ids{$cap_id};
+                $holdings_stmt .= $txt->subfield('a');
+                if (defined $txt->subfield('z')) {
+                    $holdings_stmt .= ' -- ' . $txt->subfield('z');
+                }
+
+                $last_txt = $txt;
             }
             next;
         }
@@ -317,7 +322,7 @@
 
             while (my $h = shift @holdings) {
                 if (!$h->matches($l->next)) {
-                    # this item is not part of the current run
+                    # this item is not part of the current run,
                     # close out the run and record this item
                     if ($l != $start) {
                         $holdings_stmt .= '-' . $l->format;
@@ -325,11 +330,17 @@
 
                     $holdings_stmt .= ',' . $h->format;
                     $start = $h
-                } elsif (!scalar(@holdings)) {
+                } elsif (!scalar(@holdings) || defined($h->subfield('z'))) {
                     # This is the end of the holdings for this caption
+                    # or this item has a public note that we want
+                    # to display
                     $holdings_stmt .= '-' . $h->format;
                 }
 
+                if (defined $h->subfield('z')) {
+                    $holdings_stmt .= ' -- ' . $h->subfield('z');
+                }
+
                 $l = $h;
             }
         } else {
@@ -337,6 +348,9 @@
             $holdings_stmt .= (shift @holdings)->format;
             foreach my $h (@holdings) {
                 $holdings_stmt .= ',' . $h->format;
+                if (defined $h->subfield('z')) {
+                    $holdings_stmt .= ' -- ' . $h->subfield('z');
+                }
             }
         }
     }



More information about the open-ils-commits mailing list