From a826e39f3e3eacf0955cbb4e0ae126c93323358a Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Fri, 30 Aug 2013 10:54:00 +0200 Subject: [PATCH 1/2] Bug 10808 - Thesaurus search form does not correspond to current search query When cataloging a field defined with a thesaurus, an authority search popup is displayed with a search from. Once operators, values and sort selected in this form the search can be performed. The bug is that the values entered are kept but not the selected operators and sort. The same bug was existing in authorities module, solved by Bug 8692. This patch corrects the bug. Also uses in 'sort by' options the same text as search in authorities module : Heading A-Z (default), Heading Z-A, None. Also removes duplicated code in auth_finder.pl : value_mainstr => $query->param('value_mainstr') || "", ... Test plan : - Create a new biblio with a framework containing a field linked to a thesaurus. For example : 600 - Click on small icon of main entry. For example : 600$a => You get a search form with all operators to "contains" and sort by "Heading A-Z" - Enter a value in each text box and perform search => You get a search form with values in text boxes and all operators to "contains" - Select "starts with" in all operator comboboxes and perform search => You get a search form with all operators to "starts with" - Select "is exactly" in all operator comboboxes and perform search => You get a search form with all operators to "is exactly" - Select "Heading Z-A" in sort by and perform search => You get a search form with "Heading Z-A" in sort by - Select "None" in sort by and perform search => You get a search form with "None" in sort by --- authorities/auth_finder.pl | 10 +-- .../prog/en/includes/auth-finder-search.inc | 66 +++++++++++++++++++- 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index 8182299..09e8d45 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -160,11 +160,10 @@ if ( $op eq "do_search" ) { from => $from, to => $to, numbers => \@numbers, - authtypecode => $authtypecode, - value_mainstr => $query->param('value_mainstr') || "", - value_main => $query->param('value_main') || "", - value_any => $query->param('value_any') || "", - value_match => $query->param('value_match') || "", + operator_mainstr => ( @operator > 0 && $operator[0] ) ? $operator[0] : '', + operator_main => ( @operator > 1 && $operator[1] ) ? $operator[1] : '', + operator_any => ( @operator > 2 && $operator[2] ) ? $operator[2] : '', + operator_match => ( @operator > 3 && $operator[3] ) ? $operator[3] : '', ); } else { ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -183,6 +182,7 @@ if ( $op eq "do_search" ) { } $template->param( + op => $op, value_mainstr => $query->param('value_mainstr') || "", value_main => $query->param('value_main') || "", value_any => $query->param('value_any') || "", diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc index d54cf64..12a882e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc @@ -123,9 +123,21 @@ function finderjumpfull(page)
@@ -137,9 +149,21 @@ function finderjumpfull(page)
@@ -151,9 +175,21 @@ function finderjumpfull(page)
@@ -164,18 +200,42 @@ function finderjumpfull(page)
  • [% IF source == 'auth' %] -- 1.7.10.4