Bugzilla – Attachment 191186 Details for
Bug 41582
Tidy kohaTable block - opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41582: Tidy kohaTable - opac-user
42a1429.patch (text/plain), 5.56 KB, created by
Jonathan Druart
on 2026-01-09 14:54:59 UTC
(
hide
)
Description:
Bug 41582: Tidy kohaTable - opac-user
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:54:59 UTC
Size:
5.56 KB
patch
obsolete
>From 42a14290cc0d05111bea67ef74c68363cb48f841 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Jan 2026 11:59:26 +0100 >Subject: [PATCH] Bug 41582: Tidy kohaTable - opac-user > >--- > .../bootstrap/en/modules/opac-user.tt | 34 ++++++++++++------- > 1 file changed, 22 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 88e79827847..5b6f786a445 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -1052,7 +1052,17 @@ > [% INCLUDE 'datatables.inc' %] > <script> > const tab = "[% tab | html %]"; >+ const logged_in_user_borrowernumber = "[% borrowernumber | html %]"; >+ addPrefs({ >+ OpacRenewalAllowed: [% Koha.Preference('OpacRenewalAllowed') ? 1 : 0 | html %], >+ GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %], >+ AllowCheckoutNotes: [% Koha.Preference('AllowCheckoutNotes') ? 1 : 0 | html %], >+ }); >+ const can_renew = [% canrenew ? 1 : 0 | html %]; >+ const is_debarred = [% userdebarred ? 1 : 0 | html %]; >+ const current_article_requests_size = [% current_article_requests.size || 0 | html %]; > </script> >+ > <script> > var AR_CAPTION_COUNT = _("(%s total)"); > >@@ -1060,9 +1070,9 @@ > function tableInit( tableId ){ > if( tableId == "checkoutst" ){ > $(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> "); >- [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %] >+ if (prefs.OpacRenewalAllowed && can_renew && !is_debarred){ > $(".dt-buttons").append("<button id=\"renewselected_link\" class=\"dt-button buttons-renew\"><i class=\"fa fa-check\" aria-hidden=\"true\"></i> "+_("Renew selected")+"</button> <button id=\"renewall_link\" class=\"dt-button buttons-renewall\"><span class=\"fa-stack\"><i class=\"fa fa-check fa-stack-1x\" aria-hidden=\"true\"></i><i class=\"fa fa-check fa-stack-1x\" aria-hidden=\"true\"></i></span> "+_("Renew all")+"</button>"); >- [% END %] >+ } > } > } > $(document).ready(function(){ >@@ -1073,7 +1083,7 @@ > $("#opac-user-views a:first").tab("show"); > } > >- $('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]')); >+ $('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format(current_article_requests_size)); > > $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); > >@@ -1110,7 +1120,7 @@ > if( result ){ > $.ajax({ > type: "DELETE", >- url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC', >+ url: `/api/v1/public/patrons/${logged_in_user_borrowernumber}/article_requests/${article_request_id}?cancellation_reason=OPAC`, > success: function( data ) { > $("#article_" + article_request_id ).hide({ > duration: 'slow', >@@ -1243,8 +1253,10 @@ > location.href="/cgi-bin/koha/opac-ics.pl"; > }); > >- [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] >- [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %] >+ if (prefs.GoogleJackets){ >+ KOHA.Google.GetCoverFromIsbn(); >+ } >+ if (prefs.OpacRenewalAllowed && can_renew && !is_debarred){ > $("#renewselected").submit(function(){ > valid = false; > $("input[type=checkbox]").each(function(){ >@@ -1265,9 +1277,9 @@ > e.preventDefault(); > $("#renewall").submit(); > }); >- [% END # /IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %] >+ } > >- [% IF ( Koha.Preference('AllowCheckoutNotes') ) %] >+ if (prefs.AllowCheckoutNotes){ > > /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */ > $(".nonjs_submitnote").hide(); >@@ -1294,8 +1306,7 @@ > $btn_save.hide(); > } > }); >- >- [% END %] >+ } > > $(".change_pickup").on("click", function(){ > var hold_id = $(this).data("hold-id"); >@@ -1306,7 +1317,7 @@ > if ( $('#opac-user-clubs_panel').length ) { > $('#opac-user-clubs-tab').on('click', function() { > $('#opac-user-clubs_panel').text(_("Loading...")); >- $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]'); >+ $('#opac-user-clubs_panel').load(`/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=${logged_in_user_borrowernumber}`); > }); > } > >@@ -1411,7 +1422,6 @@ > return "<em>" + title + "</em>"; > } > >- var borrowernumber = "[% borrowernumber | html %]"; > </script> > [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %] > [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %] >-- >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 41582
:
191174
|
191175
|
191176
|
191177
|
191178
|
191179
|
191180
|
191181
|
191182
|
191183
|
191184
|
191185
| 191186 |
191187
|
191188