Bugzilla – Attachment 14606 Details for
Bug 9395
Problem with callnumber and standard number search in OPAC and Staff Client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9395: Problem with callnumber and standard number search in OPAC and Staff Client
Bug-9395-Problem-with-callnumber-and-standard-numb.patch (text/plain), 10.46 KB, created by
Vitor Fernandes
on 2013-01-15 17:26:04 UTC
(
hide
)
Description:
Bug 9395: Problem with callnumber and standard number search in OPAC and Staff Client
Filename:
MIME Type:
Creator:
Vitor Fernandes
Created:
2013-01-15 17:26:04 UTC
Size:
10.46 KB
patch
obsolete
>From 74f37f189a3c6848940b0e2c27d4ba529fa8c9d7 Mon Sep 17 00:00:00 2001 >From: Vitor FERNANDES <vfernandes@keep.pt> >Date: Tue, 15 Jan 2013 17:19:59 +0000 >Subject: [PATCH] Bug 9395: Problem with callnumber and standard number search > in OPAC and Staff Client > >This problem happens because there isn't a operator "phr" in the values of callnumber and standard number search. So many results aren't the corrects ones. > >Test plan: > >- Apply the patch >- In the dropbox search menu of OPAC main page header, the callnum should have only callnum >- In OPAC advanced search the callnumber and standard number options shouldn't have "phr" >- In staff client advanced search the callnumber and standard number options shouldn't have "phr" >- Change OPACNumbersPreferPhrase and IntranetNumbersPreferPhrase to "use" >- The options listed before should use now the operator "phr" >- This will resolve the problems with the searches of callnumbers and standard numbers in OPAC and staff client (spaces problems, no results, inconsistent results, etc...) > >Sponsored-by: KEEP SOLUTIONS >--- > catalogue/search.pl | 3 +++ > installer/data/mysql/sysprefs.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > .../prog/en/includes/search_indexes.inc | 8 ++++++++ > .../en/modules/admin/preferences/searching.pref | 16 ++++++++++++++++ > koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 14 +++++++++++--- > .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 13 +++++++++++++ > opac/opac-main.pl | 4 ++++ > opac/opac-search.pl | 5 +++++ > 9 files changed, 70 insertions(+), 3 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index d1a3ca2..680f837 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -182,6 +182,9 @@ else { > if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { > $template->param('UNIMARC' => 1); > } >+if (C4::Context->preference("IntranetNumbersPreferPhrase")) { >+ $template->param('numbersphr' => 1); >+} > > if($cgi->cookie("holdfor")){ > my $holdfor_patron = GetMember('borrowernumber' => $cgi->cookie("holdfor")); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d5d15d7..7d3da4c 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -406,3 +406,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free'); >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACNumbersPreferPhrase','0', NULL, 'Controll the use of phr operator in callnumber and standard number OPAC searches', 'YesNo'); >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IntranetNumbersPreferPhrase','0', NULL, 'Controll the use of phr operator in callnumber and standard number staff client searches', 'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 77265f4..5fa900d 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6339,6 +6339,14 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACNumbersPreferPhrase','0', NULL, 'Controll the use of phr operator in callnumber and standard number OPAC searches', 'YesNo')"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IntranetNumbersPreferPhrase','0', NULL, 'Controll the use of phr operator in callnumber and standard number staff client searches', 'YesNo')"); >+ print "Upgrade to $DBversion done (Bug 9395: Problem with callnumber and standard number search in OPAC and Staff Client)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc >index 8102201..5cd1b88 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc >@@ -20,10 +20,18 @@ > [% END %] > <option value="bc">Barcode</option> > <option value="location">Shelving location</option> >+ [% IF (numbersphr) %] >+ <option value="sn,phr">Standard number</option> >+ [% ELSE %] > <option value="sn">Standard number</option> >+ [% END %] > <option value="nb"> ISBN</option> > <option value="ns"> ISSN</option> >+ [% IF (numbersphr) %] >+ <option value="callnum,phr"> Call number</option> >+ [% ELSE %] > <option value="callnum"> Call number</option> >+ [% END %] > <option value="ln,rtrn">Language</option> > <option value="nt">Notes/Comments</option> > [% IF (marcflavour != 'UNIMARC' ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index 7b99173..451cbc9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -79,6 +79,22 @@ Searching: > yes: show > no: "don't show" > - '"More options" on the OPAC and staff advanced search pages.' >+ - >+ - By default, >+ - pref: OPACNumbersPreferPhrase >+ type: boolean >+ choices: >+ yes: use >+ no: "don't use" >+ - 'the operator "phr" in the callnumber and standard number OPAC searches' >+ - >+ - By default, >+ - pref: IntranetNumbersPreferPhrase >+ type: boolean >+ choices: >+ yes: use >+ no: "don't use" >+ - 'the operator "phr" in the callnumber and standard number staff client searches' > Results Display: > - > - By default, sort search results in the staff client by >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >index a82dc42..de2d2da 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >@@ -66,11 +66,19 @@ > [% ELSE %] > <option value="se">Series</option> > [% END %] >- [% IF ( ms_callnum ) %] >+ [% IF ( numbersphr ) %] >+ [% IF ( ms_callnum ) %] >+ <option selected="selected" value="callnum,phr">Call number</option> >+ [% ELSE %] >+ <option value="callnum,phr">Call number</option> >+ [% END %] >+ [% ELSE %] >+ [% IF ( ms_callnum ) %] > <option selected="selected" value="callnum">Call number</option> >- [% ELSE %] >+ [% ELSE %] > <option value="callnum">Call number</option> >- [% END %]</select> >+ [% END %] >+ [% END %]</select> > [% IF ( ms_value ) %] > <input type="text" title="Type search term" id = "transl1" name="q" value="[% ms_value |html %]" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div> > [% ELSE %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >index e08fff2..4457681 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >@@ -77,7 +77,11 @@ > [% IF ( expanded_options ) %] > <option value="ti,phr"> Title phrase</option> > <option value="se,wrdl">Series title</option> >+ [% IF ( numbersphr) %] >+ <option value="callnum,phr">Call number</option> >+ [% ELSE %] > <option value="callnum">Call number</option> >+ [% END %] > <option value="location">Shelving location</option> > [% END %] > <option value="au,wrdl">Author</option> >@@ -99,10 +103,19 @@ > <option value="pb,wrdl">Publisher</option> > <option value="pl,wrdl">Publisher location</option> > [% IF ( expanded_options ) %] >+ [% IF ( numbersphr) %] >+ <option value="sn,phr">Standard number</option> >+ [% ELSE %] >+ <option value="sn">Standard number</option> >+ [% END %] > <option value="sn">Standard number</option> > <option value="nb"> ISBN</option> > <option value="ns"> ISSN</option> >+ [% IF ( numbersphr) %] > <option value="lcn,phr"> Call number</option> >+ [% ELSE %] >+ <option value="lcn"> Call number</option> >+ [% END %] > [% ELSE %] > <option value="nb">ISBN</option> > [% END %] >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index c716c60..7c6ee36 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -65,4 +65,8 @@ if (C4::Context->preference('GoogleIndicTransliteration')) { > $template->param('GoogleIndicTransliteration' => 1); > } > >+if (C4::Context->preference('OPACNumbersPreferPhrase')) { >+ $template->param('numbersphr' => 1); >+} >+ > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 9708176..b08485a 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -293,6 +293,11 @@ if ( $template_type && $template_type eq 'advsearch' ) { > $template->param( expanded_options => $cgi->param('expanded_options')); > } > } >+ >+ if (C4::Context->preference('OPACNumbersPreferPhrase')) { >+ $template->param('numbersphr' => 1); >+ } >+ > output_html_with_http_headers $cgi, $cookie, $template->output; > exit; > } >-- >1.7.9.5
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 9395
:
14606
|
15063
|
15217