From 4e8cc8189d8d01aa592663ba933b91e9905f8014 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 13 Oct 2017 06:44:55 +0000 Subject: [PATCH] Bug19456: Make patron-title ability to be generated with or without html tags Modified pages: circ/circulation.pl circ/circulation_batch_checkouts.pl members/boraccount.pl members/files.pl members/holdshistory.pl members/housebound.pl members/moremember.pl members/notices.pl members/purchase-suggestions.pl members/readingrec.pl members/routing-lists.pl members/statistics.pl tools/viewlog.pl Test plan: 0) Do not apply the patch 1) Have a patron with title/salution filled in 2) Confirm bug, go for example to circ/circulation page and see there is html in tag (you can see it in your browser page/window title) 3) Apply the patch 4) Go through circulation/patron pages (see modified page above) and confirm there is no html in <title> tag, but on the page itself the salutation should be in <span class="patron-title"> --- koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- .../intranet-tmpl/prog/en/includes/patron-title.inc | 16 ++++++++++++---- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 8 ++++---- .../prog/en/modules/circ/circulation_batch_checkouts.tt | 8 ++++---- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt | 2 +- .../prog/en/modules/members/holdshistory.tt | 2 +- .../intranet-tmpl/prog/en/modules/members/housebound.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- .../intranet-tmpl/prog/en/modules/members/notices.tt | 4 ++-- .../prog/en/modules/members/purchase-suggestions.tt | 2 +- .../intranet-tmpl/prog/en/modules/members/readingrec.tt | 2 +- .../prog/en/modules/members/routing-lists.tt | 2 +- .../intranet-tmpl/prog/en/modules/members/statistics.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 2 +- 15 files changed, 35 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index d34ff9f..796a6f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -1,6 +1,6 @@ [% USE Koha %] [% IF ( borrowernumber ) %] -<div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5> +<div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' use_html=1 %]</h5> <!--[if IE 6]> <style type="tex/css">img { width: expression(this.width > 140 ? 140: true); }</style> 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 c7818f0..2efeba6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -1,11 +1,19 @@ +[%# Parameter use_html - if 1, the html tags are generated %] +[%- IF use_html %] + [%- span_start = '<span class="patron-title">' %] + [%- span_end = '</span>' %] +[%- ELSE %] + [%- span_start = '' %] + [%- span_end = '' %] +[%- END %] [%- IF ( borrower.borrowernumber ) %] [%- IF borrower.category_type == 'I' %] [%- borrower.surname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [%- ELSE %] [%- IF invert_name %] - [%- IF borrower.title %]<span class="patron-title">[%- borrower.title | html %]</span> [% END %][%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] + [%- IF borrower.title %][% span_start %][%- borrower.title | html %][% span_end %] [% END %][%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [%- ELSE %] - [%- IF borrower.title %]<span class="patron-title">[%- borrower.title | html %]</span> [% END %][%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %] + [%- IF borrower.title %][% span_start %][%- borrower.title | html %][% span_end %] [% END %][%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %] [%- END -%] [%- END -%] [%- IF ( borrower.cardnumber ) -%] @@ -16,9 +24,9 @@ [%- surname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [%- ELSE %] [%- IF invert_name %] - [%- IF title %]<span class="patron-title">[%- title | html %]</span> [% END %][%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] + [%- IF title %][% span_start %][%- title | html %][% span_end %] [% END %][%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [%- ELSE %] - [%- IF title %]<span class="patron-title">[%- title | html %]</span> [% END %][%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %] + [%- IF title %][% span_start %][%- title | html %][% span_end %] [% END %][%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %] [%- END %] [%- END -%] [%- IF ( cardnumber ) -%] 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 d5507c0..acb836e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -133,7 +133,7 @@ $(document).ready(function() { <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › [% IF borrowernumber and borrower %] - <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> › [% INCLUDE 'patron-title.inc' %] + <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> › [% INCLUDE 'patron-title.inc' use_html = 1 %] [% ELSE %] <strong>Checkouts</strong> [% END %] @@ -414,7 +414,7 @@ $(document).ready(function() { [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %] [% UNLESS noissues %] - <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button> + <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' use_html = 1 %]</button> [% END %] [% END %] </div></div> @@ -635,7 +635,7 @@ No patron matched <span class="ex">[% message | html %]</span> [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] - <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label> + <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' use_html = 1 %]</label> [% IF Koha.Preference('itemBarcodeFallbackSearch') %] <div class="hint">Enter item barcode or keyword:</div> @@ -754,7 +754,7 @@ No patron matched <span class="ex">[% message | html %]</span> [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] <div id="circmessages" class="circmessage attention"> [% ELSE %] - <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4> + <h4>Checking out to [% INCLUDE 'patron-title.inc' use_html = 1 %]</h4> <div id="circmessages" class="circmessage warning"> [% END %] <h3> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt index 1fc917f..36bafaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt @@ -41,7 +41,7 @@ $(document).ready(function() { <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › [% IF borrower and borrowernumber %] - <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> › [% INCLUDE 'patron-title.inc' %] + <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> › [% INCLUDE 'patron-title.inc' use_html = 1 %] [% ELSE %] Batch check out [% END %] @@ -78,7 +78,7 @@ $(document).ready(function() { [% ELSIF borrower and not checkout_infos %] <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl"> <fieldset id="circ_circulation_issue"> - <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label> + <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' use_html = 1 %]</label> <fieldset class="rows"> <legend>Use a file</legend> <ol> @@ -106,10 +106,10 @@ $(document).ready(function() { [% ELSIF borrower %] [% IF confirmation_needed && CAN_user_circulate_force_checkout %] - <h3>Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3> + <h3>Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 use_html = 1 ] [% END %]</h3> <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off"> [% ELSE %] - <h3>Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch %]|[% END %]</h3> + <h3>Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 use_html = 1 %] |[% batch %]|[% END %]</h3> [% END %] <table id="checkout_infos"> <thead> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index ec79237..9c80888 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -42,7 +42,7 @@ $(document).ready(function() { [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Account for [% INCLUDE 'patron-title.inc' %]</div> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Account for [% INCLUDE 'patron-title.inc' use_html = 1 %]</div> <div id="doc3" class="yui-t2"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt index ba4cc1f..f292652 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt @@ -21,7 +21,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Files for [% INCLUDE 'patron-title.inc' %]</div> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Files for [% INCLUDE 'patron-title.inc' use_html = 1 %]</div> <div id="doc3" class="yui-t2"> <div id="bd"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt index 169e75a..e244a02 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -31,7 +31,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Holds history for [% INCLUDE 'patron-title.inc' %]</div> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Holds history for [% INCLUDE 'patron-title.inc' use_html = 1 %]</div> <div id="doc3" class="yui-t2"> <div id="bd"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt index c17363f..1eddd63 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt @@ -22,7 +22,7 @@ <div id="breadcrumbs"> <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> -› Details for [% INCLUDE 'patron-title.inc' %] +› Details for [% INCLUDE 'patron-title.inc' use_html = 1 %] </div> <div id="doc3" class="yui-t2"> @@ -37,7 +37,7 @@ <div class="yui-g"> <!-- Title --> - <h3>Housebound details for [% INCLUDE 'patron-title.inc' %]</h3> + <h3>Housebound details for [% INCLUDE 'patron-title.inc' use_html = 1 %]</h3> <div class="first"> [% FOR m IN messages %] 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 b40c29a..1ee0723 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -143,7 +143,7 @@ function validate1(date) { <div id="breadcrumbs"> <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> -› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron details for [% INCLUDE 'patron-title.inc' %][% END %] +› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron details for [% INCLUDE 'patron-title.inc' use_html = 1 %][% END %] </div> <div id="doc3" class="yui-t2"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 7ae818c..ae5e2c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -35,14 +35,14 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Sent notices for [% INCLUDE 'patron-title.inc' %]</div> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Sent notices for [% INCLUDE 'patron-title.inc' use_html = 1 %]</div> <div id="doc3" class="yui-t2"> <div id="bd"> <div id="yui-main"> <div class="yui-b"> [% INCLUDE 'members-toolbar.inc' %] -<h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1> +<h1>Sent notices for [% INCLUDE 'patron-title.inc' use_html = 1 %]</h1> [% IF ( QUEUED_MESSAGES ) %] <table id="noticestable"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt index a6f1e8f..f2c4d8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt @@ -25,7 +25,7 @@ <div id="breadcrumbs"> <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> -› Purchase suggestions for [% INCLUDE 'patron-title.inc' %] +› Purchase suggestions for [% INCLUDE 'patron-title.inc' use_html = 1 %] </div> <div id="doc3" class="yui-t1"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt index 5f2e1d8..1807b8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -39,7 +39,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Circulation history for [% INCLUDE 'patron-title.inc' %]</div> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Circulation history for [% INCLUDE 'patron-title.inc' use_html = 1 %]</div> <div id="doc3" class="yui-t2"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt index be6d0ef..eb36634 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt @@ -9,7 +9,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Subscription Routing Lists for [% INCLUDE 'patron-title.inc' %]</div> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Subscription Routing Lists for [% INCLUDE 'patron-title.inc' use_html = 1 %]</div> <div id="doc3" class="yui-t2"> <div id="bd"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt index 44a0bca..b3d51c9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt @@ -26,7 +26,7 @@ Statistics for [% INCLUDE 'patron-title.inc' %] <div id="breadcrumbs"> <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> -› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Statistics for [% INCLUDE 'patron-title.inc' invert_name = 1 %][% END %] +› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Statistics for [% INCLUDE 'patron-title.inc' invert_name = 1 use_html = 1 %][% END %] </div> <div id="doc3" class="yui-t1"> @@ -36,7 +36,7 @@ Statistics for [% INCLUDE 'patron-title.inc' %] <div class="yui-b"> [% INCLUDE 'members-toolbar.inc' %] - <h3>Statistics for [% INCLUDE 'patron-title.inc' %]</h3> + <h3>Statistics for [% INCLUDE 'patron-title.inc' use_html = 1 %]</h3> [% IF ( datas.size ) %] <table id="statistics"> <thead> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index e5706c6..d9870d3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -256,7 +256,7 @@ for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object | url %]">Bibliographic record [% object | html %]</a> [% END %] [% IF ( MEMBERS ) %] - for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object | url %]">[% INCLUDE 'patron-title.inc' %]</a> + for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object | url %]">[% INCLUDE 'patron-title.inc' use_html = 1 %]</a> [% END %] . </div> -- 2.1.4