From 8a35e8dcd8eb189b22f761a69344a27c83fa54b9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 22 Jun 2021 19:09:23 +0000 Subject: [PATCH] Bug 28175: (follow-up) Preselect correct category after search This patch modifies the script and template so that if the user submits a search by category, that category will be preselected on the search results page. Also added is an empty "Choose" option so that a search category isn't selected by default. To test, apply the patch and view the uploads page. - In the category search form, a "Choose" option should be selected. Submitting the form without selecting a category should not work. - Search using one of your existing categories. On the search results page the category you selected should remain selected. --- .../intranet-tmpl/prog/en/modules/tools/upload.tt | 13 +++++++++---- tools/upload.pl | 7 ++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt index c907fdf007..03f1f567a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -120,10 +120,15 @@
  1. - + + [% FOREACH cat IN uploadcategories %] + [% IF cat.code == browsecategory %] + + [% ELSE -%] + + [% END %] + [% END %]
diff --git a/tools/upload.pl b/tools/upload.pl index cf9a2c6053..c01d57f925 100755 --- a/tools/upload.pl +++ b/tools/upload.pl @@ -69,9 +69,10 @@ if ( $op eq 'new' ) { } $template->param( - mode => 'report', - msg => $msg, - uploads => $uploads, + mode => 'report', + msg => $msg, + uploads => $uploads, + browsecategory => $browsecategory, ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.20.1