Bugzilla – Attachment 86132 Details for
Bug 22434
Correct item callnumber search link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22434: correct item callnumber search link
Bug-22434-correct-item-callnumber-search-link.patch (text/plain), 13.87 KB, created by
Biblibre Sandboxes
on 2019-03-06 10:02:32 UTC
(
hide
)
Description:
Bug 22434: correct item callnumber search link
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2019-03-06 10:02:32 UTC
Size:
13.87 KB
patch
obsolete
>From 41e38a1e3d7e88f5034e805f7939ce64e369c215 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 28 Feb 2019 15:16:53 +0100 >Subject: [PATCH] Bug 22434: correct item callnumber search link > >Many places show item callnumber as a link to a search on this callnumber. >The correct way is : (opac-)search.pl?q=callnum:%22[% callnumber | uri %]%22 > >I propose an include that creates think search link. > >Patch does not create an include for OPAC since callnumber search link is only in display without XSLT which will be obsolete. It juste corrects the filtering with uri instead of url. > >Test plan : >1) Create an item with callnumber : AAA&1(2)3 >2) Check callnumber display and search link ar OK in : >3) Intranet : perform a search in catalog search that displays this item >4) Intranet : perform a search in cataloguing serach that displays this item >5) Intranet : Create a list that displays this item >6) OPAC without XSLT : perform a search in catalog search that displays this item >7) OPAC without XSLT : perform a group search in catalog search that displays this item > >Signed-off-by: Theodoros Theodoropoulos <theod@lib.auth.gr> >--- > .../intranet-tmpl/prog/en/includes/biblio-search-link.inc | 6 ++++++ > .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 14 ++++++++++---- > .../intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt | 7 +------ > .../prog/en/modules/virtualshelves/shelves.tt | 4 +--- > .../opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 2 +- > 6 files changed, 21 insertions(+), 16 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/biblio-search-link.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-search-link.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-search-link.inc >new file mode 100644 >index 0000000..70dbd25 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-search-link.inc >@@ -0,0 +1,6 @@ >+[%~ SET query = '' ~%] >+[%~ IF index ~%] >+ [%~ query = query _ index _ ':' ~%] >+[%~ END ~%] >+[%~ query = query _ '"' _ term _ '"' ~%] >+<a href="/cgi-bin/koha/catalogue/search.pl?q=[% query | uri %]">[% term | html %]</a> >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 4bd6402..3872806 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -436,7 +436,7 @@ > [% IF ( SEARCH_RESULT.size ) %] ; [% SEARCH_RESULT.size | html %][% END %]</span> [% IF ( SEARCH_RESULT.isbn ) %]<span class="results_isbn">ISBN: [% SEARCH_RESULT.isbn | replace('\s\|', ', ') | html %]</span>[% END %] > <span class="results_itemtype">[% SEARCH_RESULT.description | html %]</span> > [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp | html %])</i>[% END %] >- [% IF ( SEARCH_RESULT.cn_class ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% SEARCH_RESULT.cn_class |uri %]%22">[% SEARCH_RESULT.cn_class | html %]</a>][% END %] >+ [% IF ( SEARCH_RESULT.cn_class ) %][[% INCLUDE 'biblio-search-link.inc' index='callnum' term=SEARCH_RESULT.cn_class %]][% END %] > </p> > [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<p class="searchhighlightblob">[% SEARCH_RESULT.searchhighlightblob | html %]</p>[% END %] > >@@ -509,7 +509,9 @@ > [% END %] > [% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname | html %][% END %] > [% IF ( available_items_loo.location ) %][% available_items_loo.location | html %][% END %] >- [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% available_items_loo.itemcallnumber |uri %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %] >+ [% IF ( available_items_loo.itemcallnumber ) %] >+ [[% INCLUDE 'biblio-search-link.inc' index='callnum' term=available_items_loo.itemcallnumber %]] >+ [% END %] > ([% available_items_loo.count | html %]) > [% IF item_level_itypes && available_items_loo.description %] > <br/>[% available_items_loo.description | html %] >@@ -531,7 +533,9 @@ > [% END %] > [% IF ( onloan_items_loo.branchname ) %][% onloan_items_loo.branchname | html %][% END %] > [% IF ( onloan_items_loo.location ) %][% onloan_items_loo.location | html %][% END %] >- [% IF ( onloan_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% onloan_items_loo.itemcallnumber |uri %]%22">[% onloan_items_loo.itemcallnumber | html %]</a>][% END %] >+ [% IF ( onloan_items_loo.itemcallnumber ) %] >+ [[% INCLUDE 'biblio-search-link.inc' index='callnum' term=available_items_loo.itemcallnumber %]] >+ [% END %] > ([% onloan_items_loo.count | html %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue | html %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %] > [% IF item_level_itypes && onloan_items_loo.description %] > <br/>[% onloan_items_loo.description | html %] >@@ -553,7 +557,9 @@ > [% END %] > [% IF ( other_items_loo.branchname ) %][% other_items_loo.branchname | html %][% END %] > [% IF ( other_items_loo.location ) %][% other_items_loo.location | html %][% END %] >- [% IF ( other_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% other_items_loo.itemcallnumber |uri %]%22">[% other_items_loo.itemcallnumber | html %]</a>][% END %] >+ [% IF ( other_items_loo.itemcallnumber ) %] >+ [[% INCLUDE 'biblio-search-link.inc' index='callnum' term=other_items_loo.itemcallnumber %]] >+ [% END %] > [% IF ( other_items_loo.withdrawn ) %]([% AuthorisedValues.GetByCode( 'WITHDRAWN', other_items_loo.withdrawn ) | html %])[% END %] > [% IF ( other_items_loo.itemlost ) %]([% AuthorisedValues.GetByCode( 'LOST', other_items_loo.itemlost ) | html %])[% END %] > [% IF ( other_items_loo.damaged ) %]([% AuthorisedValues.GetByCode( 'DAMAGED', other_items_loo.damaged ) | html %])[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >index eef01b8..cf31076 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >@@ -105,12 +105,7 @@ > [% items_loo.count | html %] [% items_loo.branchname | html %] > <i> > [% IF ( items_loo.location ) %][% items_loo.location | html %][% END %] >- [% IF ( items_loo.itemcallnumber ) %][% items_loo.itemcallnumber | html %][% END %] >- [% IF ( items_loo.classification ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:[% items_loo.classification |url %]"> >- [% items_loo.classification | html %] >- </a> >- [% END %] >+ [% IF ( items_loo.itemcallnumber ) %][[% INCLUDE 'biblio-search-link.inc' index='callnum' term=items_loo.itemcallnumber %]][% END %] > </i> > <br /> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 2e34269..d515bc1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -239,9 +239,7 @@ > <ul> > [% FOREACH result IN itemsloo.ITEM_RESULTS %] > <li>[% result.holdingbranch | html %] [% IF ( result.location_intranet ) %] ([% result.location_intranet | html %]) [% END %] >- [% IF ( result.itemcallnumber ) %] >- [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>] >- [% END %] >+ [% IF ( result.itemcallnumber ) %][[% INCLUDE 'biblio-search-link.inc' index='callnum' term=result.itemcallnumber %]][% END %] > </li> > [% END %] > </ul> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >index a5ee7ff..67b57a8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >@@ -213,7 +213,7 @@ > [% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname | html %][% END %] > [% IF ( OPACItemsResultsDisplay ) %] > [% IF ( available_items_loo.location ) %][% available_items_loo.location | html %][% END %] >- [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber | html %]</a>][% END %] >+ [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |uri %]">[% available_items_loo.itemcallnumber | html %]</a>][% END %] > [% END %] > ([% available_items_loo.count | html %]), > [% END # / FOREACH available_items_loo %] >@@ -245,7 +245,7 @@ > <img src="[% themelang | html %]/images/[% GROUP_RESULT.itemtype | html %].gif" alt="[% GROUP_RESULT.ccode | html %]" title="[% GROUP_RESULT.ccode | html %]" /> > [% IF ( ( Koha.Preference( 'opacbookbag' ) = 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]</label>[% END %] > [% IF ( GROUP_RESULT.classification ) %] >- <a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% GROUP_RESULT.classification |url %]"> [% GROUP_RESULT.classification | html %] </a> >+ <a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% GROUP_RESULT.classification |uri %]"> [% GROUP_RESULT.classification | html %] </a> > [% END %] > </p> > </td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 20f0f1c..9ace77f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -404,7 +404,7 @@ > > [% IF ( OPACItemsResultsDisplay ) %] > [% UNLESS ( singleBranchMode ) %][% available_items_loo.location | html %][% END %] >- [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber |url %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %] >+ [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber |uri %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %] > [% END %] > ([% available_items_loo.count | html %]), > </span> >-- >2.7.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 22434
:
85879
| 86132