Bugzilla – Attachment 161555 Details for
Bug 14180
Make "Always show checkouts immediately" a global setting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14180: Add option to always load the issues table
Bug-14180-Add-option-to-always-load-the-issues-tab.patch (text/plain), 8.01 KB, created by
ByWater Sandboxes
on 2024-01-26 18:23:27 UTC
(
hide
)
Description:
Bug 14180: Add option to always load the issues table
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2024-01-26 18:23:27 UTC
Size:
8.01 KB
patch
obsolete
>From de85dc45d493f3902310063b63d955a876ec0fa3 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 26 Jan 2024 17:35:38 +0000 >Subject: [PATCH] Bug 14180: Add option to always load the issues table > >Signed-off-by: Kelly <kelly@bywatersolutions.com> >--- > .../prog/en/includes/checkouts-table.inc | 9 ++-- > .../admin/preferences/circulation.pref | 8 ++- > .../prog/en/modules/circ/circulation.tt | 1 + > .../prog/en/modules/members/moremember.tt | 1 + > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 50 +++++++++++-------- > 5 files changed, 42 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index 9efd8065d9..e3b5066040 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -7,7 +7,7 @@ > <p> > <a id="issues-table-load-now-button" href="#" class="btn btn-default"><i class="fa fa-book"></i> Show checkouts</a> > [% SET LoadCheckoutsTableDelay = Koha.Preference('LoadCheckoutsTableDelay') %] >- [% IF LoadCheckoutsTableDelay && page == 'circulation' %] >+ [% IF LoadCheckoutsTableDelay && patronpage == 'circ' %] > <span id="issues-table-load-delay"> > <i id="issues-table-load-delay-spinner" class="fa fa-spinner fa-pulse fa-fw"></i> > <span id="issues-table-load-delay-message">Checkouts table will show automatically in [% LoadCheckoutsTableDelay | html %] seconds...</span> >@@ -45,9 +45,10 @@ > </thead> > [% INCLUDE 'checkouts-table-footer.inc' %] > </table> >- >- <label for="issues-table-load-immediately">Always show checkouts automatically</label> >- <input id="issues-table-load-immediately" type="checkbox" /> >+ [% UNLESS Koha.Preference( 'AlwaysLoadCheckoutsTable' ) %] >+ <label for="issues-table-load-immediately">Always show checkouts automatically</label> >+ <input id="issues-table-load-immediately" type="checkbox" /> >+ [% END %] > > <div id="issues-table-actions" style="display: none;"> > <fieldset class="action"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 0ce5e1919e..cb4960d976 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -165,11 +165,17 @@ Circulation: > - circulation desks with circulation. > > Checkout policy: >+ - >+ - pref: AlwaysLoadCheckoutsTable >+ choices: >+ 1: "Do" >+ 0: "Don't" >+ - always load the checksouts table. > - > - Delay the automatic loading of the checkouts table on the checkouts page by > - pref: LoadCheckoutsTableDelay > class: integer >- - seconds when "Always show checkouts automatically" is enabled. >+ - seconds when "Always show checkouts automatically" or <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AlwaysLoadCheckoutsTable">AlwaysLoadCheckoutsTable</a> are enabled. > - > - pref: OnSiteCheckoutAutoCheck > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 7707a7587f..a51359e8b0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -962,6 +962,7 @@ > <script> > /* Set some variable needed in circulation.js */ > const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %]; >+ const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %]; > var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]"; > var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]"; > var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]"; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 095c6e35dc..ccb7909ccf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -724,6 +724,7 @@ > [% Asset.js("js/recalls.js") | $raw %] > <script> > const LoadCheckoutsTableDelay = 0; >+ const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %]; > > table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %] > table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index bebe986679..24d80e6c59 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -264,34 +264,40 @@ $(document).ready(function() { > }); > > var ymd = flatpickr.formatDate(new Date(), "Y-m-d"); >- >- $('#issues-table-load-immediately').change(function(){ >- if ( this.checked && typeof issuesTable === 'undefined') { >- $('#issues-table-load-now-button').click(); >- } >- barcodefield.focus(); >- }); >- $('#issues-table-load-now-button').click(function(){ >- if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId); >- LoadIssuesTable(); >- barcodefield.focus(); >- return false; >- }); >- >- if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) { >+ if ( AlwaysLoadCheckoutsTable ) { > if ( LoadCheckoutsTableDelay ) { >- loadIssuesTableDelayTimeoutId = setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000); >+ setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000); > } else { > LoadIssuesTable(); > } >- $('#issues-table-load-immediately').prop('checked', true); > } else { >- $('#issues-table-load-delay').hide(); >- } >- $('#issues-table-load-immediately').on( "change", function(){ >- Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax' }); >- }); >+ $('#issues-table-load-immediately').change(function(){ >+ if ( this.checked && typeof issuesTable === 'undefined') { >+ $('#issues-table-load-now-button').click(); >+ } >+ barcodefield.focus(); >+ }); >+ $('#issues-table-load-now-button').click(function(){ >+ if ( loadIssuesTableDelayTimeoutId ) clearTimeout(loadIssuesTableDelayTimeoutId); >+ LoadIssuesTable(); >+ barcodefield.focus(); >+ return false; >+ }); > >+ if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) { >+ if ( LoadCheckoutsTableDelay ) { >+ loadIssuesTableDelayTimeoutId = setTimeout( function(){ LoadIssuesTable() }, LoadCheckoutsTableDelay * 1000); >+ } else { >+ LoadIssuesTable(); >+ } >+ $('#issues-table-load-immediately').prop('checked', true); >+ } else { >+ $('#issues-table-load-delay').hide(); >+ } >+ $('#issues-table-load-immediately').on( "change", function(){ >+ Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax' }); >+ }); >+ } > function RefreshIssuesTable() { > var table = $('#issues-table').DataTable(); > var renewchecked = $('input[name=renew]:checked').map(function(){ >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14180
:
161548
|
161549
|
161550
|
161551
|
161554
|
161555
|
161556
|
170095
|
170096
|
170097
|
170098
|
173382
|
173383
|
173384