From 371efb047b1f813d6bd826f095850e7d4fae2502 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 4 Nov 2007 16:24:10 -0600 Subject: [PATCH] adding item-level itypes: based on systempref: item-level_itypes, we use items.ccode as the circ code rather than biblioitems.itemtype. This is initial commit -- still requiring interface changes basic loanlength, maxissues should be by ccode now. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Circulation.pm | 8 ++++---- circ/circulation.pl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b9ee41bf31..523eef1fdf 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -376,9 +376,9 @@ sub TooMany { my $dbh = C4::Context->dbh; my $branch_issuer = C4::Context->userenv->{'branchcode'}; - +#TODO : specify issuer or borrower for circrule. my $type = (C4::Context->preference('item-level_itype')) - ? $item->{'itype'} # item-level + ? $item->{'ccode'} # item-level : $item->{'itemtype'}; # biblio-level my $sth = @@ -395,7 +395,7 @@ sub TooMany { AND i.itemnumber = s2.itemnumber AND s1.biblioitemnumber = s2.biblioitemnumber" . (C4::Context->preference('item-level_itype')) - ? " AND s2.itype=? " + ? " AND s2.ccode=? " : " AND s1.itemtype= ? "; my $sth2= $dbh->prepare($query2); my $sth3 = @@ -1621,7 +1621,7 @@ sub AddRenewal { my $borrower = GetMemberDetails( $borrowernumber, 0 ); my $loanlength = GetLoanLength( $borrower->{'categorycode'}, - (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'} , + (C4::Context->preference('item-level_itypes')) ? $biblio->{'ccode'} : $biblio->{'itemtype'} , $borrower->{'branchcode'} ); #FIXME -- choose issuer or borrower branch. diff --git a/circ/circulation.pl b/circ/circulation.pl index 39f9c18035..81ccf69ed1 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -447,7 +447,7 @@ FROM issuingrules LEFT JOIN itemtypes ON (itemtypes.itemtype=issuingrules.itemtype) WHERE categorycode=? " ); -my @issued_itemtypes_count_loop; # huh? +#my @issued_itemtypes_count; # huh? $issueqty_sth->execute("*"); while ( my $data = $issueqty_sth->fetchrow_hashref() ) { -- 2.20.1