Fix for Bug 4946 - hold warning needs rewording
[koha_gimpoz] / C4 / Biblio.pm
index 6a422be..c3a3094 100644 (file)
@@ -67,6 +67,7 @@ BEGIN {
 
       &GetISBDView
 
+      &GetMarcControlnumber
       &GetMarcNotes
       &GetMarcSubjects
       &GetMarcBiblio
@@ -1254,6 +1255,28 @@ sub GetAuthorisedValueDesc {
     }
 }
 
+=head2 GetMarcControlnumber
+
+  $marccontrolnumber = GetMarcControlnumber($record,$marcflavour);
+
+Get the control number / record Identifier from the MARC record and return it.
+
+=cut
+
+sub GetMarcControlnumber {
+    my ( $record, $marcflavour ) = @_;
+    my $controlnumber = "";
+    # Control number or Record identifier are the same field in MARC21 and UNIMARC
+    # Keep $marcflavour for possible later use
+    if ($marcflavour eq "MARC21" || $marcflavour eq "UNIMARC") {
+        my $controlnumberField = $record->field('001');
+        if ($controlnumberField) {
+            $controlnumber = $controlnumberField->data();
+        }
+    }
+    return $controlnumber;
+}
+
 =head2 GetMarcNotes
 
   $marcnotesarray = GetMarcNotes( $record, $marcflavour );