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 176-186 Circulation: Link Here
176
                  0: "Don't use"
176
                  0: "Don't use"
177
            - circulation desks.
177
            - circulation desks.
178
    Checkout policy:
178
    Checkout policy:
179
        -
180
            - pref: AlwaysLoadCheckoutsTable
181
              choices:
182
                  1: "Do"
183
                  0: "Don't"
184
            - always load the checksouts table.
179
        -
185
        -
180
            - Delay the automatic loading of the checkouts table on the checkouts page by
186
            - Delay the automatic loading of the checkouts table on the checkouts page by
181
            - pref: LoadCheckoutsTableDelay
187
            - pref: LoadCheckoutsTableDelay
182
              class: integer
188
              class: integer
183
            - seconds when "Always show checkouts automatically" is enabled.
189
            - seconds when "Always show checkouts automatically" or <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AlwaysLoadCheckoutsTable">AlwaysLoadCheckoutsTable</a> are enabled.
184
        -
190
        -
185
            - pref: OnSiteCheckoutAutoCheck
191
            - pref: OnSiteCheckoutAutoCheck
186
              choices:
192
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 998-1003 Link Here
998
    <script>
998
    <script>
999
        /* Set some variable needed in circulation.js */
999
        /* Set some variable needed in circulation.js */
1000
        const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
1000
        const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
1001
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
1001
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1002
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1002
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1003
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1003
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1004
        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 775-780 Link Here
775
    [% Asset.js("js/recalls.js") | $raw %]
774
    [% Asset.js("js/recalls.js") | $raw %]
776
    <script>
775
    <script>
777
        const LoadCheckoutsTableDelay = 0;
776
        const LoadCheckoutsTableDelay = 0;
777
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
778
778
779
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
779
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
780
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
780
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
Lines 834-839 Link Here
834
            });
834
            });
835
        });
835
        });
836
    </script>
836
    </script>
837
    [% Asset.js("js/checkouts.js") | $raw %]
837
    [% Asset.js("js/tables/bookings.js") | $raw %]
838
    [% Asset.js("js/tables/bookings.js") | $raw %]
838
[% END %]
839
[% END %]
839
840
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-28 / +35 lines)
Lines 471-482 function LoadIssuesTable() { Link Here
471
var loadIssuesTableDelayTimeoutId;
471
var loadIssuesTableDelayTimeoutId;
472
var barcodefield = $("#barcode");
472
var barcodefield = $("#barcode");
473
473
474
$('#issues-table-load-now-button').click(function(){
474
if ( AlwaysLoadCheckoutsTable ) {
475
    if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId);
475
    if ( LoadCheckoutsTableDelay ) {
476
    LoadIssuesTable();
476
        setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
477
    barcodefield.focus();
477
    } else {
478
    return false;
478
        LoadIssuesTable();
479
});
479
    }
480
481
} else {
482
    $('#issues-table-load-immediately').change(function(){
483
        if ( this.checked && typeof issuesTable === 'undefined') {
484
            $('#issues-table-load-now-button').click();
485
        }
486
        barcodefield.focus();
487
    });
488
    $('#issues-table-load-now-button').click(function(){
489
        if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId);
490
        LoadIssuesTable();
491
        barcodefield.focus();
492
        return false;
493
    });
494
495
    if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) {
496
        if ( LoadCheckoutsTableDelay ) {
497
            setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
498
        } else {
499
            LoadIssuesTable();
500
        }
501
        $('#issues-table-load-immediately').prop('checked', true);
502
    } else {
503
        $('#issues-table-load-delay').hide();
504
    }
505
    $('#issues-table-load-immediately').on( "change", function(){
506
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
507
    });
508
}
480
509
481
$(document).ready(function() {
510
$(document).ready(function() {
482
511
Lines 771-797 $(document).ready(function() { Link Here
771
800
772
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
801
    var ymd = flatpickr.formatDate(new Date(), "Y-m-d");
773
802
774
    $('#issues-table-load-immediately').change(function(){
775
        if ( this.checked && typeof issuesTable === 'undefined') {
776
            $('#issues-table-load-now-button').click();
777
        }
778
        barcodefield.focus();
779
    });
780
781
    if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) {
782
        if ( LoadCheckoutsTableDelay ) {
783
            loadIssuesTableDelayTimeoutId = setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000);
784
        } else {
785
            LoadIssuesTable();
786
        }
787
        $('#issues-table-load-immediately').prop('checked', true);
788
    } else {
789
        $('#issues-table-load-delay').hide();
790
    }
791
    $('#issues-table-load-immediately').on( "change", function(){
792
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
793
    });
794
795
    // Don't load relatives' issues table unless it is clicked on
803
    // Don't load relatives' issues table unless it is clicked on
796
    var relativesIssuesTable;
804
    var relativesIssuesTable;
797
    $("#relatives-issues-tab").click( function() {
805
    $("#relatives-issues-tab").click( function() {
798
- 

Return to bug 14180