From 040bcdf92b6015d702250f9981be44709ed7fc29 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 3 May 2004 09:10:51 +0000 Subject: [PATCH] CIRCULATION : the big rewrite... This 1st commit reorders deeply the circulation module. The goal is to : * have something 100% templated/translatable. * have something easy to read & modify, to say to customers/users : you can define your circulation rules as you want if you accept to look in C4/Circ/Circ2.pm The circulation now works : 1=> ask for the borrower barcode (as previously) 2=> ask for the item barcode. 3=> check "canbookbeissued". This new sub returns 2 arrays : - IMPOSSIBLE : if something is here, then the issue is not possible and is not done. - TOBECONFIRMED : if something is here, then the issue can be donc if the user confirms it. 4=> if TOBECONFIRMED is set : ask for confirmation, loop. if neither are set or confirmation flag is set (2nd pass of the loop), then issue. The IMPOSSIBLE & TOBECONFIRMED hashs contains : * the reason of the line. always in capitals, with words separated by _ : BARCODE_UNKNOWN, DEBTS ... as key of the hash * more information, as value of the hash ( TOBECONFIRMED{ALREADY_ISSUED} = "previous_borrower_name", for example) This commit : * compiles * works on certain situations, not on other * does NOT issue (the line is # ) * does not check issuing rules depending of # of books allowed / already issued The next step is : - check issuing rule. - extend issuing rule to have a 3D array : for each branch / itemtype / borrowertype = issuing number and issuing length. --- C4/Circulation/Circ2.pm | 5 ----- circ/circulation.pl | 1 + koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 0340957ec1..3aed4fdb9c 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -585,7 +585,6 @@ warn "current borrower for $iteminformation->{'itemnumber'} : $currentborrower" # sub issuebook { my ($env,$borrower,$barcode,$date) = @_; -warn "1"; my $dbh = C4::Context->dbh; # my ($borrower, $flags) = &getpatroninformation($env, $borrowernumber, 0); my $iteminformation = getiteminformation($env, 0, $barcode); @@ -595,7 +594,6 @@ warn "1"; # my ($currentborrower) = currentborrower($iteminformation->{'itemnumber'}); if ($currentborrower eq $borrower->{'borrowernumber'}) { -warn "2"; my ($charge,$itemtype) = calc_charges($env, $dbh, $iteminformation->{'itemnumber'}, $borrower->{'borrowernumber'}); if ($charge > 0) { createcharge($env, $dbh, $iteminformation->{'itemnumber'}, $borrower->{'borrowernumber'}, $charge); @@ -608,16 +606,13 @@ warn "2"; # NOT a renewal # if ($currentborrower ne '') { -warn "3"; # This book is currently on loan, but not to the person # who wants to borrow it now. mark it returned before issuing to the new borrower returnbook($iteminformation->{'barcode'}, $env->{'branchcode'}); } -warn "4"; # See if the item is on reserve. my ($restype, $res) = CheckReserves($iteminformation->{'itemnumber'}); if ($restype) { -warn "5"; my $resbor = $res->{'borrowernumber'}; if ($resbor eq $borrower->{'borrowernumber'}) { # The item is on reserve to the current patron diff --git a/circ/circulation.pl b/circ/circulation.pl index 368d54f489..1b7fe28831 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -1,4 +1,5 @@ #!/usr/bin/perl + # Please use 8-character tabs for this file (indents are every 4 characters) #written 8/5/2002 by Finlay diff --git a/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl index 27ca4dec73..2b32cc4c16 100644 --- a/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl @@ -3,7 +3,9 @@

Circulation: Issues

Parameters

-- 2.39.5