Bug 14402: Add function purge_zero_balance_fees to C4/Accounts.pm
[koha.git] / C4 / Breeding.pm
index d1dbbcb..18bf03b 100644 (file)
@@ -5,18 +5,18 @@ package C4::Breeding;
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use strict;
 use warnings;
@@ -430,9 +430,8 @@ sub ImportBreedingAuth {
     my $batch_id = GetZ3950BatchId($filename);
     my $searchbreeding = $dbh->prepare("select import_record_id from import_auths where control_number=? and authorized_heading=?");
 
-#     $encoding = C4::Context->preference("marcflavour") unless $encoding;
-    my $marc_type = C4::Context->preference('marcflavour');
-    $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC');
+    my $marcflavour = C4::Context->preference('marcflavour');
+    my $marc_type = $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : $marcflavour;
 
     # fields used for import results
     my $imported=0;
@@ -521,6 +520,7 @@ sub Z3950SearchAuth {
     my $subject= $pars->{subject};
     my $subjectsubdiv= $pars->{subjectsubdiv};
     my $srchany= $pars->{srchany};
+    my $authid= $pars->{authid};
 
     my $show_next       = 0;
     my $total_pages     = 0;
@@ -545,8 +545,8 @@ sub Z3950SearchAuth {
     my $query;
     my $nterms=0;
 
-    my $marc_type = C4::Context->preference('marcflavour');
-    $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC');
+    my $marcflavour = C4::Context->preference('marcflavour');
+    my $marc_type = $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : $marcflavour;
 
     if ($nameany) {
         $query .= " \@attr 1=1002 \"$nameany\" "; #Any name (this includes personal, corporate, meeting/conference authors, and author names in subject headings)
@@ -619,7 +619,7 @@ sub Z3950SearchAuth {
             $oConnection[$s] = create ZOOM::Connection($option1);
             $oConnection[$s]->connect( $server->{host}, $server->{port} );
             $serverhost[$s] = $server->{host};
-            $servername[$s] = $server->{name};
+            $servername[$s] = $server->{servername};
             $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
             $s++;
         }    ## while fetch
@@ -673,11 +673,12 @@ sub Z3950SearchAuth {
                             $row_data{server}       = $servername[$k];
                             $row_data{breedingid}   = $breedingid;
                             $row_data{heading}      = $heading;
+                            $row_data{authid}       = $authid;
                             $row_data{heading_code}      = $heading_authtype_code;
                             push( @breeding_loop, \%row_data );
                         }
                         else {
-                            push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1});
+                            push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'authid'=>-1});
                         }
                     }
                 }    #if $numresults