Bugzilla – Attachment 119536 Details for
Bug 11361
Add a Z39.50 search page in the OPAC to let members search for records on remote Koha instances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11361 - (QA follow-up) Add filters and change forbidden patterns
Bug-11361---QA-follow-up-Add-filters-and-change-fo.patch (text/plain), 14.82 KB, created by
Alexis Ripetti
on 2021-04-13 13:51:42 UTC
(
hide
)
Description:
Bug 11361 - (QA follow-up) Add filters and change forbidden patterns
Filename:
MIME Type:
Creator:
Alexis Ripetti
Created:
2021-04-13 13:51:42 UTC
Size:
14.82 KB
patch
obsolete
>From 4218c4211fa3849e34bcc8cfaa6772684b3a3baf Mon Sep 17 00:00:00 2001 >From: Alexis Ripetti <alexis.ripetti@inLibro.com> >Date: Mon, 12 Apr 2021 08:38:24 -0400 >Subject: [PATCH] Bug 11361 - (QA follow-up) Add filters and change forbidden > patterns > >--- > .../bootstrap/en/includes/opac-bottom.inc | 2 +- > .../bootstrap/en/modules/opac-z3950-search.tt | 88 +++++++++---------- > opac/opac-z3950-search.pl | 22 ++--- > 3 files changed, 56 insertions(+), 56 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 327c956481..ab3872de05 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -324,7 +324,7 @@ $(document).ready(function() { > </script> > [% END %] > [% IF Koha.Preference( 'OpacZ3950' ) %] >-<script type="text/javascript"> >+<script> > //<![CDATA[ > $(document).ready(function() { > $("#z3950searchOpac").click(function(){ >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >index 6c6aac2cec..2621ee3706 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >@@ -1,13 +1,14 @@ > [% USE Koha %] >+[% USE raw %] >+[% USE Asset %] > [% INCLUDE 'doc-head-open.inc' %] > Koha › Z39.50/SRU search results > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'greybox.inc' %] > [% BLOCK cssinclude %][% END %] >- <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >- <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/staff-global.css" /> >+ [% Asset.css("css/datatables.css") | $raw %] > >- <style type="text/css"> >+ <style> > .linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;} > .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;} > .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;} >@@ -62,20 +63,20 @@ Koha › Z39.50/SRU search results > <form method="post" action="opac-z3950-search.pl" name="f"> > <div class="row-fluid"> > <input type="hidden" name="op" id="op" value="do_search" /> >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >- <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | uri %]" /> >+ <input type="hidden" name="frameworkcode" value="[% frameworkcode | uri %]" /> > <div id="search_params" class="span6 form-horizontal"> > <h2>Search Parameters</h2> > <div id="search_field" class="well"> > [% FOREACH field IN search_fields %] > <div class="input-prepend input-block-level"> >- <span class="add-on">[% field.label %]</span> >- <input type="text" id="[% field.prop %]" name="[% field.prop %]" value="[% ${field.prop} %]" /> >+ <span class="add-on">[% field.label | html %]</span> >+ <input type="text" id="[% field.prop | html %]" name="[% field.prop | html %]" value="[% ${field.prop} | html %]" /> > </div> > [% END %] > </div> > <div class="control-group"> >- <div calss="controls"> >+ <div class="controls"> > <button onclick="$("form[name='f']").submit();" class="btn search-submit">Search</button> > <a href="#">Cancel</a> > </div> >@@ -96,15 +97,15 @@ Koha › Z39.50/SRU search results > <div id="z3950_search_targets" class="well checkboxed"> > [% FOREACH serverloo IN serverloop %] > <div class="input-group"> >- <label for="z3950_[% serverloo.id %]"> >+ <label for="z3950_[% serverloo.id | html %]"> > <input >- style="vertical-align:-2px" >+ style="vertical-align:-2px;" > type="checkbox" name="id" >- id="z3950_[% serverloo.id %]" >- value="[% serverloo.id %]" >+ id="z3950_[% serverloo.id | html %]" >+ value="[% serverloo.id | html %]" > [% IF ( serverloo.checked ) %]checked="checked"[% END %] > /> >- [% serverloo.servername %] >+ [% serverloo.servername | html %] > </label> > </div> > [% END %] >@@ -117,7 +118,7 @@ Koha › Z39.50/SRU search results > <h2>Results</h2> > <p>You searched for: > [% FOREACH field IN search_fields %] >- [% IF ( ${field.prop} ) %]<em>[% field.label %]: </em><span class=term>[% ${field.prop} %]</span> [% END %] >+ [% IF ( ${field.prop} ) %]<em>[% field.label | html %]: </em><span class=term>[% ${field.prop} | html %]</span> [% END %] > [% END %] > </p> > </div> >@@ -125,10 +126,10 @@ Koha › Z39.50/SRU search results > <div class="alert alert-danger"> > <ul> > [% FOREACH errcon IN errconn %] >- [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li> >- [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li> >- [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li> >- [% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li> >+ [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li> >+ [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li> >+ [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server | html %]: Warning: XSLT error on search result [% errcon.seq | html %]</li> >+ [% ELSE %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% errcon.error | html %]</li> > [% END %] > [% END %] > </ul> >@@ -152,17 +153,17 @@ Koha › Z39.50/SRU search results > </tr></thead> > <tbody>[% FOREACH breeding_loo IN breeding_loop %] > [% IF ( breeding_loo.breedingid ) %] >- <tr id="row[% breeding_loo.breedingid %]"> >- <td>[% breeding_loo.server %] </td> >- <td>[% breeding_loo.title |html %]</td> >- <td>[% breeding_loo.author %]</td> >- <td>[% breeding_loo.date %]</td> >- <td>[% breeding_loo.edition %]</td> >- <td>[% breeding_loo.isbn %]</td> >- <td>[% breeding_loo.lccn %]</td> >- <td><a href="/cgi-bin/koha/opac-showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td> >- <td><a href="/cgi-bin/koha/opac-showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> >- <td><a target="_blank" href="http://[% breeding_loo.opacurl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a></td> >+ <tr id="row[% breeding_loo.breedingid | html %]"> >+ <td>[% breeding_loo.server | html %] </td> >+ <td>[% breeding_loo.title | html %]</td> >+ <td>[% breeding_loo.author | html %]</td> >+ <td>[% breeding_loo.date | html %]</td> >+ <td>[% breeding_loo.edition | html %]</td> >+ <td>[% breeding_loo.isbn | html %]</td> >+ <td>[% breeding_loo.lccn | html %]</td> >+ <td><a href="/cgi-bin/koha/opac-showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td> >+ <td><a href="/cgi-bin/koha/opac-showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid | uri %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> >+ <td><a target="_blank" href="http://[% breeding_loo.opacurl | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber | uri %]">Show</a></td> > </tr> > [% END %] > [% END %]</tbody> >@@ -172,33 +173,33 @@ Koha › Z39.50/SRU search results > > <form method="post" action="opac-z3950-search.pl" id="page_form" name="page_form"> > <input type="hidden" name="op" id="op" value="do_search" /> >- <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" /> >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >- <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> >+ <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | uri %]" /> >+ <input type="hidden" name="frameworkcode" value="[% frameworkcode | uri %]" /> > [% FOREACH field IN search_fields %] >- <input type="hidden" name="[% field.prop %]" value="[% ${field.prop} %]" /> >+ <input type="hidden" name="[% field.prop | html %]" value="[% ${field.prop} | html %]" /> > [% END %] > > [% FOREACH server IN servers %] >- <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" /> >+ <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" /> > [% END %] > [% IF total_pages > 1 %] > <div class="row-fluid"> > <div class="span4"> > <div class="input-prepend input-append"> > [% IF ( show_prevbutton ) %] >- <button class="btn" type="button" name="changepage_prev" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();">Previous Page</button> >+ <button class="btn" type="button" name="changepage_prev" onclick="$('#current_page').val([% current_page | html %]-1);$('#page_form').submit();">Previous Page</button> > [% END %] >- <span class="add-on">Page [% current_page %] / [% total_pages %]</span> >+ <span class="add-on">Page [% current_page | html %] / [% total_pages | html %]</span> > [% IF ( show_nextbutton ) %] >- <button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();">Next Page</button> >+ <button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page | html %]+1);$('#page_form').submit();">Next Page</button> > [% END %] > </div> > </div> > <div class="span2 offset5"> > <div class="input-prepend input-append"> > <span class="add-on">Go to page</span> >- <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" type="text"/> >+ <input id="goto_page" name="goto_page" value="[% current_page | html %]" size="4" type="text"/> > <button class="btn" type="submit" name="changepage_goto" onclick="return validate_goto_page();">Go</button> > </div> > </div> >@@ -220,17 +221,16 @@ Koha › Z39.50/SRU search results > </div> > </div> > >-[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %] >+[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending | html %] servers to search</h3>[% END %] > > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %][% END %] > [% INCLUDE 'datatables.inc' %] >-<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > >-<script type="text/javascript"> >+<script> > //<![CDATA[ > function Import(GetThisOne,biblionumber) { >- opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne; >+ opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode | uri %]&breedingid="+GetThisOne; > window.close(); > return false; > } >@@ -292,8 +292,8 @@ function validate_goto_page(){ > alert(_("The page entered is not a number.")); > return false; > } >- else if(page < 1 || page > [% total_pages %] ) { >- alert(_("The page should be a number between 1 and %s.").format([% total_pages %])); >+ else if(page < 1 || page > [% total_pages | html %] ) { >+ alert(_("The page should be a number between 1 and %s.").format([% total_pages | html %])); > return false; > } > else { >diff --git a/opac/opac-z3950-search.pl b/opac/opac-z3950-search.pl >index ee3da2532f..01bfb4f3da 100755 >--- a/opac/opac-z3950-search.pl >+++ b/opac/opac-z3950-search.pl >@@ -5,18 +5,18 @@ > # > # This file is part of Koha. > # >-# Koha is free software; you can redistribute it and/or modify it under the >-# terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 2 of the License, or (at your option) any later >-# version. >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. > # >-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >-# You should have received a copy of the GNU General Public License along >-# with Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. > > use strict; > use warnings; >@@ -52,7 +52,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > template_name => "opac-z3950-search.tt", > query => $input, > type => "opac", >- authnotrequired => 1, >+ authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), > debug => 1, > }); > >-- >2.25.1
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 11361
:
23365
|
60950
|
60951
|
60952
|
72812
|
72813
|
95808
|
100077
|
100463
|
100470
|
113334
|
119535
| 119536 |
119928