From 200e44c1cec0f36beefb0f45e9cc57632d958f64 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Tue, 25 Dec 2007 12:06:52 -0500 Subject: [PATCH] WARNING: BIGFIXING 670 670 is primarily about the status of a biblio or item that's got a hold on it ... specifically the 'in transit' and 'waiting' status. It applies to the following pages. * request.pl - tested * detail.pl - tested * circulation.pl - tested * moremember.pl - tested * opac-user.pl - doesn't show transit status, but only shows waiting when item has arrived at the pickup library * opac-detail.pl - doesn't show hold statuses Signed-off-by: Joshua Ferraro --- catalogue/detail.pl | 10 +++ .../prog/en/modules/circ/circulation.tmpl | 12 +-- .../prog/en/modules/members/moremember.tmpl | 27 +++---- reserve/request.pl | 74 +++++++++---------- 4 files changed, 67 insertions(+), 56 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 3e40f7cb93..8de024707f 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -25,6 +25,7 @@ use C4::Koha; use C4::Serials; #uses getsubscriptionfrom biblionumber use C4::Output; use C4::Biblio; +use C4::Circulation; use C4::Branch; use C4::Reserves; use C4::Members; @@ -117,6 +118,15 @@ foreach my $item (@items) { $item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname}; } + # Check the transit status + my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber}); + if ( $transfertwhen ne '' ) { + $item->{transfertwhen} = format_date($transfertwhen); + $item->{transfertfrom} = $branches->{$transfertfrom}{branchname}; + $item->{transfertto} = $branches->{$transfertto}{branchname}; + $item->{nocancel} = 1; + } + # FIXME: move this to a pm, check waiting status for holds my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W' AND cancellationdate IS NULL"); $sth2->execute($item->{ReservedForBorrowernumber},$item->{itemnumber}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index c965348e72..0fc2d0156e 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -466,7 +466,7 @@ No patron matched - + @@ -477,7 +477,7 @@ No patron matched diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index c34dc05762..cfc734a765 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -210,7 +210,7 @@ $(document).ready(function() { - + @@ -303,19 +303,20 @@ $(document).ready(function() { diff --git a/reserve/request.pl b/reserve/request.pl index e98a3ac7a4..ac95675b14 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -96,7 +96,7 @@ if ($cardnumber) { my $count_reserv = 0; my $maxreserves; -# we check the reserves of the borrower, and if he can reserv a document +# we check the reserves of the borrower, and if he can reserv a document # FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... my $number_reserves = @@ -129,9 +129,9 @@ if ($cardnumber) { borrowerstreetaddress => $borrowerinfo->{'address'}, borrowercity => $borrowerinfo->{'city'}, borrowerphone => $borrowerinfo->{'phone'}, - borrowermobile => $borrowerinfo->{'mobile'}, - borrowerfax => $borrowerinfo->{'fax'}, - borrowerphonepro => $borrowerinfo->{'phonepro'}, + borrowermobile => $borrowerinfo->{'mobile'}, + borrowerfax => $borrowerinfo->{'fax'}, + borrowerphonepro => $borrowerinfo->{'phonepro'}, borroweremail => $borrowerinfo->{'email'}, borroweremailpro => $borrowerinfo->{'emailpro'}, borrowercategory => $borrowerinfo->{'category'}, @@ -239,8 +239,8 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } ) { my $item = $iteminfos_of->{$itemnumber}; - $item->{itypename} = $itemtypes->{ $item->{itype} }{description}; - $item->{imageurl} = getitemtypeimagesrc() . "/".$itemtypes->{ $item->{itype} }{imageurl}; + $item->{itypename} = $itemtypes->{ $item->{itype} }{description}; + $item->{imageurl} = getitemtypeimagesrc() . "/".$itemtypes->{ $item->{itype} }{imageurl}; $item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; @@ -251,9 +251,9 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { $branches->{ $item->{holdingbranch} }{branchname}; } -# add information - $item->{itemcallnumber} = $item->{itemcallnumber}; - +# add information + $item->{itemcallnumber} = $item->{itemcallnumber}; + # if the item is currently on loan, we display its return date and # change the background color my $issues= GetItemIssue($itemnumber); @@ -294,7 +294,7 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { $item->{backgroundcolor} = 'other'; } - # Check of the transfered documents + # Check the transit status my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itemnumber); @@ -303,44 +303,44 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { $item->{transfertfrom} = $branches->{$transfertfrom}{branchname}; $item->{transfertto} = $branches->{$transfertto}{branchname}; - $item->{nocancel} = 1; + $item->{nocancel} = 1; } # If there is no loan, return and transfer, we show a checkbox. $item->{notforloan} = $item->{notforloan} || 0; - - # if independent branches is on we need to check if the person can reserve - # for branches they arent logged in to - if ( C4::Context->preference("IndependantBranches") ) { - if (! C4::Context->preference("canreservefromotherbranches")){ - # cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve - my $userenv = C4::Context->userenv; - if ( ($userenv) && ( $userenv->{flags} != 1 ) ) { - $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} ); - } - } - } - - # FIXME: every library will define this differently + + # if independent branches is on we need to check if the person can reserve + # for branches they arent logged in to + if ( C4::Context->preference("IndependantBranches") ) { + if (! C4::Context->preference("canreservefromotherbranches")){ + # cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve + my $userenv = C4::Context->userenv; + if ( ($userenv) && ( $userenv->{flags} != 1 ) ) { + $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} ); + } + } + } + + # FIXME: every library will define this differently # An item is available only if: if ( not defined $reservedate # not reserved yet and $issues->{'date_due'} eq '' # not currently on loan and not $item->{itemlost} # not lost and not $item->{notforloan} # not forbidden to loan - and not $item->{cantreserve} + and not $item->{cantreserve} and $transfertwhen eq '' # not currently on transfert ) { $item->{available} = 1; } - # FIXME: move this to a pm - my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W' AND cancellationdate IS NULL"); - $sth2->execute($item->{ReservedForBorrowernumber},$item->{itemnumber}); - while (my $wait_hashref = $sth2->fetchrow_hashref) { - $item->{waitingdate} = format_date($wait_hashref->{waitingdate}); - } + # FIXME: move this to a pm + my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W' AND cancellationdate IS NULL"); + $sth2->execute($item->{ReservedForBorrowernumber},$item->{itemnumber}); + while (my $wait_hashref = $sth2->fetchrow_hashref) { + $item->{waitingdate} = format_date($wait_hashref->{waitingdate}); + } push @{ $biblioitem->{itemloop} }, $item; } @@ -377,9 +377,9 @@ foreach my $res ( sort { $a->{found} cmp $b->{found} } @$reserves ) { $reserve{'wait'}= 1; $reserve{'holdingbranch'}=$item->{'holdingbranch'}; $reserve{'biblionumber'}=$item->{'biblionumber'}; - $reserve{'barcodenumber'} = $item->{'barcode'}; + $reserve{'barcodenumber'} = $item->{'barcode'}; $reserve{'wbrcode'} = $res->{'branchcode'}; - $reserve{'itemnumber'} = $res->{'itemnumber'}; + $reserve{'itemnumber'} = $res->{'itemnumber'}; $reserve{'wbrname'} = $branches->{$res->{'branchcode'}}->{'branchname'}; if($reserve{'holdingbranch'} eq $reserve{'wbrcode'}){ $reserve{'atdestination'} = 1; @@ -405,7 +405,7 @@ my $reserveborrowerinfo = GetMemberDetails( $res->{'borrowernumber'}, 0); $reserve{'voldesc'} = $res->{'volumeddesc'}; $reserve{'ccode'} = $res->{'ccode'}; $reserve{'barcode'} = $res->{'barcode'}; - $reserve{'priority'} = $res->{'priority'}; + $reserve{'priority'} = $res->{'priority'}; $reserve{'branchloop'} = \@branchloop; $reserve{'optionloop'} = \@optionloop; @@ -422,7 +422,7 @@ foreach my $branchcode ( keys %{$branches} ) { } my $CGIbranch = CGI::scrolling_list( -name => 'pickup', - -id => 'pickup', + -id => 'pickup', -values => \@values, -default => $default, -labels => \%label_of, @@ -437,7 +437,7 @@ $template->param( CGIbranch => $CGIbranch, reserveloop => \@reserveloop, time => $time, - fixedRank => $fixedRank, + fixedRank => $fixedRank, ); # display infos -- 2.20.1
Hold dateStatusPriority Title Author Call Number - + Item targeted Hold priority @@ -489,17 +489,17 @@ No patron matched
- This hold is available + Item is waiting
- This hold has been transfered from library - on + Item in transit from + since
- This hold hasn't been transfered yet from library + This item hasn't been transfered yet from
TitleBarcodePriority Date due Itemtype Charge "> ( ) + +
+ Item is waiting + + +
+ Item in transit from + since + - - This item is available - - - This item has been transfered from library : - the : - - - - This item hasn't been transfered yet from library : - - + +
+ This item hasn't been transfered yet from +