fixes to search results list, ccl.properties tweak

patch updateitem.pl (was failing ... missing 'my')
update OPAC results
fix limit by availability

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joshua Ferraro 2007-12-20 17:33:07 -06:00
parent 9427dbc754
commit 3edaba0cc0
8 changed files with 202 additions and 110 deletions

View File

@ -881,12 +881,14 @@ sub buildQuery {
warn "QUERY BEFORE LIMITS: >$query<" if $DEBUG;
# add limits
$DEBUG=1;
my $group_OR_limits;
my $availability_limit;
foreach my $this_limit (@limits) {
if ( $this_limit =~ /available/ ) {
# available is defined as (items.notloan is NULL) and (items.itemlost > 0 or NULL) (last clause handles NULL values for lost in zebra)
$availability_limit .="( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and ((lost,st-numeric ge 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )";
# all records not indexed in the onloan register and allrecords not indexed in the lost register, or where the value of lost is equal to or less than 0
$availability_limit .="( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and ((lost,st-numeric <= 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )";
$limit_cgi .= "&limit=available";
$limit_desc .="";
}
@ -912,8 +914,8 @@ sub buildQuery {
$limit.="($group_OR_limits)";
}
if ($availability_limit) {
$limit.=" not " if ($query || $limit );
$limit.="$availability_limit";
$limit.=" and " if ($query || $limit );
$limit.="($availability_limit)";
}
# normalize the strings
$query =~ s/:/=/g;
@ -966,6 +968,12 @@ sub searchResults {
while ( my $bdata = $bsth->fetchrow_hashref ) {
$branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'};
}
my %locations;
my $lsch = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category = 'SHELF_LOC'");
$lsch->execute();
while (my $ldata = $lsch->fetchrow_hashref ) {
$locations{ $ldata->{'authorised_value'} } = $ldata->{'lib'};
}
#Build itemtype hash
#find itemtype & itemtype image
@ -1092,94 +1100,131 @@ sub searchResults {
}
$oldbiblio->{'toggle'} = $toggle;
my @fields = $marcrecord->field($itemtag);
my @items_loop;
my $items;
# Setting item statuses for display
my @available_items_loop;
my @onloan_items_loop;
my @other_items_loop;
my $available_items;
my $onloan_items;
my $other_items;
my $ordered_count = 0;
my $available_count = 0;
my $onloan_count = 0;
my $longoverdue_count = 0;
my $other_count = 0;
my $wthdrawn_count = 0;
my $itemlost_count = 0;
my $norequests = 1;
#
# check the loan status of the item :
# it is not stored in the MARC record, for pref (zebra reindexing)
# reason. Thus, we have to get the status from a specific SQL query
#
my $sth_issue = $dbh->prepare("
SELECT date_due,returndate
FROM issues
WHERE itemnumber=? AND returndate IS NULL");
my $itembinding_count = 0;
my $itemdamaged_count = 0;
my $can_place_holds = 0;
my $items_count=scalar(@fields);
my $items_counter;
my $maxitems = (C4::Context->preference('maxItemsinSearchResults')) ? C4::Context->preference('maxItemsinSearchResults')- 1 : 1;
foreach my $field (@fields) {
my $item;
$items_counter++;
# populate the items hash
foreach my $code ( keys %subfieldstosearch ) {
$item->{$code} = $field->subfield( $subfieldstosearch{$code} );
}
$sth_issue->execute($item->{itemnumber});
$item->{due_date} = format_date($sth_issue->fetchrow) if $sth_issue->fetchrow;
$item->{onloan} = 1 if $item->{due_date};
# at least one item can be reserved : suppose no
$norequests = 1;
if ( $item->{wthdrawn} ) {
$wthdrawn_count++;
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{unavailable}=1;
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{wthdrawn}=1;
}
elsif ( $item->{itemlost} ) {
$itemlost_count++;
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{unavailable}=1;
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{itemlost}=1;
}
unless ( $item->{notforloan}) {
# OK, this one can be issued, so at least one can be reserved
$norequests = 0;
}
if ( ( $item->{onloan} ) && ( $item->{onloan} != '0000-00-00' ) )
{
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{unavailable}=1;
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{onloancount} = 1;
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{due_date} = $item->{due_date};
$onloan_count++;
}
if ( $item->{'homebranch'} ) {
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{count}++;
}
# set item's branch name, use homebranch first, fall back to holdingbranch
if ($item->{'homebranch'}) {
$item->{'branchname'} = $branches{$item->{homebranch}};
}
# Last resort
elsif ( $item->{'holdingbranch'} ) {
$items->{ $item->{'holdingbranch'} }->{count}++;
elsif ($item->{'holdingbranch'}) {
$item->{'branchname'} = $branches{$item->{holdingbranch}};
}
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{itemcallnumber} = $item->{itemcallnumber};
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{location} = $item->{location};
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{branchcode} = $item->{homebranch};
} # notforloan, item level and biblioitem level
# key for items results is built from branchcode . coded location qualifier . itemcallnumber
if ($item->{onloan}) {
$onloan_count++;
$onloan_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{due_date} }->{due_date} = format_date($item->{onloan});
$onloan_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{due_date} }->{count}++ if $item->{'homebranch'};
$onloan_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{due_date} }->{branchname} = $item->{'branchname'};
$onloan_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{due_date} }->{location} = $locations{$item->{location}};
$onloan_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{due_date} }->{itemcallnumber} = $item->{itemcallnumber};
# last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
$norequests = 1 if $itemtypes{$oldbiblio->{itemtype}}->{notforloan};
my $itemscount;
for my $key ( sort keys %$items ) {
$itemscount++;
my $this_item = {
branchname => $branches{$items->{$key}->{branchcode}},
branchcode => $items->{$key}->{branchcode},
count => $items->{$key}->{count},
itemcallnumber => $items->{$key}->{itemcallnumber},
location => $items->{$key}->{location},
onloancount => $items->{$key}->{onloancount},
due_date => $items->{$key}->{due_date},
wthdrawn => $items->{$key}->{wthdrawn},
lost => $items->{$key}->{itemlost},
};
# only show the number specified by the user
my $maxitems = (C4::Context->preference('maxItemsinSearchResults')) ? C4::Context->preference('maxItemsinSearchResults')- 1 : 1;
push @items_loop, $this_item unless $itemscount > $maxitems;;
# if something's checked out and lost, mark it as 'long overdue'
if ( $item->{itemlost} ) {
$onloan_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{due_date} }->{longoverdue}++;
$longoverdue_count++;
}
# can place holds as long as this item isn't lost
else {
$can_place_holds = 1;
}
}
# items not on loan, but still unavailable ( lost, withdrawn, damaged )
else {
# item is on order
if ( $item->{notforloan} == -1) {
$ordered_count++;
}
# item is withdrawn, lost or damaged
if ( $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} ) {
$wthdrawn_count++ if $item->{wthdrawn};
$itemlost_count++ if $item->{itemlost};
$itemdamaged_count++ if $item->{damaged};
$item->{status} = $item->{wthdrawn}."-".$item->{itemlost}."-".$item->{damaged};
$other_count++;
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{wthdrawn} = $item->{wthdrawn};
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{itemlost} = $item->{itemlost};
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{damaged} = $item->{damaged};
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{count}++ if $item->{'homebranch'};
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{branchname} = $item->{'branchname'};
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{location} = $locations{$item->{location}};
$other_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'}.$item->{status} }->{itemcallnumber} = $item->{itemcallnumber};
}
# item is available
else {
$can_place_holds = 1;
$available_count++;
$available_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'} }->{count}++ if $item->{'homebranch'};
$available_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'} }->{branchname} = $item->{'branchname'};
$available_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'} }->{location} = $locations{$item->{location}};
$available_items->{ $item->{'homebranch'}.'--'.$item->{location}.$item->{'itemcallnumber'} }->{itemcallnumber} = $item->{itemcallnumber};
}
}
} # notforloan, item level and biblioitem level
my ($availableitemscount, $onloanitemscount, $otheritemscount);
my $maxitems = (C4::Context->preference('maxItemsinSearchResults')) ? C4::Context->preference('maxItemsinSearchResults')- 1 : 1;
for my $key ( sort keys %$onloan_items ) {
$onloanitemscount++;
push @onloan_items_loop, $onloan_items->{$key} unless $onloanitemscount > $maxitems;
}
$oldbiblio->{norequests} = $norequests;
for my $key ( sort keys %$other_items ) {
$otheritemscount++;
push @other_items_loop, $other_items->{$key} unless $otheritemscount > $maxitems;
}
for my $key ( sort keys %$available_items ) {
$availableitemscount++;
push @available_items_loop, $available_items->{$key} unless $availableitemscount > $maxitems;
}
# last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
$can_place_holds = 0 if $itemtypes{$oldbiblio->{itemtype}}->{notforloan};
$oldbiblio->{norequests} = 1 unless $can_place_holds;
$oldbiblio->{itemsplural} = 1 if $items_count>1;
$oldbiblio->{items_count} = $items_count;
$oldbiblio->{items_loop} = \@items_loop;
$oldbiblio->{available_items_loop} = \@available_items_loop;
$oldbiblio->{onloan_items_loop} = \@onloan_items_loop;
$oldbiblio->{other_items_loop} = \@other_items_loop;
$oldbiblio->{availablecount} = $available_count;
$oldbiblio->{availableplural} = 1 if $available_count>1;
$oldbiblio->{onloancount} = $onloan_count;
$oldbiblio->{onloanplural} = 1 if $onloan_count>1;
$oldbiblio->{othercount} = $other_count;
$oldbiblio->{otherplural} = 1 if $other_count>1;
$oldbiblio->{wthdrawncount} = $wthdrawn_count;
$oldbiblio->{itemlostcount} = $itemlost_count;
$oldbiblio->{damagedcount} = $itemdamaged_count;
$oldbiblio->{orderedcount} = $ordered_count;
$oldbiblio->{isbn} =~ s/-//g; # deleting - in isbn to enable amazon content
push( @newresults, $oldbiblio );

View File

@ -64,7 +64,7 @@ if ( $itemnotes ne $item_data_hashref->{'itemnotes'}) {
$newitemdata->{'itemnumber'} = $itemnumber;
# &C4::Biblio::_koha_modify_item($dbh,$newitemdata);
$sth = $dbh->prepare("UPDATE items SET wthdrawn=?,itemlost=?,damaged=?,itemnotes=? WHERE itemnumber=?");
my $sth = $dbh->prepare("UPDATE items SET wthdrawn=?,itemlost=?,damaged=?,itemnotes=? WHERE itemnumber=?");
$sth->execute($wthdrawn,$itemlost,$damaged,$itemnotes,$itemnumber);
&ModZebra($biblionumber,"specialUpdate","biblioserver");

View File

@ -859,7 +859,8 @@ st-free-form-text 4=105
st-document-text 4=106
st-local-number 4=107
st-string 4=108
st-numeric 4=109
# http://indexdata.dk/yaz/doc/tools.tkl#ccl.special.attribute.combos
st-numeric 4=109 r=o
#string 109
### 5. BIB1 TRUNCATION ATTRIBUTES

View File

@ -3,14 +3,12 @@
<div id="search-facets">
<h4>Refine your search</h4>
<ul>
<li>Availability<ul>
<li><!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="related" --> <li>(related searches: <!-- TMPL_LOOP NAME="related" --><!-- TMPL_VAR NAME="related_search" --><!-- /TMPL_LOOP -->)</li><!-- /TMPL_IF -->.
</li></ul>
<li>Availability<ul><li><!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --></li></ul>
<!-- TMPL_IF NAME="related" --> <li>(related searches: <!-- TMPL_LOOP NAME="related" --><!-- TMPL_VAR NAME="related_search" --><!-- /TMPL_LOOP -->)</li><!-- /TMPL_IF -->
</li>
<!-- TMPL_LOOP NAME="facets_loop" -->
<li id="<!-- TMPL_VAR NAME="type_id" -->"><!-- TMPL_VAR NAME="type_label" --><ul>
<!-- TMPL_LOOP NAME="facets_loop" -->
<li id="<!-- TMPL_VAR NAME="type_id" -->"><!-- TMPL_VAR NAME="type_label" --><ul>
<!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- (<!-- TMPL_VAR NAME="facet_count" -->) --></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
<li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" -->&amp;expand=<!-- TMPL_VAR NAME="expand" -->#<!-- TMPL_VAR NAME="type_id" -->">Show More</a></li>
<!-- /TMPL_IF -->

View File

@ -1,23 +1,27 @@
<option value="relevance">Relevance</option>
<optgroup label="Popularity">
<option value="popularity_dsc" <!-- TMPL_IF NAME="popularity_dsc" -->selected="selected" <!-- /TMPL_IF -->>Popularity (Most to Least)</option>
<option value="popularity_asc" <!-- TMPL_IF NAME="popularity_asc" -->selected="selected" <!-- /TMPL_IF -->>Popularity (Least to Most)</option>
</optgroup>
<optgroup label="Author">
<option value="author_az" <!-- TMPL_IF NAME="author_az" -->selected="selected" <!-- /TMPL_IF -->>Author (A-Z)</option>
<option value="author_za" <!-- TMPL_IF NAME="author_za" -->selected="selected" <!-- /TMPL_IF -->>Author (Z-A)</option>
</optgroup>
<optgroup label="Call Number">
<option value="call_number_asc" <!-- TMPL_IF NAME="call_number_asc" -->selected="selected" <!-- /TMPL_IF -->>Call Number (Non-fiction 0-9 to Fiction A-Z)</option>
<option value="call_number_dsc" <!-- TMPL_IF NAME="call_number_dsc" -->selected="selected" <!-- /TMPL_IF -->>Call Number (Fiction Z-A to Non-fiction 9-0)</option>
</option>
</optgroup>
<optgroup label="Dates">
<option value="pubdate_dsc" <!-- TMPL_IF NAME="pubdate_dsc" -->selected="selected" <!-- /TMPL_IF -->>Publication/Copyright Date: Newest to Oldest</option>
<option value="pubdate_asc" <!-- TMPL_IF NAME="pubdate_asc" -->selected="selected" <!-- /TMPL_IF -->>Publication/Copyright Date: Oldest to Newest</option>
<option value="acqdate_dsc" <!-- TMPL_IF NAME="acqdate_dsc" -->selected="selected" <!-- /TMPL_IF -->>Acquisition Date: Newest to Oldest</option>
<option value="acqdate_asc" <!-- TMPL_IF NAME="acqdate_dsc" -->selected="selected" <!-- /TMPL_IF -->>Acquisition Date: Oldest to Newest</option>
</optgroup>
<optgroup label="Title">
<option value="title_az" <!-- TMPL_IF NAME="title_az" -->selected="selected" <!-- /TMPL_IF -->>Title (A-Z)</option>
<option value="title_za" <!-- TMPL_IF NAME="title_za" -->selected="selected" <!-- /TMPL_IF -->>Title (Z-A)</option>

View File

@ -274,7 +274,7 @@ $(window).load(function() {
<p><!-- TMPL_VAR name="summary" --></p>
<!-- TMPL_ELSE -->
<p> <!-- TMPL_IF name="imageurl" -->
<img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" style="float: left; margin: .1em;" />
<img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" style="float: left; margin: .1em;" alt="img" />
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="author" -->
<a href="/cgi-bin/koha/catalogue/search.pl?q=au:<!-- TMPL_VAR NAME="author_nospan" ESCAPE="URL" -->" title="Search for this Author"><!-- TMPL_VAR NAME="author" --></a>
@ -289,6 +289,7 @@ $(window).load(function() {
<!-- TMPL_IF name="size" --> ; <!-- TMPL_VAR name="size" --><!-- /TMPL_IF -->
<!-- TMPL_VAR name="description" -->
<!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF -->
<!-- TMPL_IF name="cn_class" -->[<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="cn_class" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="cn_class" --></a>]<!-- /TMPL_IF -->
</p>
<p><!-- TMPL_VAR NAME="searchhighlightblob" --></p>
<!-- /TMPL_IF -->
@ -298,19 +299,53 @@ $(window).load(function() {
<a class="reserve" href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Holds</a>
<!-- /TMPL_IF -->
</td>
<td style="white-space : nowrap"><p class="availability">
<!-- TMPL_IF NAME="items_loop" -->
<span class="available"><strong><!-- TMPL_IF NAME="items_count" --><!-- TMPL_VAR NAME="items_count" --><!-- /TMPL_IF --> copies available at:</strong> <ul><!-- TMPL_LOOP NAME="items_loop" --><li><!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_IF name="location" --><!-- TMPL_VAR name="location" --><!-- /TMPL_IF --> <!-- TMPL_IF name="itemcallnumber" --><!-- TMPL_VAR name="itemcallnumber" --><!-- /TMPL_IF --> <!-- TMPL_IF name="cn_class" -->[<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="cn_class" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="cn_class" --></a>]<!-- /TMPL_IF -->(<!-- TMPL_VAR NAME="count" -->)</li><!-- /TMPL_LOOP --></ul></span>
<td style="white-space : nowrap"><div class="availability">
<div>
<!-- TMPL_IF NAME="items_count" --><!-- TMPL_VAR NAME="items_count" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemsplural" -->items<!-- TMPL_ELSE -->item<!-- /TMPL_IF --></div>
<!-- TMPL_IF NAME="available_items_loop" -->
<!-- TMPL_IF NAME="availablecount" --><!-- TMPL_VAR NAME="availablecount" --><!-- /TMPL_IF --> available:
<ul>
<!-- TMPL_LOOP NAME="available_items_loop" -->
<li>
<!-- TMPL_IF NAME="branchname" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="location" --><!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemcallnumber" -->[<a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:<!-- TMPL_VAR NAME="itemcallnumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="itemcallnumber" --></a>]<!-- /TMPL_IF -->
(<!-- TMPL_VAR NAME="count" -->)</li>
<!-- /TMPL_LOOP --></ul>
<!-- TMPL_ELSE -->
<span class="unavailable">No copies available: </span>
<span class="unavailable">No items available</span>
<!-- /TMPL_IF -->
<span class="unavailable">
<!-- TMPL_IF NAME="onloancount" --> On loan (<!-- TMPL_VAR NAME="onloancount" -->), <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="wthdrawncount" --> Withdrawn (<!-- TMPL_VAR NAME="wthdrawncount" -->), <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->)<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="orderedcount" --> On order (<!-- TMPL_VAR NAME="orderedcount" -->)<!-- /TMPL_IF -->
</span>
</p></td>
<!-- TMPL_IF NAME="onloan_items_loop" -->
<!-- TMPL_IF NAME="onloancount" --><!-- TMPL_VAR NAME="onloancount" --><!-- /TMPL_IF --> on loan:
<ul>
<!-- TMPL_LOOP NAME="onloan_items_loop" -->
<li>
<!-- TMPL_IF NAME="branchname" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="location" --><!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemcallnumber" -->[<a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:<!-- TMPL_VAR NAME="itemcallnumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="itemcallnumber" --></a>]<!-- /TMPL_IF -->
(<!-- TMPL_VAR NAME="count" --><!-- TMPL_IF NAME="longoverdue" -->, <!-- TMPL_VAR NAME="longoverdue" --> long overdue<!-- /TMPL_IF -->) date due: <!-- TMPL_VAR NAME="due_date" --></li>
<!-- /TMPL_LOOP --></ul>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="other_items_loop" -->
<!-- TMPL_IF NAME="othercount" --><!-- TMPL_VAR NAME="othercount" --><!-- /TMPL_IF --> unavailable:
<ul>
<!-- TMPL_LOOP NAME="other_items_loop" -->
<li>
<!-- TMPL_IF NAME="branchname" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="location" --><!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemcallnumber" -->[<a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:<!-- TMPL_VAR NAME="itemcallnumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="itemcallnumber" --></a>]<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="wthdrawn" -->(Withdrawn)<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemlost" -->(Lost)<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="damaged" -->(Damaged)<!-- /TMPL_IF -->
(<!-- TMPL_VAR NAME="count" -->)</li>
<!-- /TMPL_LOOP --></ul>
<!-- /TMPL_IF -->
</div></td>
</tr>
<!-- /TMPL_LOOP -->

View File

@ -139,19 +139,27 @@ href="/cgi-bin/koha/opac-rss.pl?q=<!-- TMPL_VAR name="query_cgi"--><!-- TMPL_VAR
<!-- TMPL_IF name="pages" --> - <!-- TMPL_VAR name="pages" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="notes" --> : <!-- TMPL_VAR name="notes" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="size" --> ; <!-- TMPL_VAR name="size" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF --></p>
<!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF -->
</p>
<p><!-- TMPL_VAR NAME="searchhighlightblob" --></p>
<p class="availability">
<!-- TMPL_IF NAME="items_loop" -->
<span class="available"><strong><!-- TMPL_IF NAME="items_count" --><!-- TMPL_VAR NAME="items_count" --><!-- /TMPL_IF --> copies available at:</strong> <!-- TMPL_LOOP NAME="items_loop" --><!-- <!-- TMPL_VAR NAME="branchcode" --> --><!-- TMPL_VAR NAME="branchname" --><!-- TMPL_IF name="cn_class" -->[<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="cn_class" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="cn_class" --></a>]<!-- /TMPL_IF -->(<!-- TMPL_VAR NAME="count" -->), <!-- /TMPL_LOOP --></span>
<!-- TMPL_ELSE -->
<span class="unavailable">No copies available: </span>
<!-- /TMPL_IF -->
<span class="unavailable">
<!-- TMPL_IF NAME="onloancount" --> On loan (<!-- TMPL_VAR NAME="onloancount" -->), <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="wthdrawncount" --> Withdrawn (<!-- TMPL_VAR NAME="wthdrawncount" -->), <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->)<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="orderedcount" --> On order (<!-- TMPL_VAR NAME="orderedcount" -->)<!-- /TMPL_IF -->
</span>
<!-- TMPL_IF NAME="available_items_loop" -->
<span class="available"><strong>Copies available at:</strong>
<!-- TMPL_LOOP NAME="available_items_loop" -->
<!-- TMPL_IF NAME="branchname" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF -->
(<!-- TMPL_VAR NAME="count" -->),
<!-- /TMPL_LOOP -->
</span>
<!-- TMPL_ELSE -->
<span class="unavailable">No items available:</span>
<!-- /TMPL_IF -->
<span class="unavailable">
<!-- TMPL_IF NAME="onloancount" --> On loan (<!-- TMPL_VAR NAME="onloancount" -->), <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="wthdrawncount" --> Withdrawn (<!-- TMPL_VAR NAME="wthdrawncount" -->), <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->),<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="damagedcount" --> Damaged (<!-- TMPL_VAR NAME="damagedcount" -->),<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="orderedcount" --> On order (<!-- TMPL_VAR NAME="orderedcount" -->),<!-- /TMPL_IF -->
</span>
</p>
<p><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Reserve</a><!-- /TMPL_IF --><!-- /TMPL_UNLESS --> <!--TMPL_IF NAME="opacbookbag" --><input type="checkbox" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" title="Click to add to book bag" /> <label for="bib<!-- TMPL_VAR NAME="biblionumber" -->"><!-- /TMPL_IF --><img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="ccode" -->" title="<!-- TMPL_VAR NAME="ccode" -->" /><!--TMPL_IF NAME="opacbookbag" --></label><!-- /TMPL_IF --> <!-- TMPL_IF name="classification" -->

View File

@ -445,15 +445,16 @@ $template->param ( QUERY_INPUTS => \@query_inputs );
my @limit_inputs = _input_cgi_parse($query_cgi);
# add OPAC 'hidelostitems'
# not items with
if (C4::Context->preference('hidelostitems') == 1) {
$query ="($query) not ((lost,st-numeric gt 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches=''))";
warn "Q".$query;
# either lost ge 0 or no value in the lost register
$query ="($query) and ( (lost,st-numeric <= 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='') )";
}
# add OPAC suppression - requires at least one item indexed with Suppress
if (C4::Context->preference('OpacSuppression')) {
$query = "($query) not Suppress=1";
}
$template->param ( LIMIT_INPUTS => \@limit_inputs );
## II. DO THE SEARCH AND GET THE RESULTS