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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-27 / +11 lines)
Lines 666-676 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
                                        [% IF waiting_holds_barcodes %]
669
                                        <button type="submit" class="btn btn-primary">Check out</button>
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 %]
674
670
675
                                        <div class="circ-settings">
671
                                        <div class="circ-settings">
676
672
Lines 966-996 Link Here
966
                [% FOREACH b IN waiting_holds_barcodes %]
962
                [% FOREACH b IN waiting_holds_barcodes %]
967
                    waiting_holds_barcodes.push("[% b | html %]");
963
                    waiting_holds_barcodes.push("[% b | html %]");
968
                [% END %]
964
                [% END %]
969
                $('#barcode').on('keyup', function() {
965
                $("#mainform").on('submit', function(){
970
                    $('#mainform .btn-primary').off('click');
966
                    if( $("#checkout_confirmed").length > 0 ){
971
                    $('#barcode').off('keypress');
967
                        return true;
968
                    }
972
                    if ( waiting_holds_barcodes.includes($('#barcode').val().trim()) ) {
969
                    if ( waiting_holds_barcodes.includes($('#barcode').val().trim()) ) {
973
                        $('#mainform .btn-primary').on('click',function() {
970
                        return true;
974
                            $('#mainform').submit();
975
                        });
976
977
                        $('#barcode').on('keypress', function(e) {
978
                            if (e.which == 13) {
979
                                $('#mainform').submit();
980
                            }
981
                        });
982
                    } else {
971
                    } else {
983
                        $('#mainform .btn-primary').on('click',function() {
972
                        $('#circ-warnwaitingholds-modal').modal();
984
                            $('#circ-warnwaitingholds-modal').modal();
973
                        return false;
985
                        });
986
987
                        $('#barcode').on('keypress', function(e) {
988
                            if (e.which == 13) {
989
                                $('#circ-warnwaitingholds-modal').modal();
990
                            }
991
                        });
992
                    }
974
                    }
993
                });
975
                });
976
                $("#circ-warnwaitingholds-modal").on('hidden.bs.modal',function(){
977
                    $("#mainform").append('<input type="hidden" id="checkout_confirmed" value=1>').submit();
978
                });
994
            [% END %]
979
            [% END %]
995
980
996
            $('#mainform').on('submit',function() {
981
            $('#mainform').on('submit',function() {
997
- 

Return to bug 34668