View | Details | Raw Unified | Return to bug 35518
Collapse All | Expand All

(-)a/circ/circulation.pl (-39 / +41 lines)
Lines 63-108 use List::MoreUtils qw( uniq ); Link Here
63
#
63
#
64
my $query = CGI->new;
64
my $query = CGI->new;
65
65
66
my $override_high_holds     = $query->param('override_high_holds');
66
my $borrowernumber = $query->param('borrowernumber');
67
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');
68
69
my $sessionID = $query->cookie("CGISESSID") ;
70
my $session = get_session($sessionID);
71
72
my $userenv = C4::Context->userenv;
73
my $branch  = $userenv->{'branch'} // '';
74
my $desk_id = $userenv->{"desk_id"} || '';
75
76
my $barcodes = [];
67
my $barcodes = [];
77
my $barcode =  $query->param('barcode');
68
my $barcode =  $query->param('barcode');
78
my $findborrower;
79
my $autoswitched;
80
my $borrowernumber = $query->param('borrowernumber');
81
82
if (C4::Context->preference("AutoSwitchPatron") && $barcode) {
83
    my $new_barcode = $barcode;
84
    Koha::Plugins->call( 'patron_barcode_transform', \$new_barcode );
85
    if (Koha::Patrons->search( { cardnumber => $new_barcode} )->count() > 0) {
86
        $findborrower = $barcode;
87
        undef $barcode;
88
        undef $borrowernumber;
89
        $autoswitched = 1;
90
    }
91
}
92
$findborrower ||= $query->param('findborrower') || q{};
93
$findborrower =~ s|,| |g;
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
69
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
70
107
# Barcode given by user could be '0'
71
# Barcode given by user could be '0'
108
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
72
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
Lines 121-127 if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) { Link Here
121
        @$barcodes = $query->multi_param('barcodes');
85
        @$barcodes = $query->multi_param('barcodes');
122
    }
86
    }
123
}
87
}
124
125
$barcodes = [ uniq @$barcodes ];
88
$barcodes = [ uniq @$barcodes ];
126
89
127
my $template_name = q|circ/circulation.tt|;
90
my $template_name = q|circ/circulation.tt|;
Lines 147-152 my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( Link Here
147
        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
110
        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
148
    }
111
    }
149
);
112
);
113
114
my $override_high_holds     = $query->param('override_high_holds');
115
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');
116
117
my $sessionID = $query->cookie("CGISESSID") ;
118
my $session = get_session($sessionID);
119
120
my $userenv = C4::Context->userenv;
121
my $branch  = $userenv->{'branch'} // '';
122
my $desk_id = $userenv->{"desk_id"} || '';
123
124
my $findborrower;
125
my $autoswitched;
126
127
if (C4::Context->preference("AutoSwitchPatron") && $barcode) {
128
    my $new_barcode = $barcode;
129
    Koha::Plugins->call( 'patron_barcode_transform', \$new_barcode );
130
    if (Koha::Patrons->search( { cardnumber => $new_barcode} )->count() > 0) {
131
        $findborrower = $barcode;
132
        undef $barcode;
133
        undef $borrowernumber;
134
        $autoswitched = 1;
135
    }
136
}
137
$findborrower ||= $query->param('findborrower') || q{};
138
$findborrower =~ s|,| |g;
139
140
if ( $query->param('confirm_hold') ) {
141
    my $reserve_id          = $query->param('confirm_hold');
142
    my $hold_branch         = $query->param('hold_branch');
143
    my $hold_itemnumber     = $query->param('hold_itemnumber');
144
    my $hold_borrowernumber = $query->param('hold_borrowernumber');
145
    my $diffBranchSend      = ( $branch ne $hold_branch );
146
147
    # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
148
    # i.e., whether to apply waiting status
149
    ModReserveAffect( $hold_itemnumber, $hold_borrowernumber, $diffBranchSend, $reserve_id, $desk_id );
150
}
151
152
150
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
153
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
151
154
152
my $force_allow_issue = $query->param('forceallow') || 0;
155
my $force_allow_issue = $query->param('forceallow') || 0;
153
- 

Return to bug 35518