From c6b086c16504f9839d9d958495933494336ec99d Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Fri, 5 Oct 2007 16:37:43 -0500 Subject: [PATCH] 1409 empty search term in subscription search biblio + removing some useless code Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .../serials/subscription-bib-search.tmpl | 4 ++- serials/subscription-bib-search.pl | 32 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl index e1d6a2df6e..548ef9b815 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl @@ -9,7 +9,9 @@

Catalogue search

- + +
You must enter a term to search on
+
diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index 6f28c43865..bda92dde0d 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -67,8 +67,9 @@ $startfrom=0 unless $startfrom; my ($template, $loggedinuser, $cookie); my $resultsperpage; -if ($op eq "do_search") { - my $query = $input->param('q'); +my $query = $input->param('q'); +# don't run the search if no search term ! +if ($op eq "do_search" && $query) { $resultsperpage= $input->param('resultsperpage'); $resultsperpage = 19 if(!defined $resultsperpage); @@ -161,7 +162,18 @@ if ($op eq "do_search") { to=>$to, numbers=>\@numbers, ); -} # end of if ($op eq "do_search") +} # end of if ($op eq "do_search" & $query) + elsif ($op eq "do_search") { + ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "serials/subscription-bib-search.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {catalogue => 1, serials=>1}, + debug => 1, + }); + $template->param("no_query" => 1); +} else { ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "serials/subscription-bib-search.tmpl", @@ -172,19 +184,7 @@ if ($op eq "do_search") { debug => 1, }); - my %itemtypes = GetItemTypes(); - my @values = values %itemtypes; - my $CGIitemtype=CGI::scrolling_list( - -name => 'value', - -values => \@values, - -labels => \%itemtypes, - -size => 1, - -multiple => 0 - ); - - $template->param( - CGIitemtype => $CGIitemtype, - ); + $template->param("no_query" => 0); } # Print the page -- 2.39.5