Browse Source

Bug 7570 - Add Item availability status to cart.

Added Item availability status to cart(Location table cell).

Changes:
-opac/opac-basket.pl:
Added code to show In transmit status and modified @items to call "GetItemsInfo" instead of "GetItemsLocationInfo" to get accurate avalibility status.
-koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt:
Added code for showing availibility staus in opac-basket page and in  "More details" link.

Test Cases:
-Add records to your cart with different cases like 1 record with  different Item status(Lost,Avaliable,Withdrawn,etc).
-Click on your cart and see the results in a new window.
-Click on "More details" link and check the results.

Signed-off-by: Michael Davis <m.r.davis@cranfield.ac.uk>
3.10.x
Meenakshi.R 12 years ago
committed by Paul Poulain
parent
commit
97e92b22e1
  1. 6
      koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt
  2. 13
      opac/opac-basket.pl

6
koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt

@ -308,13 +308,14 @@ function enableCheckboxActions(){
</tr>[% END %]
<tr>
<th scope="row">Location(s)</th>
<th scope="row">Location(s)(Status)</th>
<td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
<li>
<strong>[% ITEM_RESULT.homebranch %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
[% IF ( ITEM_RESULT.itemcallnumber ) %]
([% ITEM_RESULT.itemcallnumber %])
[% END %]
([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
</li>
[% END %]</ul>[% ELSE %]This record has no items.[% END %]</td>
</tr>
@ -353,7 +354,7 @@ function enableCheckboxActions(){
<th>Title</th>
<th>Author</th>
<th>Year</th>
<th>Location</th>
<th>Location(Status)</th>
</tr></thead>
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
@ -388,6 +389,7 @@ function enableCheckboxActions(){
[% IF ( ITEM_RESULT.itemcallnumber ) %]
([% ITEM_RESULT.itemcallnumber %])
[% END %]
([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
</li>
[% END %]</ul>[% ELSE %]This record has no items.[% END %]</td>
</tr>

13
opac/opac-basket.pl

@ -21,7 +21,9 @@ use warnings;
use CGI;
use C4::Koha;
use C4::Biblio;
use C4::Branch;
use C4::Items;
use C4::Circulation;
use C4::Auth;
use C4::Output;
@ -68,7 +70,7 @@ foreach my $biblionumber ( @bibs ) {
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
my $marcseriesarray = GetMarcSeries ($record,$marcflavour);
my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
my @items = &GetItemsLocationInfo( $biblionumber );
my @items = &GetItemsInfo( $biblionumber );
my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
my $hasauthors = 0;
@ -88,6 +90,15 @@ foreach my $biblionumber ( @bibs ) {
$dat->{'even'} = 1;
}
my $branches = GetBranches();
for my $itm (@items) {
my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
$itm->{transfertwhen} = $transfertwhen;
$itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
$itm->{transfertto} = $branches->{$transfertto}{branchname};
}
}
$num++;
$dat->{biblionumber} = $biblionumber;
$dat->{ITEM_RESULTS} = \@items;

Loading…
Cancel
Save