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

(-)a/circ/circulation.pl (+11 lines)
Lines 596-601 if ( $patron ) { Link Here
596
    );
596
    );
597
    $template->param( patron_messages => $patron_messages );
597
    $template->param( patron_messages => $patron_messages );
598
598
599
    if ( C4::Context->preference("WaitingNotifyAtCheckout") ) {
600
601
        #Check for waiting holds
602
        my $waiting_holds          = $patron->holds->search( { found => 'W', branchcode => $branch } );
603
        my @waiting_holds_barcodes = ();
604
        while ( my $hold = $waiting_holds->next ) {
605
            push( @waiting_holds_barcodes, $hold->item->barcode );
606
        }
607
608
        $template->param( waiting_holds_barcodes => \@waiting_holds_barcodes );
609
    }
599
}
610
}
600
611
601
my $fast_cataloging = 0;
612
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 809-814 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
809
('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'),
809
('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'),
810
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
810
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
811
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
811
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
812
('WaitingNotifyAtCheckout','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking out.','YesNo'),
812
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
813
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
813
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
814
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
814
('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'),
815
('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 706-712 Link Here
706
                                            <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
706
                                            <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
707
                                        </div>
707
                                        </div>
708
708
709
                                        <button type="submit" class="btn btn-primary">Check out</button>
709
                                        [% IF waiting_holds_barcodes %]
710
                                            <button type="button" class="btn btn-primary">Check out</button>
711
                                        [% ELSE %]
712
                                            <button type="submit" class="btn btn-primary">Check out</button>
713
                                        [% END %]
710
714
711
                                        <div class="circ-settings">
715
                                        <div class="circ-settings">
712
716
Lines 905-910 Link Here
905
    </div> <!-- /.modal-dialog -->
909
    </div> <!-- /.modal-dialog -->
906
</div> <!-- /#barcodeSubmittedModal -->
910
</div> <!-- /#barcodeSubmittedModal -->
907
911
912
[% IF waiting_holds_barcodes %]
913
    <div id="circ-warnwaitingholds-modal" class="modal fade audio-alert-action block">
914
        <div class="modal-dialog">
915
            <div class="modal-content">
916
                <div class="modal-header">
917
                    <h3>This patron has waiting holds</h3>
918
                </div>
919
                <div class="modal-body">
920
                    <ul>
921
                        <li>
922
                            This patron has waiting holds that are available for checkout
923
                        </li>
924
                    </ul>
925
                </div>
926
                <div class="modal-footer">
927
                    <button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
928
                </div>
929
            </div>
930
        </div>
931
    </div>
932
[% END %]
933
908
[% MACRO jsinclude BLOCK %]
934
[% MACRO jsinclude BLOCK %]
909
    [% INCLUDE 'datatables.inc' %]
935
    [% INCLUDE 'datatables.inc' %]
910
    [% INCLUDE 'columns_settings.inc' %]
936
    [% INCLUDE 'columns_settings.inc' %]
Lines 972-977 Link Here
972
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
998
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
973
        }
999
        }
974
        $(document).ready(function() {
1000
        $(document).ready(function() {
1001
            [% IF waiting_holds_barcodes %]
1002
                $('#circ-warnwaitingholds-modal .btn-primary').on('click',function() {
1003
                    $('#mainform').submit();
1004
                });
1005
1006
                var waiting_holds_barcodes = new Array();
1007
                [% FOREACH b IN waiting_holds_barcodes %]
1008
                    waiting_holds_barcodes.push("[% b | html %]");
1009
                [% END %]
1010
                $('#barcode').on('keyup', function() {
1011
                    $('#mainform .btn-primary').off('click');
1012
                    $('#barcode').off('keypress');
1013
                    if ( waiting_holds_barcodes.includes($('#barcode').val().trim()) ) {
1014
                        $('#mainform .btn-primary').on('click',function() {
1015
                            $('#mainform').submit();
1016
                        });
1017
1018
                        $('#barcode').on('keypress', function(e) {
1019
                            if (e.which == 13) {
1020
                                $('#mainform').submit();
1021
                            }
1022
                        });
1023
                    } else {
1024
                        $('#mainform .btn-primary').on('click',function() {
1025
                            $('#circ-warnwaitingholds-modal').modal();
1026
                        });
1027
1028
                        $('#barcode').on('keypress', function(e) {
1029
                            if (e.which == 13) {
1030
                                $('#circ-warnwaitingholds-modal').modal();
1031
                            }
1032
                        });
1033
                    }
1034
                });
1035
            [% END %]
1036
975
            $('#mainform').on('submit',function() {
1037
            $('#mainform').on('submit',function() {
976
                if ($("#barcode") && $("#barcode").val()) {
1038
                if ($("#barcode") && $("#barcode").val()) {
977
                    $('#barcode').on('keypress',function(event) {
1039
                    $('#barcode').on('keypress',function(event) {
978
- 

Return to bug 34668