Bug 7991: Add itemcallnumber into the serial collection tab
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 3 May 2012 12:58:25 +0000 (14:58 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Sat, 15 Sep 2012 05:54:00 +0000 (07:54 +0200)
This patch adds a new column containing the itemcallnumber value into
the serial collection tab (opac detail).
  930$a for UNIMARC
  852$h for others

Signed-off-by: Stephane Delaye <stephane.delaye@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(Added Stephane Delaye's sign off at the same time as mine)
As this view has never worked with MARC21, I am comfortable signing
off on the fact that the patch does not in any way impact the MARC21
display.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
opac/opac-detail.pl

index be300b1..de97b5a 100644 (file)
@@ -701,8 +701,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <table id="serialcollectiont">
        <thead>
            <tr>
-               <th id="serial_library">Library</th>
-               <th id="seral_collection">Serial collection</th>
+            <th id="serial_library">Library</th>
+            <th id="serial_collection">Serial collection</th>
+            <th id="serial_itemcallnumber">Item callnumber</th>
            </tr>
        </thead>
        <tbody>
@@ -710,6 +711,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
            <tr>
                <td>[% serialcollection.branch %]</td>
                <td>[% serialcollection.text %]</td>
+        <td>[% serialcollection.itemcallnumber %]</td>
            </tr>
        [% END %]
        </tbody>
index feaa89b..cdb4a5a 100755 (executable)
@@ -722,6 +722,9 @@ if (C4::Context->preference("OPACFRBRizeEditions")==1) {
 
 # Serial Collection
 my @sc_fields = $record->field(955);
+my @lc_fields = $marcflavour eq 'UNIMARC'
+    ? $record->field(930)
+    : $record->field(852);
 my @serialcollections = ();
 
 foreach my $sc_field (@sc_fields) {
@@ -729,9 +732,15 @@ foreach my $sc_field (@sc_fields) {
 
     $row_data{text}    = $sc_field->subfield('r');
     $row_data{branch}  = $sc_field->subfield('9');
+    foreach my $lc_field (@lc_fields) {
+        $row_data{itemcallnumber} = $marcflavour eq 'UNIMARC'
+            ? $lc_field->subfield('a') # 930$a
+            : $lc_field->subfield('h') # 852$h
+            if ($sc_field->subfield('5') eq $lc_field->subfield('5'));
+    }
 
     if ($row_data{text} && $row_data{branch}) { 
-       push (@serialcollections, \%row_data);
+        push (@serialcollections, \%row_data);
     }
 }