Lines 38-44
use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue );
Link Here
|
38 |
use C4::Members; |
38 |
use C4::Members; |
39 |
use C4::Biblio qw( TransformMarcToKoha ); |
39 |
use C4::Biblio qw( TransformMarcToKoha ); |
40 |
use C4::Search qw( new_record_from_zebra ); |
40 |
use C4::Search qw( new_record_from_zebra ); |
41 |
use C4::Reserves; |
41 |
use C4::Reserves qw( ModReserveAffect ); |
42 |
use Koha::Holds; |
42 |
use Koha::Holds; |
43 |
use C4::Context; |
43 |
use C4::Context; |
44 |
use CGI::Session; |
44 |
use CGI::Session; |
Lines 69-74
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');
Link Here
|
69 |
my $sessionID = $query->cookie("CGISESSID") ; |
69 |
my $sessionID = $query->cookie("CGISESSID") ; |
70 |
my $session = get_session($sessionID); |
70 |
my $session = get_session($sessionID); |
71 |
|
71 |
|
|
|
72 |
my $userenv = C4::Context->userenv; |
73 |
my $branch = $userenv->{'branch'} // ''; |
74 |
my $desk_id = $userenv->{"desk_id"} || ''; |
75 |
|
72 |
my $barcodes = []; |
76 |
my $barcodes = []; |
73 |
my $barcode = $query->param('barcode'); |
77 |
my $barcode = $query->param('barcode'); |
74 |
my $findborrower; |
78 |
my $findborrower; |
Lines 88-93
if (C4::Context->preference("AutoSwitchPatron") && $barcode) {
Link Here
|
88 |
$findborrower ||= $query->param('findborrower') || q{}; |
92 |
$findborrower ||= $query->param('findborrower') || q{}; |
89 |
$findborrower =~ s|,| |g; |
93 |
$findborrower =~ s|,| |g; |
90 |
|
94 |
|
|
|
95 |
if ( $query->param('confirm_hold') ) { |
96 |
my $reserve_id = $query->param('confirm_hold'); |
97 |
my $hold_branch = $query->param('hold_branch'); |
98 |
my $hold_itemnumber = $query->param('hold_itemnumber'); |
99 |
my $hold_borrowernumber = $query->param('hold_borrowernumber'); |
100 |
my $diffBranchSend = ( $branch ne $hold_branch ); |
101 |
|
102 |
# diffBranchSend tells ModReserveAffect whether document is expected in this library or not, |
103 |
# i.e., whether to apply waiting status |
104 |
ModReserveAffect( $hold_itemnumber, $hold_borrowernumber, $diffBranchSend, $reserve_id, $desk_id ); |
105 |
} |
106 |
|
91 |
# Barcode given by user could be '0' |
107 |
# Barcode given by user could be '0' |
92 |
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) { |
108 |
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) { |
93 |
$barcodes = [ $barcode ]; |
109 |
$barcodes = [ $barcode ]; |
Lines 134-140
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
Link Here
|
134 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
150 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
135 |
|
151 |
|
136 |
my $force_allow_issue = $query->param('forceallow') || 0; |
152 |
my $force_allow_issue = $query->param('forceallow') || 0; |
137 |
if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) { |
153 |
if (!C4::Auth::haspermission( $userenv->{id} , { circulate => 'force_checkout' } )) { |
138 |
$force_allow_issue = 0; |
154 |
$force_allow_issue = 0; |
139 |
} |
155 |
} |
140 |
my $onsite_checkout = $query->param('onsite_checkout'); |
156 |
my $onsite_checkout = $query->param('onsite_checkout'); |
Lines 151-158
my @failedreturns = $query->multi_param('failedreturn');
Link Here
|
151 |
our %return_failed = (); |
167 |
our %return_failed = (); |
152 |
for (@failedreturns) { $return_failed{$_} = 1; } |
168 |
for (@failedreturns) { $return_failed{$_} = 1; } |
153 |
|
169 |
|
154 |
my $branch = C4::Context->userenv->{'branch'}; |
|
|
155 |
|
156 |
for my $barcode ( @$barcodes ) { |
170 |
for my $barcode ( @$barcodes ) { |
157 |
$barcode = barcodedecode( $barcode ) if $barcode; |
171 |
$barcode = barcodedecode( $barcode ) if $barcode; |
158 |
} |
172 |
} |