$query_cgi =~ s/^&//;
# append the limit to the query
- $query ? $query .= " ".$limit : $query = $limit;
+ if ($query) {
+ $query .=" ".$limit;
+ }
+ else {
+ $query = $limit;
+ }
+
warn "query=$query and limit=$limit" if $DEBUG;
warn "QUERY:".$query if $DEBUG;
# building the HTML output for the template
sub searchResults {
my ( $searchdesc, $hits, $results_per_page, $offset, @marcresults ) = @_;
-
my $dbh = C4::Context->dbh;
my $toggle;
my $even = 1;
$span_terms_hashref->{$span_term}++;
}
- #Build brancnames hash
+ #Build branchnames hash
#find branchname
#get branch information.....
my %branches;
}
#search item field code
- my $sth =
- $dbh->prepare(
-"select tagfield from marc_subfield_structure where kohafield like 'items.itemnumber'"
- );
+ my $sth = $dbh->prepare("SELECT tagfield FROM marc_subfield_structure WHERE kohafield LIKE 'items.itemnumber'");
$sth->execute;
my ($itemtag) = $sth->fetchrow;
## find column names of items related to MARC
- my $sth2 = $dbh->prepare("SHOW COLUMNS from items");
+ my $sth2 = $dbh->prepare("SHOW COLUMNS FROM items");
$sth2->execute;
my %subfieldstosearch;
while ( ( my $column ) = $sth2->fetchrow ) {
</td>
<td style="white-space : nowrap"><div class="availability">
- <div>
- <!-- TMPL_IF NAME="items_count" --><!-- TMPL_VAR NAME="items_count" --><!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="items_count" --><div><!-- TMPL_VAR NAME="items_count" -->
<!-- TMPL_IF NAME="itemsplural" -->items<!-- TMPL_ELSE -->item<!-- /TMPL_IF --></div>
<!-- TMPL_IF NAME="available_items_loop" -->
(<!-- TMPL_VAR NAME="count" -->)</li>
<!-- /TMPL_LOOP --></ul>
<!-- /TMPL_IF -->
+ <!-- TMPL_ELSE -->
+ <span class="unavailable">No items</span>
+ <!-- /TMPL_IF --> <!-- /items count -->
</div></td>
</tr>