From 935a9a6a7e7301f885e7a7ce42482264616c468f Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Fri, 30 Aug 2013 10:54:00 +0200 Subject: [PATCH] Bug 10808: make authority search form retain drop-down selections 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 Signed-off-by: Bernardo Gonzalez Kriegel Comment: With both patches applied no koha-qa errors Test 1) Original behavior is whatever selection you do before patch, search form returns to default options 2) After patch, selection remains Signed-off-by: Katrin Fischer All tests and QA script pass, further comments on second patch. Signed-off-by: Galen Charlton (cherry picked from commit 857547c992ea2b548712583d09602eda3787556c) Signed-off-by: Fridolin SOMERS (cherry picked from commit 9959fca67510356ab9d7acd128c453d6008a2b73) Signed-off-by: Tomas Cohen Arazi --- 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 8182299685..09e8d455fb 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 d54cf648d1..12a882ed78 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' %] -- 2.39.5