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

(-)a/C4/Circulation.pm (+6 lines)
Lines 63-68 use Koha::Exceptions::Checkout; Link Here
63
use Koha::Plugins;
63
use Koha::Plugins;
64
use Koha::Recalls;
64
use Koha::Recalls;
65
use Koha::Library::Hours;
65
use Koha::Library::Hours;
66
use Koha::Bookings;
66
use Carp qw( carp );
67
use Carp qw( carp );
67
use List::MoreUtils qw( any );
68
use List::MoreUtils qw( any );
68
use Scalar::Util qw( looks_like_number blessed );
69
use Scalar::Util qw( looks_like_number blessed );
Lines 1551-1556 sub AddIssue { Link Here
1551
    my $auto_renew = $params && $params->{auto_renew};
1552
    my $auto_renew = $params && $params->{auto_renew};
1552
    my $cancel_recall = $params && $params->{cancel_recall};
1553
    my $cancel_recall = $params && $params->{cancel_recall};
1553
    my $recall_id = $params && $params->{recall_id};
1554
    my $recall_id = $params && $params->{recall_id};
1555
    my $booking_id = $params && $params->{booking_id};
1554
    my $dbh          = C4::Context->dbh;
1556
    my $dbh          = C4::Context->dbh;
1555
    my $barcodecheck = CheckValidBarcode($barcode);
1557
    my $barcodecheck = CheckValidBarcode($barcode);
1556
1558
Lines 1732-1737 sub AddIssue { Link Here
1732
                    q{DELETE tmp_holdsqueue, hold_fill_targets FROM tmp_holdsqueue LEFT JOIN hold_fill_targets USING ( itemnumber ) WHERE itemnumber = ?},
1734
                    q{DELETE tmp_holdsqueue, hold_fill_targets FROM tmp_holdsqueue LEFT JOIN hold_fill_targets USING ( itemnumber ) WHERE itemnumber = ?},
1733
                    undef, $item_object->id
1735
                    undef, $item_object->id
1734
                );
1736
                );
1737
1738
                if ($booking_id) {
1739
                    Koha::Bookings->find( { booking_id => $booking_id } )->delete();
1740
                }
1735
            }
1741
            }
1736
            $issue->discard_changes;
1742
            $issue->discard_changes;
1737
            $patron->update_lastseen('check_out');
1743
            $patron->update_lastseen('check_out');
(-)a/bookings/list.pl (-2 / +8 lines)
Lines 21-28 use Modern::Perl; Link Here
21
21
22
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
23
23
24
use Koha::Biblios;
25
use Koha::Bookings;
26
use Koha::Patrons;
27
use Koha::Items;
28
use Koha::CirculationRules;
29
24
use C4::Output qw( output_html_with_http_headers );
30
use C4::Output qw( output_html_with_http_headers );
25
use C4::Auth qw( get_template_and_user );
31
use C4::Auth   qw( get_template_and_user );
26
32
27
my $input = CGI->new;
33
my $input = CGI->new;
28
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
34
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
Lines 35-41 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( Link Here
35
);
41
);
36
42
37
my $biblionumber = $input->param('biblionumber');
43
my $biblionumber = $input->param('biblionumber');
38
my $biblio       = Koha::Biblios->find($biblionumber);
44
my $biblio       = Koha::Biblios->find( { biblionumber => $biblionumber } );
39
45
40
$template->param(
46
$template->param(
41
    biblionumber => $biblionumber,
47
    biblionumber => $biblionumber,
(-)a/circ/circulation.pl (-1 / +4 lines)
Lines 57-62 use Koha::SearchEngine; Link Here
57
use Koha::SearchEngine::Search;
57
use Koha::SearchEngine::Search;
58
use Koha::Patron::Modifications;
58
use Koha::Patron::Modifications;
59
use Koha::Token;
59
use Koha::Token;
60
use Koha::Bookings;
60
61
61
use List::MoreUtils qw( uniq );
62
use List::MoreUtils qw( uniq );
62
63
Lines 68-73 my $query = CGI->new; Link Here
68
my $borrowernumber = $query->param('borrowernumber');
69
my $borrowernumber = $query->param('borrowernumber');
69
my $barcodes       = [];
70
my $barcodes       = [];
70
my $barcode        = $query->param('barcode');
71
my $barcode        = $query->param('barcode');
72
my $booking_id = $query->param('booking_id');
71
73
72
# Barcode given by user could be '0'
74
# Barcode given by user could be '0'
73
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
75
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
Lines 543-549 if ( @$barcodes && $op eq 'cud-checkout' ) { Link Here
543
                    {
545
                    {
544
                        onsite_checkout        => $onsite_checkout,        auto_renew => $session->param('auto_renew'),
546
                        onsite_checkout        => $onsite_checkout,        auto_renew => $session->param('auto_renew'),
545
                        switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall,
547
                        switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall,
546
                        recall_id              => $recall_id,
548
                        recall_id              => $recall_id,              booking_id    => $booking_id
547
                    }
549
                    }
548
                );
550
                );
549
                $template_params->{issue} = $issue;
551
                $template_params->{issue} = $issue;
Lines 787-792 $template->param( Link Here
787
    nopermission            => scalar $query->param('nopermission'),
789
    nopermission            => scalar $query->param('nopermission'),
788
    autoswitched            => $autoswitched,
790
    autoswitched            => $autoswitched,
789
    logged_in_user          => $logged_in_user,
791
    logged_in_user          => $logged_in_user,
792
    booking_id              => $booking_id || '',
790
);
793
);
791
794
792
output_html_with_http_headers $query, $cookie, $template->output;
795
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt (+1 lines)
Lines 389-394 Link Here
389
                    if (!is_cancelled) {
389
                    if (!is_cancelled) {
390
                        result += '<button type="button" class="btn btn-default btn-xs edit-action" data-bs-toggle="modal" data-bs-target="#placeBookingModal" data-booking="%s" data-biblionumber="%s" data-itemnumber="%s" data-patron="%s" data-pickup_library="%s" data-start_date="%s" data-end_date="%s"><i class="fa fa-pencil" aria-hidden="true"></i> %s</button>'.format(row.booking_id, biblionumber, row.item_id,  row.patron_id, row.pickup_library_id, row.start_date, row.end_date, _("Edit"));
390
                        result += '<button type="button" class="btn btn-default btn-xs edit-action" data-bs-toggle="modal" data-bs-target="#placeBookingModal" data-booking="%s" data-biblionumber="%s" data-itemnumber="%s" data-patron="%s" data-pickup_library="%s" data-start_date="%s" data-end_date="%s"><i class="fa fa-pencil" aria-hidden="true"></i> %s</button>'.format(row.booking_id, biblionumber, row.item_id,  row.patron_id, row.pickup_library_id, row.start_date, row.end_date, _("Edit"));
391
                        result += '<button type="button" class="btn btn-default btn-xs cancel-action" data-bs-toggle="modal" data-bs-target="#cancelBookingModal" data-booking="%s"><i class="fa fa-trash" aria-hidden="true"></i> %s</button>'.format(row.booking_id, _("Cancel"));
391
                        result += '<button type="button" class="btn btn-default btn-xs cancel-action" data-bs-toggle="modal" data-bs-target="#cancelBookingModal" data-booking="%s"><i class="fa fa-trash" aria-hidden="true"></i> %s</button>'.format(row.booking_id, _("Cancel"));
392
                        result += `<form name="checkout-transform" method="post" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=${row.patron_id}"><input type="hidden" name="op" value="cud-checkout"/><input type="hidden" name="borrowernumber" value="${row.patron_id}"/><input type="hidden" name="barcode" value="${row.item.external_id}"/><input type="hidden" name="duedatespec" value="${row.end_date}"/><input type="hidden" name="booking_id" value="${row.booking_id}"/><button id="checkout_action" class="btn btn-default btn-xs" type="submit">${_("Transform to checkout")}</button></form>`;
392
                    }
393
                    }
393
                    [% END %]
394
                    [% END %]
394
                    return result;
395
                    return result;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-3 / +10 lines)
Lines 9-14 Link Here
9
[% USE ItemTypes %]
9
[% USE ItemTypes %]
10
[% USE Price %]
10
[% USE Price %]
11
[% USE AuthorisedValues %]
11
[% USE AuthorisedValues %]
12
[% USE JSON.Escape %]
12
[% PROCESS 'i18n.inc' %]
13
[% PROCESS 'i18n.inc' %]
13
[% SET footerjs = 1 %]
14
[% SET footerjs = 1 %]
14
[% INCLUDE 'doc-head-open.inc' %]
15
[% INCLUDE 'doc-head-open.inc' %]
Lines 284-289 Link Here
284
                                    [% FOREACH conf IN sessionConfirmationKeys %]
285
                                    [% FOREACH conf IN sessionConfirmationKeys %]
285
                                        <input type="hidden" name="session_confirmations" id="session_confirmations" value="[% conf | html %]" />
286
                                        <input type="hidden" name="session_confirmations" id="session_confirmations" value="[% conf | html %]" />
286
                                    [% END %]
287
                                    [% END %]
288
                                    <input type="hidden" name="booking_id" value="[% booking_id | html %]"/>
287
289
288
                                    [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
290
                                    [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
289
291
Lines 399-404 Link Here
399
                                    [% FOREACH conf IN sessionConfirmationKeys %]
401
                                    [% FOREACH conf IN sessionConfirmationKeys %]
400
                                        <input type="hidden" name="session_confirmations" id="session_confirmations" value="[% conf | html %]" />
402
                                        <input type="hidden" name="session_confirmations" id="session_confirmations" value="[% conf | html %]" />
401
                                    [% END %]
403
                                    [% END %]
404
                                    <input type="hidden" name="booking_id" value="[% booking_id | html %]"/>
402
405
403
                                    [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
406
                                    [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
404
407
Lines 436-442 Link Here
436
                                    <input type="hidden" name="hold_borrower" value="[% resborrowernumber | html %]" />
439
                                    <input type="hidden" name="hold_borrower" value="[% resborrowernumber | html %]" />
437
                                    <input type="hidden" name="hold_itemnumber" value="[% item.itemnumber | html %]" />
440
                                    <input type="hidden" name="hold_itemnumber" value="[% item.itemnumber | html %]" />
438
                                    <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
441
                                    <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
439
                                    <button class="btn btn-default print" type="submit" onclick="Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]&itemnumber=[% item.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out, confirm hold, and print slip (P)</button>
442
                                    <input type="hidden" name="booking_id" value="[% booking_id | html %]"/>
443
                                    <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]&itemnumber=[% item.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out, confirm hold, and print slip (P)</button>
440
                                </form>
444
                                </form>
441
                            [% END %]
445
                            [% END %]
442
446
Lines 452-457 Link Here
452
                                <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
456
                                <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
453
                                <input type="hidden" name="restoreduedatespec" />
457
                                <input type="hidden" name="restoreduedatespec" />
454
                                <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
458
                                <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
459
                                <input type="hidden" name="booking_id" value="[% booking_id | html %]"/>
455
                                [% IF CAN_user_circulate_force_checkout or HIGHHOLDS or ADDITIONAL_MATERIALS %]
460
                                [% IF CAN_user_circulate_force_checkout or HIGHHOLDS or ADDITIONAL_MATERIALS %]
456
                                    [% IF ( RENEW_ISSUE ) %]
461
                                    [% IF ( RENEW_ISSUE ) %]
457
                                        <button type="submit" class="btn btn-default deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
462
                                        <button type="submit" class="btn btn-default deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
Lines 1066-1072 Link Here
1066
                if ( $("#onsite_checkout").prop('checked') ) {
1071
                if ( $("#onsite_checkout").prop('checked') ) {
1067
                    duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]");
1072
                    duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]");
1068
                } else {
1073
                } else {
1069
                    duedatespec_fp.setDate("");
1074
                    var booking_id = [% booking_id.json %];
1075
                    if (!booking_id) {
1076
                        duedatespec_fp.setDate("");
1077
                    }
1070
                }
1078
                }
1071
            }
1079
            }
1072
        }
1080
        }
1073
- 

Return to bug 36789