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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (-4 / +5 lines)
Lines 7-13 Link Here
7
        <p>
7
        <p>
8
            <a id="issues-table-load-now-button" href="#" class="btn btn-default"><i class="fa fa-book"></i> Show checkouts</a>
8
            <a id="issues-table-load-now-button" href="#" class="btn btn-default"><i class="fa fa-book"></i> Show checkouts</a>
9
            [% SET LoadCheckoutsTableDelay = Koha.Preference('LoadCheckoutsTableDelay') %]
9
            [% SET LoadCheckoutsTableDelay = Koha.Preference('LoadCheckoutsTableDelay') %]
10
            [% IF LoadCheckoutsTableDelay && page == 'circulation' %]
10
            [% IF LoadCheckoutsTableDelay && patronpage == 'circ' %]
11
            <span id="issues-table-load-delay">
11
            <span id="issues-table-load-delay">
12
                <i id="issues-table-load-delay-spinner" class="fa fa-spinner fa-pulse fa-fw"></i>
12
                <i id="issues-table-load-delay-spinner" class="fa fa-spinner fa-pulse fa-fw"></i>
13
                <span id="issues-table-load-delay-message">Checkouts table will show automatically in [% LoadCheckoutsTableDelay | html %] seconds...</span>
13
                <span id="issues-table-load-delay-message">Checkouts table will show automatically in [% LoadCheckoutsTableDelay | html %] seconds...</span>
Lines 46-54 Link Here
46
            </thead>
46
            </thead>
47
            [% INCLUDE 'checkouts-table-footer.inc' %]
47
            [% INCLUDE 'checkouts-table-footer.inc' %]
48
        </table>
48
        </table>
49
49
        [% UNLESS Koha.Preference( 'AlwaysLoadCheckoutsTable' ) %]
50
        <label for="issues-table-load-immediately">Always show checkouts automatically</label>
50
            <label for="issues-table-load-immediately">Always show checkouts automatically</label>
51
        <input id="issues-table-load-immediately" type="checkbox" />
51
            <input id="issues-table-load-immediately" type="checkbox" />
52
        [% END %]
52
53
53
        <div id="issues-table-actions" style="display: none;">
54
        <div id="issues-table-actions" style="display: none;">
54
            <fieldset class="action">
55
            <fieldset class="action">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 171-181 Circulation: Link Here
171
                  0: "Don't use"
171
                  0: "Don't use"
172
            - circulation desks.
172
            - circulation desks.
173
    Checkout policy:
173
    Checkout policy:
174
        -
175
            - pref: AlwaysLoadCheckoutsTable
176
              choices:
177
                  1: "Do"
178
                  0: "Don't"
179
            - always load the checksouts table.
174
        -
180
        -
175
            - Delay the automatic loading of the checkouts table on the checkouts page by
181
            - Delay the automatic loading of the checkouts table on the checkouts page by
176
            - pref: LoadCheckoutsTableDelay
182
            - pref: LoadCheckoutsTableDelay
177
              class: integer
183
              class: integer
178
            - seconds when "Always show checkouts automatically" is enabled.
184
            - seconds when "Always show checkouts automatically" or <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AlwaysLoadCheckoutsTable">AlwaysLoadCheckoutsTable</a> are enabled.
179
        -
185
        -
180
            - pref: OnSiteCheckoutAutoCheck
186
            - pref: OnSiteCheckoutAutoCheck
181
              choices:
187
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1000-1005 Link Here
1000
    <script>
1000
    <script>
1001
        /* Set some variable needed in circulation.js */
1001
        /* Set some variable needed in circulation.js */
1002
        const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
1002
        const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
1003
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
1003
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1004
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1004
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1005
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1005
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1006
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +2 lines)
Lines 761-767 Link Here
761
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
761
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
762
    </script>
762
    </script>
763
    [% Asset.js("js/pages/circulation.js") | $raw %]
763
    [% Asset.js("js/pages/circulation.js") | $raw %]
764
    [% Asset.js("js/checkouts.js") | $raw %]
765
    [% IF Koha.Preference('ClaimReturnedLostValue') %]
764
    [% IF Koha.Preference('ClaimReturnedLostValue') %]
766
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
765
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
767
    [% END %]
766
    [% END %]
Lines 774-779 Link Here
774
    [% Asset.js("js/recalls.js") | $raw %]
773
    [% Asset.js("js/recalls.js") | $raw %]
775
    <script>
774
    <script>
776
        const LoadCheckoutsTableDelay = 0;
775
        const LoadCheckoutsTableDelay = 0;
776
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
777
777
778
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
778
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
779
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
779
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
Lines 830-835 Link Here
830
            });
830
            });
831
        });
831
        });
832
    </script>
832
    </script>
833
    [% Asset.js("js/checkouts.js") | $raw %]
833
    [% Asset.js("js/tables/bookings.js") | $raw %]
834
    [% Asset.js("js/tables/bookings.js") | $raw %]
834
[% END %]
835
[% END %]
835
836
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-28 / +35 lines)
Lines 469-480 function LoadIssuesTable() { Link Here
469
var loadIssuesTableDelayTimeoutId;
469
var loadIssuesTableDelayTimeoutId;
470
var barcodefield = $("#barcode");
470
var barcodefield = $("#barcode");
471
471
472
$('#issues-table-load-now-button').click(function(){
472
if ( AlwaysLoadCheckoutsTable ) {
473
    if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId);
473
    if ( LoadCheckoutsTableDelay ) {
474
    LoadIssuesTable();
474
        setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
475
    barcodefield.focus();
475
    } else {
476
    return false;
476
        LoadIssuesTable();
477
});
477
    }
478
479
} else {
480
    $('#issues-table-load-immediately').change(function(){
481
        if ( this.checked && typeof issuesTable === 'undefined') {
482
            $('#issues-table-load-now-button').click();
483
        }
484
        barcodefield.focus();
485
    });
486
    $('#issues-table-load-now-button').click(function(){
487
        if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId);
488
        LoadIssuesTable();
489
        barcodefield.focus();
490
        return false;
491
    });
492
493
    if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) {
494
        if ( LoadCheckoutsTableDelay ) {
495
            setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
496
        } else {
497
            LoadIssuesTable();
498
        }
499
        $('#issues-table-load-immediately').prop('checked', true);
500
    } else {
501
        $('#issues-table-load-delay').hide();
502
    }
503
    $('#issues-table-load-immediately').on( "change", function(){
504
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
505
    });
506
}
478
507
479
$(document).ready(function() {
508
$(document).ready(function() {
480
509
Lines 766-792 $(document).ready(function() { Link Here
766
795
767
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
796
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
768
797
769
    $('#issues-table-load-immediately').change(function(){
770
        if ( this.checked && typeof issuesTable === 'undefined') {
771
            $('#issues-table-load-now-button').click();
772
        }
773
        barcodefield.focus();
774
    });
775
776
    if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) {
777
        if ( LoadCheckoutsTableDelay ) {
778
            loadIssuesTableDelayTimeoutId = setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
779
        } else {
780
            LoadIssuesTable();
781
        }
782
        $('#issues-table-load-immediately').prop('checked', true);
783
    } else {
784
        $('#issues-table-load-delay').hide();
785
    }
786
    $('#issues-table-load-immediately').on( "change", function(){
787
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
788
    });
789
790
    // Don't load relatives' issues table unless it is clicked on
798
    // Don't load relatives' issues table unless it is clicked on
791
    var relativesIssuesTable;
799
    var relativesIssuesTable;
792
    $("#relatives-issues-tab").click( function() {
800
    $("#relatives-issues-tab").click( function() {
793
- 

Return to bug 14180