@@ -, +, @@ --- catalogue/search.pl | 8 + .../intranet-tmpl/prog/en/includes/cat-search.inc | 2 +- .../prog/en/includes/search_indexes.inc | 203 +++++++++++++++++---- 3 files changed, 179 insertions(+), 34 deletions(-) --- a/catalogue/search.pl +++ a/catalogue/search.pl @@ -385,12 +385,20 @@ my @indexes = map uri_unescape($_), $cgi->multi_param('idx'); if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) { my $idx = "ms_".$indexes[0]; $idx =~ s/\,/comma/g; # template toolkit doesn't like variables with a , in it + $idx =~ s/-/dash/g; # template toolkit doesn't like variables with a dash in it $template->param($idx => 1); } # an operand can be a single term, a phrase, or a complete ccl query my @operands = map uri_unescape($_), $cgi->multi_param('q'); +# if a simple search, display the value in the search box +if ($operands[0] && !$operands[1]) { + my $ms_query = $operands[0]; + $ms_query =~ s/ #\S+//; + $template->param(ms_value => $ms_query); +} + # limits are use to limit to results to a pre-defined category such as branch or language my @limits = map uri_unescape($_), $cgi->multi_param('limit'); my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit'); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc @@ -28,7 +28,7 @@

Enter search keywords:

[% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %][% INCLUDE 'search_indexes.inc' %][% END %] - +
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc @@ -1,46 +1,175 @@ [% USE Koha %] --