koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4/Circulation Circ2.pm


From: Antoine Farnault
Subject: [Koha-cvs] koha/C4/Circulation Circ2.pm
Date: Tue, 04 Jul 2006 14:57:27 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     Antoine Farnault <toins>        06/07/04 14:57:27

Modified files:
        C4/Circulation : Circ2.pm 

Log message:
        Head & rel_2_2 merged

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&r1=1.112&r2=1.113

Patches:
Index: Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- Circ2.pm    8 Jun 2006 15:36:31 -0000       1.112
+++ Circ2.pm    4 Jul 2006 14:57:26 -0000       1.113
@@ -3,7 +3,7 @@
 
 package C4::Circulation::Circ2;
 
-# $Id: Circ2.pm,v 1.112 2006/06/08 15:36:31 alaurin Exp $
+# $Id: Circ2.pm,v 1.113 2006/07/04 14:57:26 toins Exp $
 
 #package to deal with Returns
 #written 3/11/99 by address@hidden
@@ -35,6 +35,7 @@
 use C4::Reserves2;
 use C4::Koha;
 use C4::Accounts2;
+use C4::Biblio;
 use Date::Manip;
 use C4::Biblio;
 
@@ -273,6 +274,12 @@
        $sth->finish;
        $borrower->{'flags'}=$flags;
        $borrower->{'authflags'} = $accessflagshash;
+
+       # find out how long the membership lasts
+       my $sth=$dbh->prepare("select enrolmentperiod from categories where 
categorycode = ?");
+       $sth->execute($borrower->{'categorycode'});
+       my $enrolment = $sth->fetchrow;
+       $borrower->{'enrolmentperiod'} = $enrolment;
        return ($borrower); #, $flags, $accessflagshash);
 }
 
@@ -514,6 +521,14 @@
        
        if ($dotransfer) {
                dotransfer($iteminformation->{'itemnumber'}, $fbr, $tbr);
+               my $dbh= C4::Context->dbh;
+               my ($tagfield,$tagsubfield) = 
MARCfind_marc_from_kohafield($dbh,"items.holdingbranch");
+               my $bibid = MARCfind_MARCbibid_from_oldbiblionumber( $dbh, 
$iteminformation->{'biblionumber'} );
+               my $marcitem = MARCgetitem($dbh, $bibid, 
$iteminformation->{'itemnumber'});
+               if ($marcitem->field($tagfield)){
+                       $marcitem->field($tagfield)->update($tagsubfield=> 
$tbr);
+                       
MARCmoditem($dbh,$marcitem,$bibid,$iteminformation->{'itemnumber'});
+               }
                $messages->{'WasTransfered'} = 1;
        }
        return ($dotransfer, $messages, $iteminformation);
@@ -834,6 +849,13 @@
        if ($iteminformation->{'restricted'} && 
$iteminformation->{'restricted'} == 1) {
                $issuingimpossible{RESTRICTED} = 1;
        }
+       if (C4::Context->preference("IndependantBranches")){
+               my $userenv = C4::Context->userenv;
+               if (($userenv)&&($userenv->{flags} != 1)){
+                       $issuingimpossible{NOTSAMEBRANCH} = 1 if 
($iteminformation->{'holdingbranch'} ne $userenv->{branch} ) ;
+               }
+       }
+
 
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]