Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls
[koha-equinox.git] / cataloguing / additem.pl
index a7db815..ce12b0a 100755 (executable)
@@ -95,7 +95,7 @@ sub set_item_default_location {
 # NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
 sub _increment_barcode {
     my ($record, $frameworkcode) = @_;
-    my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
+    my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
     unless ($record->field($tagfield)->subfield($tagsubfield)) {
         my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items");
         $sth_barcode->execute;
@@ -353,7 +353,7 @@ sub removeFieldsForPrefill {
     my $item = shift;
 
     # Getting item tag
-    my ($tag, $subtag) = GetMarcFromKohaField("items.barcode", '');
+    my ($tag, $subtag) = GetMarcFromKohaField( "items.barcode" );
 
     # Getting list of subfields to keep
     my $subfieldsToUseWhenPrefill = C4::Context->preference('SubfieldsToUseWhenPrefill');
@@ -526,7 +526,7 @@ if ($op eq "additem") {
         }
         else {
             # we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
-            my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
+            my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
             my $fieldItem = $itemrecord->field($tagfield);
             $itemrecord->delete_field($fieldItem);
             $fieldItem->delete_subfields($tagsubfield);
@@ -542,8 +542,8 @@ if ($op eq "additem") {
         my $barcodeobj = C4::Barcodes->new;
         my $copynumber = $addedolditem->{'copynumber'};
         my $oldbarcode = $addedolditem->{'barcode'};
-        my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
-        my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField("items.copynumber",$frameworkcode);
+        my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
+        my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField( "items.copynumber" );
 
     # If there is a barcode and we can't find their new values, we can't add multiple copies
        my $testbarcode;
@@ -629,7 +629,7 @@ if ($op eq "additem") {
     }
     else {
         # we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
-        my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
+        my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
         my $fieldItem = $itemrecord->field($tagfield);
         $itemrecord->delete_field($fieldItem);
         $fieldItem->delete_subfields($tagsubfield);
@@ -748,8 +748,8 @@ my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
 my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
 my @big_array;
 #---- finds where items.itemnumber is stored
-my (  $itemtagfield,   $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", $frameworkcode);
-my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", $frameworkcode);
+my (  $itemtagfield,   $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" );
+my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" );
 C4::Biblio::EmbedItemsInMarcBiblio({
     marc_record  => $temp,
     biblionumber => $biblionumber });
@@ -771,7 +771,7 @@ if ( C4::Context->preference('EasyAnalyticalRecords') ) {
                 biblionumber => $hostbiblionumber,
                 embed_items  => 1 });
             if ($hostrecord) {
-                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
+                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber' );
                 foreach my $hostitem ($hostrecord->field($itemfield)){
                     if ($hostitem->subfield('9') eq $hostfield->subfield('9')){
                         push (@fields, $hostitem);
@@ -831,7 +831,7 @@ foreach my $field (@fields) {
     }
 }
 
-my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$frameworkcode);
+my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField( "items.holdingbranch" );
 @big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array;
 
 # now, construct template !