From 97e92b22e19b3d2e1712bc3a9f8527f8b49d867c Mon Sep 17 00:00:00 2001 From: "Meenakshi.R" Date: Fri, 8 Jun 2012 11:09:58 +0530 Subject: [PATCH] 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 --- koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt | 6 ++++-- opac/opac-basket.pl | 13 ++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt index c4d40ed7ff..fcb43a02a2 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt @@ -308,13 +308,14 @@ function enableCheckboxActions(){ [% END %] - Location(s) + Location(s)(Status) [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %][% ELSE %]This record has no items.[% END %] @@ -353,7 +354,7 @@ function enableCheckboxActions(){ Title Author Year - Location + Location(Status) [% 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 %]) [% END %][% ELSE %]This record has no items.[% END %] diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index e71c8f1c39..cf75eb7a7b 100755 --- a/opac/opac-basket.pl +++ b/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; -- 2.39.5