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

(-)a/circ/circulation.pl (+10 lines)
Lines 547-552 if ( $patron ) { Link Here
547
    );
547
    );
548
    $template->param( patron_messages => $patron_messages );
548
    $template->param( patron_messages => $patron_messages );
549
549
550
    if (C4::Context->preference("WaitingNotifyAtCheckout") ) {
551
        #Check for waiting holds
552
        my $waiting_holds = $patron->holds->search({ found => 'W', branchcode => $branch });
553
        my @waiting_holds_barcodes = ();
554
        while (my $hold = $waiting_holds->next) {
555
            push(@waiting_holds_barcodes, $hold->item->barcode);
556
        }
557
558
        $template->param( waiting_holds_barcodes => \@waiting_holds_barcodes );
559
    }
550
}
560
}
551
561
552
my $fast_cataloging = 0;
562
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 793-798 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
793
('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'),
793
('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'),
794
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
794
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
795
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
795
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
796
('WaitingNotifyAtCheckout','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking out.','YesNo'),
796
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
797
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
797
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
798
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
798
('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'),
799
('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 666-672 Link Here
666
                                            <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
666
                                            <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
667
                                        </div>
667
                                        </div>
668
668
669
                                        <button type="submit" class="btn btn-primary">Check out</button>
669
                                        [% IF waiting_holds_barcodes %]
670
                                            <button type="button" class="btn btn-primary">Check out</button>
671
                                        [% ELSE %]
672
                                            <button type="submit" class="btn btn-primary">Check out</button>
673
                                        [% END %]
670
674
671
                                        <div class="circ-settings">
675
                                        <div class="circ-settings">
672
676
Lines 865-870 Link Here
865
    </div> <!-- /.modal-dialog -->
869
    </div> <!-- /.modal-dialog -->
866
</div> <!-- /#barcodeSubmittedModal -->
870
</div> <!-- /#barcodeSubmittedModal -->
867
871
872
[% IF waiting_holds_barcodes %]
873
    <div id="circ-warnwaitingholds-modal" class="modal fade audio-alert-action block">
874
        <div class="modal-dialog">
875
            <div class="modal-content">
876
                <div class="modal-header">
877
                    <h3>This patron has waiting holds</h3>
878
                </div>
879
                <div class="modal-body">
880
                    <ul>
881
                        <li>
882
                            This patron has waiting holds that are available for checkout
883
                        </li>
884
                    </ul>
885
                </div>
886
                <div class="modal-footer">
887
                    <button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
888
                </div>
889
            </div>
890
        </div>
891
    </div>
892
[% END %]
893
868
[% MACRO jsinclude BLOCK %]
894
[% MACRO jsinclude BLOCK %]
869
    [% INCLUDE 'datatables.inc' %]
895
    [% INCLUDE 'datatables.inc' %]
870
    [% INCLUDE 'columns_settings.inc' %]
896
    [% INCLUDE 'columns_settings.inc' %]
Lines 931-936 Link Here
931
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
957
            var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
932
        }
958
        }
933
        $(document).ready(function() {
959
        $(document).ready(function() {
960
            [% IF waiting_holds_barcodes %]
961
                $('#circ-warnwaitingholds-modal .btn-primary').on('click',function() {
962
                    $('#mainform').submit();
963
                });
964
965
                var waiting_holds_barcodes = new Array();
966
                [% FOREACH b IN waiting_holds_barcodes %]
967
                    waiting_holds_barcodes.push("[% b %]");
968
                [% END %]
969
                $('#barcode').on('keyup', function() {
970
                    $('#mainform .btn-primary').off('click');
971
                    $('#barcode').off('keypress');
972
                    if ( waiting_holds_barcodes.includes($('#barcode').val().trim()) ) {
973
                        $('#mainform .btn-primary').on('click',function() {
974
                            $('#mainform').submit();
975
                        });
976
977
                        $('#barcode').on('keypress', function(e) {
978
                            if (e.which == 13) {
979
                                $('#mainform').submit();
980
                            }
981
                        });
982
                    } else {
983
                        $('#mainform .btn-primary').on('click',function() {
984
                            $('#circ-warnwaitingholds-modal').modal();
985
                        });
986
987
                        $('#barcode').on('keypress', function(e) {
988
                            if (e.which == 13) {
989
                                $('#circ-warnwaitingholds-modal').modal();
990
                            }
991
                        });
992
                    }
993
                });
994
            [% END %]
995
934
            $('#mainform').on('submit',function() {
996
            $('#mainform').on('submit',function() {
935
                if ($("#barcode") && $("#barcode").val()) {
997
                if ($("#barcode") && $("#barcode").val()) {
936
                    $('#barcode').on('keypress',function(event) {
998
                    $('#barcode').on('keypress',function(event) {
937
- 

Return to bug 34668