searchdesc improvements, more opac fixes

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joshua Ferraro 2007-11-24 16:29:02 -06:00
parent ecea83bae2
commit 7b4c5fd8e0
4 changed files with 24 additions and 14 deletions

View file

@ -877,11 +877,11 @@ sub buildQuery {
$_ =~ s/ / /g; # remove extra spaces $_ =~ s/ / /g; # remove extra spaces
$_ =~ s/^ //g; # remove any beginning spaces $_ =~ s/^ //g; # remove any beginning spaces
$_ =~ s/ $//g; # remove any ending spaces $_ =~ s/ $//g; # remove any ending spaces
$_ =~ s/:/=/g; # causes probs for server
$_ =~ s/==/=/g; # remove double == from query $_ =~ s/==/=/g; # remove double == from query
} }
$query =~ s/:/=/g;
$limit =~ s/:/=/g;
$query_cgi =~ s/^&//; $query_cgi =~ s/^&//;
# append the limit to the query # append the limit to the query

View file

@ -10,18 +10,18 @@
<div id="opac-main-search"> <div id="opac-main-search">
<form name="searchform" method="post" action="/cgi-bin/koha/opac-search.pl" id="searchform"> <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
<label for="masthead_search"> Search <!-- TMPL_IF name="mylibraryfirst" --> <!-- TMPL_IF name="loggedinusername" -->(in <!-- TMPL_VAR name="LoginBranchcode" --> only)<!-- /TMPL_IF --><!-- /TMPL_IF --></label> <label for="masthead_search"> Search <!-- TMPL_IF name="mylibraryfirst" --> <!-- TMPL_IF name="loggedinusername" -->(in <!-- TMPL_VAR name="LoginBranchcode" --> only)<!-- /TMPL_IF --><!-- /TMPL_IF --></label>
<select name="idx" id="masthead_search"> <select name="idx" id="masthead_search">
<option selected="selected" value="">Library Catalog</option> <option <!-- TMPL_IF NAME="kw" -->selected="selected"<!-- /TMPL_IF --> value="">Library Catalog</option>
<option value="ti">Title</option> <option <!-- TMPL_IF NAME="ti" -->selected="selected"<!-- /TMPL_IF --> value="ti">Title</option>
<option value="au">Author</option> <option <!-- TMPL_IF NAME="au" -->selected="selected"<!-- /TMPL_IF --> value="au">Author</option>
<option value="su">Subject</option> <option <!-- TMPL_IF NAME="su" -->selected="selected"<!-- /TMPL_IF --> value="su">Subject</option>
<option value="isbn">ISBN</option> <option <!-- TMPL_IF NAME="isbn" -->selected="selected"<!-- /TMPL_IF --> value="isbn">ISBN</option>
<option value="se">Series</option> <option <!-- TMPL_IF NAME="se" -->selected="selected"<!-- /TMPL_IF --> value="se">Series</option>
<option value="callnum">Call Number</option> <option <!-- TMPL_IF NAME="callnum" -->selected="selected"<!-- /TMPL_IF --> value="callnum">Call Number</option>
</select> </select>
<input type="text" name="q" style="width: 30%;" /> <input type="text" name="q" <!-- TMPL_IF NAME="ms_value" -->value="<!-- TMPL_VAR NAME="ms_value" -->" <!-- /TMPL_IF --> style="width: 30%;" />
<!-- TMPL_IF name="mylibraryfirst" --><!-- TMPL_IF name="loggedinusername" --> <!-- TMPL_IF name="mylibraryfirst" --><!-- TMPL_IF name="loggedinusername" -->
<input name="limit" value="<!-- TMPL_VAR name="LoginBranchcode" -->" type="hidden" /> <input name="limit" value="<!-- TMPL_VAR name="LoginBranchcode" -->" type="hidden" />
<!-- /TMPL_IF --><!-- /TMPL_IF --> <!-- /TMPL_IF --><!-- /TMPL_IF -->
@ -36,6 +36,7 @@
</ul></div><!-- /TMPL_IF --></div> </ul></div><!-- /TMPL_IF --></div>
<div id="breadcrumbs" class="yui-g"> <div id="breadcrumbs" class="yui-g">
<!-- TMPL_IF NAME="searchdesc" --><p><!-- TMPL_IF name="total" --><strong>&ldquo;<!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->&rdquo; </strong>returned <!-- TMPL_VAR NAME="total" --> results. <!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --><!-- TMPL_IF NAME="related" --> (related searches: <!-- TMPL_LOOP NAME="related" --><!-- TMPL_VAR NAME="related_search" --><!-- /TMPL_LOOP -->). <!-- /TMPL_IF --> <!-- TMPL_IF NAME="searchdesc" --><p><!-- TMPL_IF name="total" --><strong>&ldquo;<!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->&rdquo; </strong>returned <!-- TMPL_VAR NAME="total" --> results. <!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --><!-- TMPL_IF NAME="related" --> (related searches: <!-- TMPL_LOOP NAME="related" --><!-- TMPL_VAR NAME="related_search" --><!-- /TMPL_LOOP -->). <!-- /TMPL_IF -->
<a href="/cgi-bin/koha/opensearch?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&count=10&amp;startPage=1"><img title="RSS Feed for search <!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->" alt="RSS Feed for search <!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->" src="<!-- TMPL_VAR NAME="themelang" -->/../images/feed-icon-16x16.png" border="0" /></a> <a href="/cgi-bin/koha/opensearch?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&count=10&amp;startPage=1"><img title="RSS Feed for search <!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->" alt="RSS Feed for search <!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->" src="<!-- TMPL_VAR NAME="themelang" -->/../images/feed-icon-16x16.png" border="0" /></a>
@ -43,7 +44,7 @@
<!-- TMPL_IF NAME="searchdesc" --> <!-- TMPL_IF NAME="searchdesc" -->
<strong>No Result found !</strong> <strong>No Result found !</strong>
<p> <p>
No results match your search for <span style="font-weight: bold;">&ldquo;<!-- TMPL_VAR NAME="searchdesc" -->&rdquo;</span> in <!-- TMPL_VAR NAME="LibraryName" --> Catalog. No results match your search for <span style="font-weight: bold;">&ldquo;<!-- TMPL_VAR NAME="query_desc" --><!-- TMPL_VAR NAME="limit_desc" -->&rdquo;</span> in <!-- TMPL_VAR NAME="LibraryName" --> Catalog.
</p> </p>
<!-- TMPL_ELSE --> <!-- TMPL_ELSE -->
<strong> No result found !</strong> <strong> No result found !</strong>

View file

@ -39,7 +39,7 @@
<!-- TMPL_IF NAME="total" --> <!-- TMPL_IF NAME="total" -->
<!-- TMPL_IF NAME="scan" --> <!-- TMPL_IF NAME="scan" -->
<h1>Scan Index:</h1> <h1>Scan Index:</h1>
<form action="/cgi-bin/koha/opac-search.pl" method="post"> <form action="/cgi-bin/koha/opac-search.pl" method="get">
<table> <table>
<tr> <tr>
<td> <td>
@ -70,7 +70,7 @@
</table> </table>
</form> </form>
<form action="/cgi-bin/koha/opac-search.pl" method="post"> <form action="/cgi-bin/koha/opac-search.pl" method="get">
<table> <table>
<tr> <tr>
<th>Term/Phrase</th> <th>Term/Phrase</th>

View file

@ -361,10 +361,19 @@ my @operators;
my @indexes; my @indexes;
@indexes = split("\0",$params->{'idx'}); @indexes = split("\0",$params->{'idx'});
# if a simple index (only one) display the index used in the top search box
if (@indexes[0] && !@indexes[1]) {
$template->param(@indexes[0] => 1);
}
# an operand can be a single term, a phrase, or a complete ccl query # an operand can be a single term, a phrase, or a complete ccl query
my @operands; my @operands;
@operands = split("\0",$params->{'q'}) if $params->{'q'}; @operands = split("\0",$params->{'q'}) if $params->{'q'};
# if a simple search, display the value in the search box
if (@operands[0] && !@operands[1]) {
$template->param(ms_value => @operands[0]);
}
# limits are use to limit to results to a pre-defined category such as branch or language # limits are use to limit to results to a pre-defined category such as branch or language
my @limits; my @limits;
@limits = split("\0",$params->{'limit'}) if $params->{'limit'}; @limits = split("\0",$params->{'limit'}) if $params->{'limit'};