Bugzilla – Attachment 187420 Details for
Bug 30568
Make patron name fields more flexible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30568: Add classes to component name parts in intranet
Bug-30568-Add-classes-to-component-name-parts-in-i.patch (text/plain), 5.27 KB, created by
Nick Clemens (kidclamp)
on 2025-10-03 18:14:08 UTC
(
hide
)
Description:
Bug 30568: Add classes to component name parts in intranet
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-10-03 18:14:08 UTC
Size:
5.27 KB
patch
obsolete
>From 31c2d25e9ffab6ec74f48f0c66eedfd0cc139619 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 3 Oct 2025 18:03:56 +0000 >Subject: [PATCH] Bug 30568: Add classes to component name parts in intranet > >This patch adds a wrapper function in patron-title.inc that can be used to either span, or not if no html requested >It replaces the same concept that was used for patron title > >to test: >1 - have a patron with all name parts >2 - load pages with a variety of name displays, confirm lack of classes >3 - apply patch >4 - reload pages from step 2, confirm there are now classes *except for where the name is called with no_html, like a page title >5 - Check page titles, patron search, placing a hold, patron search and confirm different links and views work as before >--- > .../prog/en/includes/patron-title.inc | 40 ++++++++++--------- > 1 file changed, 21 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc >index e25bc030414..a0577c3f885 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc >@@ -34,18 +34,6 @@ > [%- SET data.title = title -%] > [%- END -%] > [%# Parameter no_html - if 1, the html tags are NOT generated -%] >-[%- IF no_title -%][%- SET data.title = "" -%][%- END -%] >-[%- IF data.title -%] >- [%- IF no_html -%] >- [%- span_start = '' -%] >- [%- span_end = '' -%] >- [%- ELSE -%] >- [%- span_start = '<span class="patron-title">' -%] >- [%- span_end = '</span>' -%] >- [%- END -%] >- [%- data.title = data.title | html -%] >- [%- SET data.title = span_start _ data.title _ span_end _ ' ' -%] >-[%- END -%] > [%- SET display_patron_name = 1 -%] > [%- SET display_cardnumber = 1 -%] > [%- IF no_cardnumber -%][%- SET display_cardnumber = 0 -%][%- END -%] >@@ -75,21 +63,35 @@ > [%- BLOCK display_patron_name -%] > [%- IF display_patron_name -%] > [%- IF data.category_type == 'I' -%] >- [%- data.surname | html -%] >- [%- IF data.othernames -%]([%- data.othernames | html -%])[%- END -%] >+ [%- WRAPPER maybe_span field_name = 'surname' -%][%- data.surname | html -%][%- END -%] >+ [%- IF data.othernames -%]([%- WRAPPER maybe_span field_name='othernames' -%][%- data.othernames | html -%][%- END -%])[%- END -%] > [%- ELSIF invert_name -%] >- [%- data.title | $raw -%][%- data.surname | html -%][%- IF ( data.preferred_name ) -%], [% data.preferred_name | html -%][%- END -%][%- IF data.middle_name -%][% ' ' _ data.middle_name | html -%][%- END -%][%- IF data.othernames -%]([%- data.othernames | html -%])[%- END -%] >+ [%- UNLESS no_title %][%- WRAPPER maybe_span field_name='patron_title' -%][%- data.title _ ' ' | html -%][%- END -%][%- END -%] >+ [%- WRAPPER maybe_span field_name='surname' -%][%- data.surname | html -%][%- END -%] >+ [%- IF ( data.preferred_name ) -%], [%- WRAPPER maybe_span field_name='preferred_name' -%][% data.preferred_name | html -%][%- END -%][%- END -%] >+ [%- IF data.middle_name -%][%- WRAPPER maybe_span field_name='middle_name' -%][% ' ' _ data.middle_name | html -%][%- END -%][%- END -%] >+ [%- IF data.othernames -%]([%- WRAPPER maybe_span field_name='othernames' -%][%- data.othernames | html -%][%- END -%])[%- END -%] > [%- ELSE -%] >- [%- data.title | $raw -%][%- data.preferred_name | html %][%- IF data.middle_name -%][% ' ' _ data.middle_name | html -%][%- END -%][%- IF data.othernames -%][%- ' (' _ data.othernames _ ')' | html -%][%- END -%] >- [% data.surname | html -%] >+ [%- UNLESS no_title %][%- WRAPPER maybe_span field_name='patron_title' -%][%- data.title _ ' ' | html -%][%- END -%][%- END -%] >+ [%- WRAPPER maybe_span field_name='preferred_name' -%][%- data.preferred_name | html %][% END -%] >+ [%- IF data.middle_name -%][%- WRAPPER maybe_span field_name='middle_name' -%][% ' ' _ data.middle_name | html -%][%- END -%][%- END -%] >+ [%- IF data.othernames -%][%- WRAPPER maybe_span field_name='othernames' -%][%- ' (' _ data.othernames _ ')' | html -%][%- END -%][%- END -%] >+ [%- WRAPPER maybe_span field_name='surname' -%][% ' ' _ data.surname | html -%][%- END -%] > [%- END -%] >- [%- IF display_cardnumber AND data.cardnumber -%][%- ' (' _ data.cardnumber _ ')' | html -%][%- END -%] >+ [%- IF display_cardnumber AND data.cardnumber -%][%- WRAPPER maybe_span field_name='cardnumber' -%][%- ' (' _ data.cardnumber _ ')' | html -%][%- END -%][%- END -%] > [%- ELSIF display_cardnumber -%] > [%- IF data.cardnumber -%] > [%# FIXME Cardnumber should always be defined, right? -%] >- [%- data.cardnumber | html -%] >+ [%- WRAPPER maybe_span field_name='cardnumber' -%][%- data.cardnumber | html -%][%- END -%] > [%- END -%] > [%- ELSE -%] > <span>A patron from library [%- Branches.GetName( patron.branchcode ) | html -%]</span> > [%- END -%] > [% END %] >+[%- BLOCK maybe_span -%] >+ [%- IF no_html -%] >+ [%- content | html -%] >+ [%- ELSE -%] >+ <span class="[% field_name | html %]">[%- content | html -%]</span> >+ [%- END -%] >+[%- END -%] >-- >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 30568
:
175338
|
175351
|
175365
|
175910
|
175911
|
186504
|
186505
|
187420
|
187421
|
187494
|
187495
|
187659
|
187660
|
187704
|
187740
|
187741
|
187742
|
187743
|
187785
|
187786
|
187787
|
187788
|
188391