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

(-)a/circ/circulation.pl (+11 lines)
Lines 610-615 if ( $patron ) { Link Here
610
    );
610
    );
611
    $template->param( patron_messages => $patron_messages );
611
    $template->param( patron_messages => $patron_messages );
612
612
613
    if ( C4::Context->preference("WaitingNotifyAtCheckout") ) {
614
615
        #Check for waiting holds
616
        my $waiting_holds          = $patron->holds->search( { found => 'W', branchcode => $branch } );
617
        my @waiting_holds_barcodes = ();
618
        while ( my $hold = $waiting_holds->next ) {
619
            push( @waiting_holds_barcodes, $hold->item->barcode );
620
        }
621
622
        $template->param( waiting_holds_barcodes => \@waiting_holds_barcodes );
623
    }
613
}
624
}
614
625
615
my $fast_cataloging = 0;
626
my $fast_cataloging = 0;
(-)a/installer/data/mysql/atomicupdate/bug_34668-add_WaitingNotifyAtCheckout_syspref.pl (+16 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34668",
5
    description => "Add syspref WaitingNotifyAtCheckout",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $dbh->do(q{INSERT IGNORE INTO `systempreferences` (variable,value,options,explanation,type) VALUES('WaitingNotifyAtCheckout','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking out.','YesNo') });
12
13
        say $out "Added new system preference 'WaitingNotifyAtCheckout'";
14
15
    },
16
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 813-818 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
813
('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'),
813
('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'),
814
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
814
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
815
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
815
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
816
('WaitingNotifyAtCheckout','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking out.','YesNo'),
816
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
817
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
817
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
818
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
818
('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'),
819
('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 97-102 Circulation: Link Here
97
                  1: Notify
97
                  1: Notify
98
                  0: "Don't notify"
98
                  0: "Don't notify"
99
            - librarians of waiting holds for the patron whose items they are checking in.
99
            - librarians of waiting holds for the patron whose items they are checking in.
100
        -
101
            - pref: WaitingNotifyAtCheckout
102
              choices:
103
                  1: Notify
104
                  0: "Don't notify"
105
            - librarians of waiting holds for the patron whose items they are checking out.
100
        -
106
        -
101
            - pref: FilterBeforeOverdueReport
107
            - pref: FilterBeforeOverdueReport
102
              choices:
108
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +63 lines)
Lines 751-757 Link Here
751
                                            <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
751
                                            <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
752
                                        </div>
752
                                        </div>
753
753
754
                                        <button type="submit" class="btn btn-primary">Check out</button>
754
                                        [% IF waiting_holds_barcodes %]
755
                                            <button type="button" class="btn btn-primary">Check out</button>
756
                                        [% ELSE %]
757
                                            <button type="submit" class="btn btn-primary">Check out</button>
758
                                        [% END %]
755
759
756
                                        <div class="circ-settings">
760
                                        <div class="circ-settings">
757
761
Lines 950-955 Link Here
950
    </div> <!-- /.modal-dialog -->
954
    </div> <!-- /.modal-dialog -->
951
</div> <!-- /#barcodeSubmittedModal -->
955
</div> <!-- /#barcodeSubmittedModal -->
952
956
957
[% IF waiting_holds_barcodes %]
958
    <div id="circ-warnwaitingholds-modal" class="modal fade audio-alert-action block">
959
        <div class="modal-dialog">
960
            <div class="modal-content">
961
                <div class="modal-header">
962
                    <h3>This patron has waiting holds</h3>
963
                </div>
964
                <div class="modal-body">
965
                    <ul>
966
                        <li>
967
                            This patron has waiting holds that are available for checkout
968
                        </li>
969
                    </ul>
970
                </div>
971
                <div class="modal-footer">
972
                    <button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
973
                </div>
974
            </div>
975
        </div>
976
    </div>
977
[% END %]
978
953
[% MACRO jsinclude BLOCK %]
979
[% MACRO jsinclude BLOCK %]
954
    [% INCLUDE 'datatables.inc' %]
980
    [% INCLUDE 'datatables.inc' %]
955
    [% INCLUDE 'columns_settings.inc' %]
981
    [% INCLUDE 'columns_settings.inc' %]
Lines 1017-1022 Link Here
1017
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1043
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1018
        }
1044
        }
1019
        $(document).ready(function() {
1045
        $(document).ready(function() {
1046
            [% IF waiting_holds_barcodes %]
1047
                $('#circ-warnwaitingholds-modal .btn-primary').on('click',function() {
1048
                    $('#mainform').submit();
1049
                });
1050
1051
                var waiting_holds_barcodes = new Array();
1052
                [% FOREACH b IN waiting_holds_barcodes %]
1053
                    waiting_holds_barcodes.push("[% b | html %]");
1054
                [% END %]
1055
                $('#barcode').on('keyup', function() {
1056
                    $('#mainform .btn-primary').off('click');
1057
                    $('#barcode').off('keypress');
1058
                    if ( waiting_holds_barcodes.includes($('#barcode').val().trim()) ) {
1059
                        $('#mainform .btn-primary').on('click',function() {
1060
                            $('#mainform').submit();
1061
                        });
1062
1063
                        $('#barcode').on('keypress', function(e) {
1064
                            if (e.which == 13) {
1065
                                $('#mainform').submit();
1066
                            }
1067
                        });
1068
                    } else {
1069
                        $('#mainform .btn-primary').on('click',function() {
1070
                            $('#circ-warnwaitingholds-modal').modal();
1071
                        });
1072
1073
                        $('#barcode').on('keypress', function(e) {
1074
                            if (e.which == 13) {
1075
                                $('#circ-warnwaitingholds-modal').modal();
1076
                            }
1077
                        });
1078
                    }
1079
                });
1080
            [% END %]
1081
1020
            $('#mainform').on('submit',function() {
1082
            $('#mainform').on('submit',function() {
1021
                if ($("#barcode") && $("#barcode").val()) {
1083
                if ($("#barcode") && $("#barcode").val()) {
1022
                    $('#barcode').on('keypress',function(event) {
1084
                    $('#barcode').on('keypress',function(event) {
1023
- 

Return to bug 34668