From 97651cec35e29288e8839a4930138773c001c1c9 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 3 Mar 2020 21:18:37 +0000 Subject: [PATCH] Bug 24710: patron-title.inc should have seperate span classes for names This patch adds some elements with classes to patron-title.inc for both the staff client and OPAC TEST PLAN: 1. Have a patron with a firstname, surname, and othername and title 2. Apply patch 3. There should be no visible changes but if you inscept each element you should see seperate elements with clases. 4. Add each of these to IntranetUserCSS to make sure it hides that element (this effects patroninfo section AND breadcrumbs) .patron-firstname {display: none;} .patron-othernames {display:none}; .patron-surname{display:none} .patron-title{display:none} 5. On the OPAC navigate to /cgi-bin/koha/opac-user.pl and check the names by adding the same CSS to OPACUserCSS 6. Sign-off Signed-off-by: Sally --- .../prog/en/includes/patron-title.inc | 43 ++++++++++++++++++++-- .../bootstrap/en/includes/patron-title.inc | 4 +- 2 files changed, 42 insertions(+), 5 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 d5dcd7d0f0..2884a2a54f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -40,6 +40,43 @@ [% data.title = data.title | html %] [%- SET data.title = span_start _ data.title _ span_end _ ' ' -%] [%- END -%] + +[%- IF data.surname %] + [%- IF no_html %] + [%- span_start = '' %] + [%- span_end = '' %] + [%- ELSE %] + [%- span_start = '' %] + [%- span_end = '' %] + [%- END %] + [% data.surname = data.surname | html %] + [%- SET data.surname = span_start _ data.surname _ span_end _ ' ' -%] +[%- END -%] + +[%- IF data.firstname %] + [%- IF no_html %] + [%- span_start = '' %] + [%- span_end = '' %] + [%- ELSE %] + [%- span_start = '' %] + [%- span_end = '' %] + [%- END %] + [% data.firstname = data.firstname | html %] + [%- SET data.firstname = span_start _ data.firstname _ span_end _ ' ' -%] +[%- END -%] + +[%- IF data.othernames %] + [%- IF no_html %] + [%- span_start = '' %] + [%- span_end = '' %] + [%- ELSE %] + [%- span_start = '' %] + [%- span_end = '' %] + [%- END %] + [% data.othernames = data.othernames | html %] + [%- SET data.othernames = span_start _ data.othernames _ span_end _ ' ' -%] +[%- END -%] + [%- SET display_patron_name = 1 -%] [%- SET display_cardnumber = 1 -%] [%- IF hide_patron_infos_if_needed %] [%# Should only be set if patron is set -%] @@ -58,11 +95,11 @@ [%- END -%] [%- IF display_patron_name -%] [%- IF data.category_type == 'I' -%] - [%- data.surname | html %] [% IF data.othernames %] ([% data.othernames | html %])[% END -%] + [%- data.surname | $raw %] [% IF data.othernames %] ([% data.othernames | $raw %])[% END -%] [%- ELSIF invert_name -%] - [% data.title | $raw %][%- data.surname | html %], [% data.firstname | html %] [% IF data.othernames %] ([% data.othernames | html %]) [% END -%] + [% data.title | $raw %][%- data.surname | $raw %], [% data.firstname | $raw %] [% IF data.othernames %] ([% data.othernames | $raw %]) [% END -%] [%- ELSE -%] - [% data.title | $raw %][%- data.firstname | html %] [% IF data.othernames %] ([% data.othernames | html %]) [% END %] [% data.surname | html -%] + [% data.title | $raw %][%- data.firstname | $raw %] [% IF data.othernames %] ([% data.othernames | $raw %]) [% END %] [% data.surname | $raw -%] [%- END -%] [%- IF display_cardnumber AND data.cardnumber %] ([% data.cardnumber | html %])[% END -%] [%- ELSIF display_cardnumber -%] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/patron-title.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/patron-title.inc index d77961d713..147aaea4f1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/patron-title.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/patron-title.inc @@ -1,8 +1,8 @@ [%- IF patron.category.category_type == 'I' -%] - [% patron.surname | html %][% IF patron.othernames %] ([% patron.othernames | html %]) [%- END -%] + [% patron.surname | html %][% IF patron.othernames %] ([% patron.othernames | html %]) [%- END -%] [%- ELSE -%] [%- IF patron.title -%] [% patron.title | html %] [%- END -%] - [% patron.firstname | html %] [% patron.surname | html %] + [% patron.firstname | html %] [% patron.surname | html %] [%- END -%] -- 2.11.0