[Koha-patches] [PATCH] Patch of Lexile Search box on Opac advance search page

LAURENT Henri-Damien henridamien.laurent at biblibre.com
Wed Jan 20 12:44:35 CET 2010


Hi
why not taking the same conventions as pubdate for range searching ?
i.e.
have a lex index in ccl.properties
lex 1=lex 4=109 r=r
and then you don't have to write st-numeric and you can search a range with
123-1313
would that be better ?
-- 
Henri-Damien LAURENT
Amit Gupta a écrit :
> ---
>  .../opac-tmpl/prog/en/modules/opac-advsearch.tmpl  |   11 +++++++
>  opac/opac-search.pl                                |   30 ++++++++++++++++++++
>  2 files changed, 41 insertions(+), 0 deletions(-)
>
> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl
> index d12fd73..d3ec074 100644
> --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl
> +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl
> @@ -104,6 +104,17 @@
>  
>      </fieldset></div>
>      </div>
> +
> +<!-- Lexile Search Box start-->
> +<fieldset>
> +<legend>Limit by: </legend>
> +<p><label for="lex">Lexile Number:</label>
> +<input size="8" name="lex" id="" value=""/>
> +<label for="lex1">To</label>
> +<input size="8" name="lex1" id="" value=""/>
> +</p>
> +<!--Lexile Search Box End-->
> +</fieldset>
>  <div id="pubrange" class="container">
>  <fieldset>
>  <!-- PUB RANGE OPTION -->
> diff --git a/opac/opac-search.pl b/opac/opac-search.pl
> index 344f168..9025b9d 100755
> --- a/opac/opac-search.pl
> +++ b/opac/opac-search.pl
> @@ -52,6 +52,11 @@ elsif ($build_grouped_results) {
>  elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) {
>  	$template_name = 'opac-results.tmpl';
>  }
> +##For Lexile Search Box##
> +elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('lex')) || ($cgi->param('lex1')) ) {
> +        $template_name = 'opac-results.tmpl';
> +}
> +
>  else {
>      $template_name = 'opac-advsearch.tmpl';
>      $template_type = 'advsearch';
> @@ -321,6 +326,31 @@ if ($params->{'limit-yr'}) {
>          #FIXME: Should return a error to the user, incorect date format specified
>      }
>  }
> +##Lexile Search Box##
> +my $lex;
> +my $lex_level;
> +if ($params->{'lex'} and $params->{'lex1'}){
> +#   if(($params->{'lex'} = ~/\d/ and $params->{'lex1'}= ~/\d/))
> +{
> +    my ($a1) = $params->{'lex'};
> +    my ($a2) = $params->{'lex1'};
> +    $lex = "lex,st-numeric,ge=$a1 and lex,st-numeric,le=$a2";
> +    $lex_level= "$a1-$a2";
> +    }
> +    push @limits,$lex;
> +}
> +elsif ($params->{'lex'} =~ /\d/) {
> +        $lex = "lex,st-numeric,ge=$params->{'lex'}";
> +        $lex_level = $params->{'lex'};
> +
> +  push @limits,$lex;
> +    
> +}
> + elsif ($params->{'lex1'} =~ /\d/) {
> +        $lex = "lex,st-numeric,le=$params->{'lex1'}";
> +        $lex_level = $params->{'lex1'};
> +  push @limits,$lex;
> +}
>  
>  # Params that can only have one value
>  my $scan = $params->{'scan'};
>   




More information about the Koha-patches mailing list