Bugzilla – Attachment 191153 Details for
Bug 41577
Tidy kohaTable block - reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41577: Tidy kohaTable - reserve/request.tt
60475d7.patch (text/plain), 5.61 KB, created by
Jonathan Druart
on 2026-01-09 14:52:13 UTC
(
hide
)
Description:
Bug 41577: Tidy kohaTable - reserve/request.tt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:52:13 UTC
Size:
5.61 KB
patch
obsolete
>From 60475d70f784f89c5202b803750eee7dd6e33615 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jan 2026 14:42:04 +0100 >Subject: [PATCH] Bug 41577: Tidy kohaTable - reserve/request.tt > >--- > .../prog/en/modules/reserve/request.tt | 60 +++++++++++-------- > 1 file changed, 36 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index e5877e70894..94cbd936fa6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1578,16 +1578,7 @@ > [% SET url_biblio_params = url_biblio_params _ "&multi_hold=1" %] > [% END %] > <script> >- $(document).ready(function () { >- hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %]; >- $("#patron_holds_table").kohaTable( >- { >- paging: false, >- bKohaColumnsUseNames: true, >- }, >- hold_table_settings >- ); >- }); >+ var hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %]; > var biblionumbers = [[% biblionumbers.join(', ') | $raw %]]; > var borrowernumber = "[% patron.borrowernumber | $raw %]"; > var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]"; >@@ -1598,6 +1589,30 @@ > }, > [% END %][% END %][% END %] > }; >+ >+ const active_tab = [% clubs ? 1 : 0 | html %]; >+ >+ addPrefs({ >+ UseBranchTransferLimits: [% Koha.Preference('UseBranchTransferLimits') ? 1 : 0 | html %], >+ EnableItemGroupHolds: [% Koha.Preference('EnableItemGroupHolds') ? 1 : 0 | html %], >+ }); >+ const multi_hold = [% multi_hold ? 1 : 0 | html %]; >+ >+ const apply_patron_autocomplete = [% !( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) && PatronAutoComplete ? 1 : 0 | html %]; >+ const url_biblio_params = '[% url_biblio_params | url %]'; >+ </script> >+ >+ <script> >+ $(document).ready(function () { >+ $("#patron_holds_table").kohaTable( >+ { >+ paging: false, >+ bKohaColumnsUseNames: true, >+ }, >+ hold_table_settings >+ ); >+ }); >+ > var ERROR_MAP = { > damaged: _("Item damaged"), > ageRestricted: _("Age restricted"), >@@ -1626,9 +1641,8 @@ > }); > > if( $("#circ_holds_select").length > 0 ){ >- [% SET active = clubs ? 1 : 0 %] > /* Set active tab based on whether a club search was submitted */ >- var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show"); >+ var tabs = $("#circ_holds_select li:eq(" + active_tab + ") a").tab("show"); > $( tabs[0].hash ).find("input.focus").focus(); > > /* Change active focus when tabs change */ >@@ -1644,7 +1658,7 @@ > ToggleHoldsToPlace(); > }); > >- [% IF Koha.Preference('UseBranchTransferLimits') %] >+ if (prefs.UseBranchTransferLimits){ > $("#pickup,#pickup-next-avail,#pickup-item-group").on('change', function(){ > var pickup = $(this).val(); > var url = "?pickup=" + pickup; >@@ -1652,7 +1666,7 @@ > url += "&biblionumber=" + biblionumbers[0]; > window.location.replace(url); > }); >- [% END %] >+ } > > var my_table = $("#requestspecific").kohaTable({ > paging: false, >@@ -1713,15 +1727,15 @@ > return false; > }); > >- [% UNLESS ( multi_hold ) %] >+ if (!multi_hold){ > $("#hold-request-form").on("submit", function(e){ > return check(e, $(this)); > }); >- [% ELSE %] >+ } else { > $("#hold-request-form").on("submit", function(){ > return checkMultiHold(); > }); >- [% END %] >+ } > > $(".pickup_location_dropdown").each( function () { > $(this).pickup_locations_dropdown(); >@@ -1960,13 +1974,11 @@ > $("#" + fieldID).val(""); > }); > >- [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %] >- [% IF ( PatronAutoComplete ) %] >- patron_autocomplete($(".search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' }); >- [% END %] >- [% END %] >+ if (apply_patron_autocomplete){ >+ patron_autocomplete($(".search_patron_filter"), { 'link-to': 'reserve', 'url-params': url_biblio_params }); >+ } > >- [% IF Koha.Preference('EnableItemGroupHolds') %] >+ if (prefs.EnableItemGroupHolds){ > $(':radio[name="item_group_id"]').change(function(){ > $('input[name="checkitem"]').prop('checked', false); > }); >@@ -1974,7 +1986,7 @@ > $('input[name="checkitem"]').change(function(){ > $(':radio[name="item_group_id"]').prop('checked', false); > }); >- [% END %] >+ } > > $(".hold-arrow").click(function(e) { > e.preventDefault(); >-- >2.43.0 >
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 41577
: 191153 |
191154