Bugzilla – Attachment 184468 Details for
Bug 30915
"Scalar" TT plugin no longer needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30915: Remove Context.Scalar calls from templates
Bug-30915-Remove-ContextScalar-calls-from-template.patch (text/plain), 6.21 KB, created by
Marcel de Rooy
on 2025-07-22 13:04:51 UTC
(
hide
)
Description:
Bug 30915: Remove Context.Scalar calls from templates
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-07-22 13:04:51 UTC
Size:
6.21 KB
patch
obsolete
>From e2a2124e3e9dec7e342d13fb15b0928fae7de4e5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 22 Jul 2025 14:52:16 +0200 >Subject: [PATCH] Bug 30915: Remove Context.Scalar calls from templates >Content-Type: text/plain; charset=utf-8 > >Test plan: >git grep on "Context.Scalar" >Go to book with holdable items in staff catalogue detail. Check if >Place hold is seen in the horizontal toolbar above the title. >Place an article request with a patron. Check the article requests >tab on patron detail. >Same for the article requests tab on moremember (Patron details). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 4 +--- > koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc | 5 ++--- > .../prog/en/includes/patron-article-requests.inc | 3 +-- > .../intranet-tmpl/prog/en/includes/patron-detail-tabs.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 1 - > .../intranet-tmpl/prog/en/modules/circ/request-article.tt | 3 +-- > .../intranet-tmpl/prog/en/modules/members/moremember.tt | 1 - > 7 files changed, 6 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index f760ebc811..7beb9eca2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -1,4 +1,3 @@ >-[% USE Context %] > [% USE Biblio %] > > [%# Parameters: %] >@@ -259,8 +258,7 @@ > > > > [% IF ( CAN_user_reserveforothers ) %] >- [% SET items = biblio.items %] >- [% IF Context.Scalar(Context.Scalar(items, "filter_by_for_hold"), "count") %] >+ [% IF biblio.items.filter_by_for_hold.count %] > [% IF ( holdfor ) %] > <div class="btn-group"> > <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >index 510c2baf35..9814cc375d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >@@ -1,4 +1,3 @@ >-[% USE Context %] > <!-- catalog-strings.inc --> > <script> > /* Some required variables from the template */ >@@ -6,8 +5,8 @@ > var count = [% count || 0 | html %]; > var holdcount = [% holdcount || 0 | html %]; > [% SET orders = biblio.orders %] >- [% SET current = Context.Scalar(orders, "filter_out_cancelled") %] >- [% SET cancelled = Context.Scalar(orders, "filter_by_cancelled") %] >+ [% SET current = orders.filter_out_cancelled %] >+ [% SET cancelled = orders.filter_by_cancelled %] > var countorders = [% current.count || 0 | html %]; > var countdeletedorders = [% cancelled.count || 0 | html %]; > var subscriptionscount = [% biblio.subscriptions.count || 0 | html %]; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc >index d0072549e2..69972b7c4d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc >@@ -1,5 +1,4 @@ >-[% USE Context %] >-[% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %] >+[% SET current_article_requests = patron.article_requests.filter_by_current %] > [% IF current_article_requests.count > 0 %] > <table id="article-requests-table" class="table table-bordered table-striped"> > <thead> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >index 24e01ea9b3..d2f8fa8f66 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >@@ -37,7 +37,7 @@ > [% END %] > > [% IF Koha.Preference('ArticleRequests') %] >- [% SET article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current') %] >+ [% SET article_requests = patron.article_requests.filter_by_current %] > [% WRAPPER tab_item tabname= "article-requests" %] > <span>Article requests</span> ([% article_requests.count || 0 | html %]) > [% END %] >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 f6cddb1d60..4096b795e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1,6 +1,5 @@ > [% USE raw %] > [% USE Asset %] >-[% USE Context %] > [% USE Koha %] > [% USE Branches %] > [% USE KohaDates %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >index 08b217a5f2..ea1e38ee77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >@@ -1,6 +1,5 @@ > [% USE raw %] > [% USE Asset %] >-[% USE Context %] > [% USE KohaDates %] > [% USE Branches %] > [% USE Categories %] >@@ -252,7 +251,7 @@ > [% END %] > [% END %] > >- [% SET biblio_current_article_requests = Context.Scalar( Context.Scalar( biblio, 'article_requests' ), 'filter_by_current' ) %] >+ [% SET biblio_current_article_requests = biblio.article_requests.filter_by_current %] > [% IF biblio_current_article_requests.count > 0 && !patron %] > <fieldset class="rows left" id="current-article-requests-fieldset"> > <legend>Current article requests</legend> >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 83f4b8893b..f49e45ad3c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -1,6 +1,5 @@ > [% USE raw %] > [% USE Asset %] >-[% USE Context %] > [% USE Koha %] > [% USE Branches %] > [% USE ItemTypes %] >-- >2.39.5
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 30915
:
184468
|
184469
|
185108
|
185109
|
185117