# 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;
+use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Biblio;
use C4::Members;
use C4::Auth qw/checkauth/;
+use Koha::Items;
+use Koha::Patrons;
+
my $input = CGI->new();
checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
my $expirationdate = $input->param('expiration_date');
my $itemtype = $input->param('itemtype') || undef;
-my $borrower = GetMember( 'borrowernumber' => $borrowernumber );
+my $borrower = Koha::Patrons->find( $borrowernumber );
+$borrower = $borrower->unblessed if $borrower;
my $multi_hold = $input->param('multi_hold');
my $biblionumbers = $multi_hold ? $input->param('biblionumbers') : ($biblionumber . '/');
my $found;
-# if we have an item selectionned, and the pickup branch is the same as the holdingbranch
-# of the document, we force the value $rank and $found .
-if (defined $checkitem && $checkitem ne ''){
- $holds_to_place_count = 1;
- $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns');
- my $item = $checkitem;
- $item = GetItem($item);
- if ( $item->{'holdingbranch'} eq $branch ){
- $found = 'W' unless C4::Context->preference('ReservesNeedReturns');
- }
-}
-
if ( $type eq 'str8' && $borrower ) {
foreach my $biblionumber ( keys %bibinfos ) {
}
if ( defined $checkitem && $checkitem ne '' ) {
- my $item = GetItem($checkitem);
- if ( $item->{'biblionumber'} ne $biblionumber ) {
- $biblionumber = $item->{'biblionumber'};
+ my $item = Koha::Items->find($checkitem);
+ if ( $item->biblionumber ne $biblionumber ) {
+ $biblionumber = $item->biblionumber;
}
}
print $input->redirect("request.pl?biblionumber=$biblionumber");
}
}
-elsif ( $borrower eq '' ) {
+elsif ( $borrowernumber eq '' ) {
print $input->header();
print "Invalid borrower number please try again";