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 45-53 Link Here
45
            </thead>
45
            </thead>
46
            [% INCLUDE 'checkouts-table-footer.inc' %]
46
            [% INCLUDE 'checkouts-table-footer.inc' %]
47
        </table>
47
        </table>
48
48
        [% UNLESS Koha.Preference( 'AlwaysLoadCheckoutsTable' ) %]
49
        <label for="issues-table-load-immediately">Always show checkouts automatically</label>
49
            <label for="issues-table-load-immediately">Always show checkouts automatically</label>
50
        <input id="issues-table-load-immediately" type="checkbox" />
50
            <input id="issues-table-load-immediately" type="checkbox" />
51
        [% END %]
51
52
52
        <div id="issues-table-actions" style="display: none;">
53
        <div id="issues-table-actions" style="display: none;">
53
            <fieldset class="action">
54
            <fieldset class="action">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 165-175 Circulation: Link Here
165
            - circulation desks with circulation.
165
            - circulation desks with circulation.
166
166
167
    Checkout policy:
167
    Checkout policy:
168
        -
169
            - pref: AlwaysLoadCheckoutsTable
170
              choices:
171
                  1: "Do"
172
                  0: "Don't"
173
            - always load the checksouts table.
168
        -
174
        -
169
            - Delay the automatic loading of the checkouts table on the checkouts page by
175
            - Delay the automatic loading of the checkouts table on the checkouts page by
170
            - pref: LoadCheckoutsTableDelay
176
            - pref: LoadCheckoutsTableDelay
171
              class: integer
177
              class: integer
172
            - seconds when "Always show checkouts automatically" is enabled.
178
            - seconds when "Always show checkouts automatically" or <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AlwaysLoadCheckoutsTable">AlwaysLoadCheckoutsTable</a> are enabled.
173
        -
179
        -
174
            - pref: OnSiteCheckoutAutoCheck
180
            - pref: OnSiteCheckoutAutoCheck
175
              choices:
181
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 962-967 Link Here
962
    <script>
962
    <script>
963
        /* Set some variable needed in circulation.js */
963
        /* Set some variable needed in circulation.js */
964
        const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
964
        const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
965
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
965
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
966
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
966
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
967
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
967
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
968
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 724-729 Link Here
724
    [% Asset.js("js/recalls.js") | $raw %]
724
    [% Asset.js("js/recalls.js") | $raw %]
725
    <script>
725
    <script>
726
        const LoadCheckoutsTableDelay = 0;
726
        const LoadCheckoutsTableDelay = 0;
727
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
727
728
728
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
729
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
729
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
730
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-23 / +28 lines)
Lines 264-297 $(document).ready(function() { Link Here
264
    });
264
    });
265
265
266
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
266
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
267
267
    if ( AlwaysLoadCheckoutsTable ) {
268
    $('#issues-table-load-immediately').change(function(){
269
        if ( this.checked && typeof issuesTable === 'undefined') {
270
            $('#issues-table-load-now-button').click();
271
        }
272
        barcodefield.focus();
273
    });
274
    $('#issues-table-load-now-button').click(function(){
275
        if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId);
276
        LoadIssuesTable();
277
        barcodefield.focus();
278
        return false;
279
    });
280
281
    if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) {
282
        if ( LoadCheckoutsTableDelay ) {
268
        if ( LoadCheckoutsTableDelay ) {
283
            loadIssuesTableDelayTimeoutId = setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
269
            setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
284
        } else {
270
        } else {
285
            LoadIssuesTable();
271
            LoadIssuesTable();
286
        }
272
        }
287
        $('#issues-table-load-immediately').prop('checked', true);
288
    } else {
273
    } else {
289
        $('#issues-table-load-delay').hide();
274
        $('#issues-table-load-immediately').change(function(){
290
    }
275
            if ( this.checked && typeof issuesTable === 'undefined') {
291
    $('#issues-table-load-immediately').on( "change", function(){
276
                $('#issues-table-load-now-button').click();
292
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
277
            }
293
    });
278
            barcodefield.focus();
279
        });
280
        $('#issues-table-load-now-button').click(function(){
281
            if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId);
282
            LoadIssuesTable();
283
            barcodefield.focus();
284
            return false;
285
        });
294
286
287
        if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) {
288
            if ( LoadCheckoutsTableDelay ) {
289
                loadIssuesTableDelayTimeoutId = setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
290
            } else {
291
                LoadIssuesTable();
292
            }
293
            $('#issues-table-load-immediately').prop('checked', true);
294
        } else {
295
            $('#issues-table-load-delay').hide();
296
        }
297
        $('#issues-table-load-immediately').on( "change", function(){
298
            Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
299
        });
300
    }
295
    function RefreshIssuesTable() {
301
    function RefreshIssuesTable() {
296
        var table = $('#issues-table').DataTable();
302
        var table = $('#issues-table').DataTable();
297
        var renewchecked = $('input[name=renew]:checked').map(function(){
303
        var renewchecked = $('input[name=renew]:checked').map(function(){
298
- 

Return to bug 14180