Bugzilla – Attachment 46253 Details for
Bug 14306
Show URL from MARC21 field 555$u in basket and detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14306: Changes for basket and detail templates
Bug-14306-Changes-for-basket-and-detail-templates.patch (text/plain), 5.84 KB, created by
Marc Véron
on 2016-01-05 13:07:15 UTC
(
hide
)
Description:
Bug 14306: Changes for basket and detail templates
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-01-05 13:07:15 UTC
Size:
5.84 KB
patch
obsolete
>From be9ca1f55e7c9fddc90b7098403c6933adffb7be Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 27 Aug 2015 09:49:40 +0200 >Subject: [PATCH] Bug 14306: Changes for basket and detail templates >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >A simple regex is added to the basket and detail templates to select the >URLs passed separately from MARC21 555$u by GetMarcNotes. Note that the >regex tests if a note starts with http:// or https:// and does not contain >any whitespace in order to be considered as a url. >These URLs are put in an anchor tag. > >This touches four places: >[1] opac detail, tab title notes >[2] catalogue detail, tab Descriptions >[3] opac basket, more details, notes >[4] staff basket, more details, notes > >Test plan: >[1] Edit a record. Add a 500$a, 555$a and a URL in 555$u. > Put "http://this is not a url" in the 500$a (whitespace!). >[2] Check opac-detail, tab Title Notes. Check the URL. >[3] Do the same for catalogue/detail. >[4] Add record to cart in OPAC. Open basket. Check More details. >[5] Repeat previous step in staff. > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt | 10 ++++++++-- > .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 12 +++++++++--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 11 +++++++++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 +++++++- > 4 files changed, 33 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >index ff9095c..a6e7c57 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -242,8 +242,14 @@ function batchDelete(){ > <th scope="row">Notes</th> > <td> > [% FOREACH MARCNOTE IN BIBLIO_RESULT.MARCNOTES %] >- <p>- [% MARCNOTE.marcnote %]</p> >- [% END %]</td> >+ <p> >+ [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] >+ - <a target="_blank" href="[% MARCNOTE.marcnote %]">[% MARCNOTE.marcnote %]</a> >+ [% ELSE %] >+ - [% MARCNOTE.marcnote %] >+ [% END %] >+ [% END %] >+ </td> > </tr> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index f2fb6e2..5e5f364 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -864,11 +864,17 @@ function verify_images() { > > [% IF ( MARCNOTES ) %] > [% FOREACH MARCNOTE IN MARCNOTES %] >- <p>[% MARCNOTE.marcnote FILTER html_line_break %]</p> >+ <p> >+ [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] >+ <a target="_blank" href="[% MARCNOTE.marcnote %]">[% MARCNOTE.marcnote %]</a> >+ [% ELSE %] >+ [% MARCNOTE.marcnote FILTER html_line_break %] >+ [% END %] >+ </p> > [% END %] >- [% ELSE %] >+[% ELSE %] > [% IF ( notes ) %] >- <p>[% notes %]</p> >+ <p>[% notes %]</p> > [% END %] > [% END %] > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >index 94d5e0b..25661ff 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >@@ -151,8 +151,15 @@ > <th scope="row">Notes</th> > <td> > [% FOREACH MARCNOTE IN BIBLIO_RESULT.MARCNOTES %] >- <p>- [% MARCNOTE.marcnote %]</p> >- [% END %]</td> >+ <p> >+ [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] >+ - <a target="_blank" href="[% MARCNOTE.marcnote %]">[% MARCNOTE.marcnote %]</a> >+ [% ELSE %] >+ - [% MARCNOTE.marcnote %] >+ [% END %] >+ </p> >+ [% END %] >+ </td> > </tr> > [% END %] > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 3b5c404..cd610e9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -721,7 +721,13 @@ > [% IF ( MARCNOTES ) %] > <div id="marcnotes"> > [% FOREACH MARCNOTE IN MARCNOTES %] >- <p>[% MARCNOTE.marcnote FILTER html_line_break %]</p> >+ <p> >+ [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] >+ <a target="_blank" href="[% MARCNOTE.marcnote %]">[% MARCNOTE.marcnote %]</a> >+ [% ELSE %] >+ [% MARCNOTE.marcnote FILTER html_line_break %] >+ [% END %] >+ </p> > [% END %] > </div> > [% ELSE %] >-- >1.7.10.4
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 14306
:
39737
|
39741
|
41237
|
41987
|
41995
|
42010
|
42011
|
42012
|
42013
|
46221
|
46251
|
46252
|
46253
|
46254
|
48681
|
48682
|
48683
|
48684