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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-6 / +10 lines)
Lines 118-124 Link Here
118
                        <div class="alert alert-warning"><h2>Please confirm the checkout:</h2>
118
                        <div class="alert alert-warning"><h2>Please confirm the checkout:</h2>
119
                            <span class="sco-alert-warning confirm"></span>
119
                            <span class="sco-alert-warning confirm"></span>
120
                            [% IF ( confirm_renew_issue ) %]
120
                            [% IF ( confirm_renew_issue ) %]
121
                                <p>This item is already checked out to you.</p>
121
                                <p>This item is already checked out to you: <b>[% confirm | html %]</b> <i>([% barcode | html %])</i></p>
122
                            [% END %]
122
                            [% END %]
123
123
124
                            [% IF ( renew && Koha.Preference('SCOAllowCheckin') ) %]
124
                            [% IF ( renew && Koha.Preference('SCOAllowCheckin') ) %]
Lines 193-207 Link Here
193
                    [% END %]
193
                    [% END %]
194
194
195
                    [% IF ( issued ) %]
195
                    [% IF ( issued ) %]
196
                        [% FOREACH barcode IN newissues.split(',') %]
196
                        <span class="sco-alert-success issue"></span>
197
                        <span class="sco-alert-success issue"></span>
197
                        <div class="alert alert-info">
198
                        <div class="alert alert-info">
198
                            <p>Item checked out</p>
199
                            <p>Item checked out <i>([% barcode | html %])</i></p>
199
                        </div>
200
                        </div>
201
                        [% END %]
200
                    [% ELSIF ( renewed ) %]
202
                    [% ELSIF ( renewed ) %]
203
                        [% FOREACH barcode IN newissues.split(',') %]
201
                        <span class="sco-alert-success renew"></span>
204
                        <span class="sco-alert-success renew"></span>
202
                        <div class="alert alert-info">
205
                        <div class="alert alert-info">
203
                            <p>Item renewed</p>
206
                            <p>Item renewed <i>([% barcode | html %])</i></p>
204
                        </div>
207
                        </div>
208
                        [% END %]
205
                    [% ELSIF ( renewed == 0) %]
209
                    [% ELSIF ( renewed == 0) %]
206
                        <span class="sco-alert-warning renew"></span>
210
                        <span class="sco-alert-warning renew"></span>
207
                        <div class="alert alert-info">
211
                        <div class="alert alert-info">
Lines 215-221 Link Here
215
                    [% ELSIF ( returned == 1 ) %]
219
                    [% ELSIF ( returned == 1 ) %]
216
                        <span class="sco-alert-success return"></span>
220
                        <span class="sco-alert-success return"></span>
217
                        <div class="alert alert-info">
221
                        <div class="alert alert-info">
218
                            <p>Item checked in</p>
222
                            <p>Item checked in <i>([% barcode | html %])</i></p>
219
                        </div>
223
                        </div>
220
                    [% END %]
224
                    [% END %]
221
225
Lines 251-260 Link Here
251
                                        </h2></legend>
255
                                        </h2></legend>
252
                                    <div class="row">
256
                                    <div class="row">
253
                                        <div class="col">
257
                                        <div class="col">
254
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
258
                                            <label for="barcode">Scan a new item or enter its barcode <br>(or enter a barcode list, one barcode per line):</label>
255
                                        </div>
259
                                        </div>
256
                                        <div class="col-3">
260
                                        <div class="col-3">
257
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus form-control" autocomplete="off" />
261
                                            <textarea id="barcode" name="barcode" rows="10" cols="30" class="focus form-control"></textarea>
258
                                        </div>
262
                                        </div>
259
                                        <div class="col-auto">
263
                                        <div class="col-auto">
260
                                            <button type="submit" class="btn btn-primary">Submit</button>
264
                                            <button type="submit" class="btn btn-primary">Submit</button>
(-)a/opac/sco/sco-main.pl (-7 / +20 lines)
Lines 93-99 if (defined C4::Context->preference('SCOAllowCheckin')) { Link Here
93
}
93
}
94
94
95
my $issuerid = $loggedinuser;
95
my $issuerid = $loggedinuser;
96
my ($op, $patronlogin, $patronpw, $barcode, $confirmed, $newissues) = (
96
my ($op, $patronlogin, $patronpw, $barcodestr, $confirmed, $newissues) = (
97
    $query->param("op")         || '',
97
    $query->param("op")         || '',
98
    $query->param("patronlogin")|| '',
98
    $query->param("patronlogin")|| '',
99
    $query->param("patronpw")   || '',
99
    $query->param("patronpw")   || '',
Lines 109-115 if ($op eq "logout") { Link Here
109
    undef $jwt;
109
    undef $jwt;
110
}
110
}
111
111
112
$barcode = barcodedecode( $barcode ) if $barcode;
112
my $barcodes = [];
113
if ( $barcodestr ) {
114
    push @$barcodes, split( /\s\n/, $barcodestr );
115
    $barcodes = [ map { $_ =~ /^\s*$/ ? () : barcodedecode( $_ ) } @$barcodes ];
116
}
113
117
114
my @newissueslist = split /,/, $newissues;
118
my @newissueslist = split /,/, $newissues;
115
my $issuenoconfirm = 1; #don't need to confirm on issue.
119
my $issuenoconfirm = 1; #don't need to confirm on issue.
Lines 142-148 my $return_only = 0; Link Here
142
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) {
146
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) {
143
    my $success = 1;
147
    my $success = 1;
144
148
145
149
  foreach my $barcode ( @$barcodes ) {
146
    my $item = Koha::Items->find( { barcode => $barcode } );
150
    my $item = Koha::Items->find( { barcode => $barcode } );
147
    if ( $success && C4::Context->preference("CircConfirmItemParts") ) {
151
    if ( $success && C4::Context->preference("CircConfirmItemParts") ) {
148
        if ( defined($item)
152
        if ( defined($item)
Lines 162-171 if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { Link Here
162
        ($success) = AddReturn( $barcode, $branch )
166
        ($success) = AddReturn( $barcode, $branch )
163
    }
167
    }
164
168
165
    $template->param( returned => $success );
169
    $template->param(
170
        returned => $success,
171
        barcode => $barcode
172
    );
173
  } # foreach barcode in barcodes
166
}
174
}
167
elsif ( $patron && ( $op eq 'checkout' ) ) {
175
elsif ( $patron && ( $op eq 'checkout' ) ) {
168
176
  foreach my $barcode ( @$barcodes ) {
169
    my $item = Koha::Items->find( { barcode => $barcode } );
177
    my $item = Koha::Items->find( { barcode => $barcode } );
170
    my $impossible  = {};
178
    my $impossible  = {};
171
    my $needconfirm = {};
179
    my $needconfirm = {};
Lines 208-221 elsif ( $patron && ( $op eq 'checkout' ) ) { Link Here
208
                barcode    => $barcode,
216
                barcode    => $barcode,
209
            );
217
            );
210
        }
218
        }
219
        last;
211
    } elsif ( $needconfirm->{RENEW_ISSUE} ){
220
    } elsif ( $needconfirm->{RENEW_ISSUE} ){
212
        $template->param(
221
        $template->param(
213
                renew               => 1,
222
                renew               => 1,
214
                barcode             => $barcode,
223
                barcode             => $barcode,
215
                confirm             => 1,
224
                confirm             => $item->biblio->title,
216
                confirm_renew_issue => 1,
225
                confirm_renew_issue => 1,
217
                hide_main           => 1,
226
                hide_main           => 1,
218
        );
227
        );
228
        last;
219
    } elsif ( $confirm_required && !$confirmed ) {
229
    } elsif ( $confirm_required && !$confirmed ) {
220
        $template->param(
230
        $template->param(
221
            impossible                => 1,
231
            impossible                => 1,
Lines 225-230 elsif ( $patron && ( $op eq 'checkout' ) ) { Link Here
225
        if ($issue_error eq 'DEBT') {
235
        if ($issue_error eq 'DEBT') {
226
            $template->param(DEBT => $needconfirm->{DEBT});
236
            $template->param(DEBT => $needconfirm->{DEBT});
227
        }
237
        }
238
        last;
228
    } else {
239
    } else {
229
        if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
240
        if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
230
            my ( $hold_existed, $item );
241
            my ( $hold_existed, $item );
Lines 273-281 elsif ( $patron && ( $op eq 'checkout' ) ) { Link Here
273
            );
284
            );
274
        }
285
        }
275
    }
286
    }
287
  } # foreach barcode in barcodes
276
} # $op
288
} # $op
277
289
278
if ( $patron && ( $op eq 'renew' ) ) {
290
if ( $patron && ( $op eq 'renew' ) ) {
291
  foreach my $barcode ( @$barcodes ) {
279
    my $item = Koha::Items->find({ barcode => $barcode });
292
    my $item = Koha::Items->find({ barcode => $barcode });
280
293
281
    if ( $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) {
294
    if ( $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) {
Lines 294-299 if ( $patron && ( $op eq 'renew' ) ) { Link Here
294
    } else {
307
    } else {
295
        $template->param( renewed => 0 );
308
        $template->param( renewed => 0 );
296
    }
309
    }
310
  } # foreach barcode in barcodes
297
}
311
}
298
312
299
if ( $patron) {
313
if ( $patron) {
300
- 

Return to bug 32256