Bugzilla – Attachment 87992 Details for
Bug 22695
Remove non-XSLT search results view from the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22695: Remove non-XSLT search results view from the staff client
Bug-22695-Remove-non-XSLT-search-results-view-from.patch (text/plain), 9.71 KB, created by
Chris Cormack
on 2019-04-15 02:53:18 UTC
(
hide
)
Description:
Bug 22695: Remove non-XSLT search results view from the staff client
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2019-04-15 02:53:18 UTC
Size:
9.71 KB
patch
obsolete
>From 874670479c14456695f046690e37c07527ded632 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 12 Apr 2019 12:52:52 +0000 >Subject: [PATCH] Bug 22695: Remove non-XSLT search results view from the staff > client > >This patch removes the option to select non-XSLT search results in the >staff client. The patch removes the markup from the template, updates >the system preference options, and modifies Search.pm so that OPAC and >staff client results XSLT functions are not tied together. > >To test, apply the patch and set the XSLTResultsDisplay to a blank >value. Run the database update. The value of the XSLTResultsDisplay >system preference should now be "default." > >Perform a catalog search in the staff client. The results should be >shown using the XSLT view. > >Test that OPAC search results respect the OPACXSLTResultsDisplay >preference when enabled and disabled. > >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> >Signed-off-by: Bin Wen <bin.wen@inlibro.com> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/Search.pm | 12 +++++-- > .../bug_22695-remove-non-xslt-results.perl | 6 ++++ > .../en/modules/admin/preferences/staff_client.pref | 4 +-- > .../prog/en/modules/catalogue/results.tt | 39 ---------------------- > 4 files changed, 17 insertions(+), 44 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_22695-remove-non-xslt-results.perl > >diff --git a/C4/Search.pm b/C4/Search.pm >index ef81e19e7c..1a9f51b4e1 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1910,9 +1910,15 @@ sub searchResults { > my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber',''); > > # set stuff for XSLT processing here once, not later again for every record we retrieved >- my $interface = $is_opac ? 'OPAC' : ''; >- my $xslsyspref = $interface . "XSLTResultsDisplay"; >- my $xslfile = C4::Context->preference($xslsyspref); >+ my $xslfile; >+ my $xslsyspref; >+ if( $is_opac ){ >+ $xslsyspref = "OPACXSLTResultsDisplay"; >+ $xslfile = C4::Context->preference( $xslsyspref ); >+ } else { >+ $xslsyspref = "XSLTResultsDisplay"; >+ $xslfile = C4::Context->preference( $xslsyspref ) || "default"; >+ } > my $lang = $xslfile ? C4::Languages::getlanguage() : undef; > my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; > >diff --git a/installer/data/mysql/atomicupdate/bug_22695-remove-non-xslt-results.perl b/installer/data/mysql/atomicupdate/bug_22695-remove-non-xslt-results.perl >new file mode 100644 >index 0000000000..2e29877288 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22695-remove-non-xslt-results.perl >@@ -0,0 +1,6 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( "UPDATE systempreferences SET value = 'default' WHERE variable = 'XSLTResultsDisplay' AND value = ''" ); >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 22695 - Remove non-XSLT search results view from the staff client)\n"; >+} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >index 4ef153ae08..570c570982 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >@@ -75,12 +75,12 @@ Staff Client: > - 'Display results in the staff client using XSLT stylesheet at: ' > - pref: XSLTResultsDisplay > class: file >- - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="XSLTResultsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="XSLTResultsDisplay" data-value="default">default</a>" for the default one</li><li> put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language' >+ - '<br />Options:<ul><li>Enter "<a href="#" class="set_syspref" data-syspref="XSLTResultsDisplay" data-value="default">default</a>" for the default one</li><li>Put a path to define a xslt file</li><li>Put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language' > - > - 'Display details in the staff client using XSLT stylesheet at: ' > - pref: XSLTDetailsDisplay > class: file >- - '<br />Options:<ul><li>enter "<a href="#" class="set_syspref" data-syspref="XSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><li>put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language' >+ - '<br />Options:<ul><li>Enter "<a href="#" class="set_syspref" data-syspref="XSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><li>Put a path to define a xslt file</li><li>Put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language' > - > - pref: DisplayIconsXSLT > choices: >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 7f3cb6f3e4..ca3733f806 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -400,48 +400,9 @@ > </div> > [% END %] > >- [% IF ( SEARCH_RESULT.XSLTResultsRecord ) %] > [% SEARCH_RESULT.result_number | html %]. > [% SEARCH_RESULT.XSLTResultsRecord | $raw %] >- [% ELSE %] >- <p>[% SEARCH_RESULT.result_number | html %]. >- [% biblionumber = SEARCH_RESULT.biblionumber %] >- >- [% INCLUDE 'biblio-default-view.inc' %] >- <b>[% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title | html %][% ELSE %]No title[% END %]</b> >- </a> >- [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield | html %][% END %] >- [% IF ( SEARCH_RESULT.seriestitle ) %][% SEARCH_RESULT.seriestitle | html %][% END %] >- [% IF ( SEARCH_RESULT.volume ) %][% SEARCH_RESULT.volume | html %][% END %] [% IF ( SEARCH_RESULT.volumeddesc ) %], [% SEARCH_RESULT.volumeddesc | html %][% END %] >- </p> >- [% IF ( SEARCH_RESULT.summary ) %] >- [% IF ( SEARCH_RESULT.author ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?idx=au&q=[% SEARCH_RESULT.author |url %]" title="Search for this Author">[% SEARCH_RESULT.author | html %]</a> >- [% ELSE %] >- >- [% END %] >- <p>[% SEARCH_RESULT.summary | html %]</p> >- [% ELSE %] >- <p> >- [% IF ( SEARCH_RESULT.author ) %] >- <a href="/cgi-bin/koha/catalogue/search.pl?idx=au&q=[% SEARCH_RESULT.author |url %]" title="Search for this Author">[% SEARCH_RESULT.author | html %]</a> >- [% ELSE %] >- >- [% END %] >- Description: >- <span class="results_imprint">[% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %] >- [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %] [% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear | html %] [% ELSIF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate | html %][% END %]</span> >- [% IF ( SEARCH_RESULT.edition ) %]<span class="results_edition">Edition: [% SEARCH_RESULT.edition | html %]</span>[% END %] >- <span class="results_physicaldesc">[% IF ( SEARCH_RESULT.pages ) %]: [% SEARCH_RESULT.pages | html %][% END %] >- [% 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 %] >- </p> >- [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<p class="searchhighlightblob">[% SEARCH_RESULT.searchhighlightblob | html %]</p>[% END %] > >- [% END %] >- [% END %] > <p class="hold"> > > [% IF ( SEARCH_RESULT.norequests ) %] >-- >2.11.0
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 22695
:
87910
|
87930
|
87937
| 87992