koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha C4/CirculationCirc2.pm circ/returns.pl koh...


From: LAURIN arnaud
Subject: [Koha-cvs] koha C4/CirculationCirc2.pm circ/returns.pl koh...
Date: Thu, 08 Jun 2006 15:36:31 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     LAURIN arnaud <alaurin> 06/06/08 15:36:31

Modified files:
        C4/Circulation : Circ2.pm 
        circ           : returns.pl 
        koha-tmpl/intranet-tmpl/prog/en/circ: returns.tmpl 
        reserve        : request.pl 
        updater        : updatedatabase 

Log message:
        Add a new system preference 'AutomaticItemReturn' :
        
        if this prefence is switched on: the document returned in another 
library than homebranch, the system automaticly transfer the document to his 
homebranch (with notification for librarian in returns.tmpl) .
        
        switch off : the document stay in the holdingbranch ...
        
        correcting bugs :
        - comment C4::acquisition (not using in request.pl).
        - correcting date in request.pl
        -add the new call of function getbranches in request.pl

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&r1=1.111&r2=1.112
http://cvs.savannah.gnu.org/viewcvs/koha/circ/returns.pl?cvsroot=koha&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl?cvsroot=koha&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/koha/reserve/request.pl?cvsroot=koha&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&r1=1.143&r2=1.144

Patches:
Index: C4/Circulation/Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -b -r1.111 -r1.112
--- C4/Circulation/Circ2.pm     7 Jun 2006 13:47:55 -0000       1.111
+++ C4/Circulation/Circ2.pm     8 Jun 2006 15:36:31 -0000       1.112
@@ -3,7 +3,7 @@
 
 package C4::Circulation::Circ2;
 
-# $Id: Circ2.pm,v 1.111 2006/06/07 13:47:55 alaurin Exp $
+# $Id: Circ2.pm,v 1.112 2006/06/08 15:36:31 alaurin Exp $
 
 #package to deal with Returns
 #written 3/11/99 by address@hidden
@@ -512,7 +512,7 @@
                $dotransfer = 1;
        }
 
-       if ($dotransfer and not $resfound) {
+       if ($dotransfer) {
                dotransfer($iteminformation->{'itemnumber'}, $fbr, $tbr);
                $messages->{'WasTransfered'} = 1;
        }
@@ -1197,11 +1197,10 @@
 #              now we check if there is a reservation with the validate of 
transfer if we have one, we can             set it with the status 'W'
                my $updateWaiting = 
SetWaitingStatus($iteminformation->{'itemnumber'});
        }
-#      if we don't have a transfer on run, we check if the document is not in 
his homebranch and there is not a reservation, we transfer this one to his home 
branch directly .
+#      if we don't have a transfer on run, we check if the document is not in 
his homebranch and there is not a reservation, we transfer this one to his home 
branch directly if system preference Automaticreturn is turn on .
        else {
-       #       new op dev
                my $checkreserves = 
CheckReserves($iteminformation->{'itemnumber'});
-               if (($iteminformation->{'homebranch'} ne 
$iteminformation->{'holdingbranch'}) and (not $checkreserves)){
+               if (($iteminformation->{'homebranch'} ne 
$iteminformation->{'holdingbranch'}) and (not $checkreserves) and 
(C4::Context->preference("AutomaticItemReturn") == 1)){
                        my $automatictransfer = 
dotransfer($iteminformation->{'itemnumber'},$iteminformation->{'holdingbranch'},$iteminformation->{'homebranch'});
                        $messages->{'WasTransfered'} = 1;
                }

Index: circ/returns.pl
===================================================================
RCS file: /sources/koha/koha/circ/returns.pl,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- circ/returns.pl     7 Jun 2006 04:39:37 -0000       1.40
+++ circ/returns.pl     8 Jun 2006 15:36:31 -0000       1.41
@@ -57,7 +57,7 @@
 my $linecolor1            = '#ffffcc';
 my $linecolor2            = 'white';
 
-my $branches = getbranches();
+my $branches = getbranches('IS');
 my $printers = getprinters( \%env );
 
 my $branch  = C4::Context->userenv->{'branch'};

Index: koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl   19 May 2006 17:05:11 
-0000      1.3
+++ koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl   8 Jun 2006 15:36:31 
-0000       1.4
@@ -27,9 +27,22 @@
                        <!-- /TMPL_LOOP -->
                        <input type="hidden" name="barcode" value="0" />
                        </form>
+               <!-- /TMPL_IF -->
                
-                       
+               <!-- TMPL_IF Name="transfer" -->
+                       <h2>This item must return to his homebranch :</h2>
+                       <p>The document <!-- TMPL_VAR NAME="itemtitle" --> 
(<!-- TMPL_VAR NAME="itemauthor" -->) Must be returned to his 
homebranch(<b><!-- TMPL_VAR NAME="itemhomebranch" --></b>)
+                               <form method="post" action="returns.pl">
+                                       <!-- TMPL_LOOP Name="inputloop" -->
+                                               <input type="hidden" 
name="ri-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="barcode" 
-->">
+                                               <input type="hidden" 
name="dd-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="duedate" 
-->">
+                                               <input type="hidden" 
name="bn-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="bornum" 
-->">
+                                       <!-- /TMPL_LOOP -->
+                                       <input type="hidden" name="barcode" 
value="0">
+                                       <input type="submit" value="OK">
+                               </form>
                <!-- /TMPL_IF -->
+               
                <!-- TMPL_IF Name="diffbranch" -->
                        <h3>Item Consigned:</h3>
        

Index: reserve/request.pl
===================================================================
RCS file: /sources/koha/koha/reserve/request.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- reserve/request.pl  7 Jun 2006 13:47:55 -0000       1.4
+++ reserve/request.pl  8 Jun 2006 15:36:31 -0000       1.5
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: request.pl,v 1.4 2006/06/07 13:47:55 alaurin Exp $
+# $Id: request.pl,v 1.5 2006/06/08 15:36:31 alaurin Exp $
 
 #script to place reserves/requests
 #writen 2/1/00 by address@hidden
@@ -29,6 +29,7 @@
 use Date::Manip;
 use List::MoreUtils qw/uniq/;
 use Data::Dumper;
+use Date::Calc qw/Today/;
 
 use C4::Search;
 use C4::Output;
@@ -38,7 +39,8 @@
 use C4::Biblio;
 use C4::Koha;
 use C4::Circulation::Circ2;
-use C4::Acquisition;
+# FIXME Is there utility to use Acquisition.pm ???? 
+# use C4::Acquisition;
 use C4::Date;
 use C4::Members;
 
@@ -66,7 +68,8 @@
 my $borrowerslist;
 my $messageborrower;
 
-my $date = today();
+# my $date = today();
+my $date= sprintf('%04d-%02d-%02d', Today());
 
 if ($findborrower) {
     my ($count,$borrowers) =  BornameSearch(\%env, $findborrower, 
'cardnumber', 'web');
@@ -318,7 +321,7 @@
 
 # existingreserves building
 my @reserveloop;
-my $branches = getbranches();
+my $branches = getbranches('RE');
 foreach my $res (sort {$a->{found} cmp $b->{found}} @$reserves){
     my %reserve;
     my @optionloop;
@@ -381,7 +384,6 @@
     push @values, $branchcode;
     $label_of{$branchcode} = $branches->{$branchcode}->{branchname};
 }
-
 my $CGIbranch = CGI::scrolling_list(
     -name     => 'pickup',
     -values   => address@hidden,

Index: updater/updatedatabase
===================================================================
RCS file: /sources/koha/koha/updater/updatedatabase,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -b -r1.143 -r1.144
--- updater/updatedatabase      7 Jun 2006 02:02:47 -0000       1.143
+++ updater/updatedatabase      8 Jun 2006 15:36:31 -0000       1.144
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: updatedatabase,v 1.143 2006/06/07 02:02:47 bob_lyon Exp $
+# $Id: updatedatabase,v 1.144 2006/06/08 15:36:31 alaurin Exp $
 
 # Database Updater
 # This script checks for required updates to the database.
@@ -445,6 +445,15 @@
             explanation         => 'Allow no debt alert if the patron is 
issuing item that accumulate debt',
             type                => 'YesNo',
         },
+       {
+            uniquefieldrequired => 'variable',
+            variable            => 'AutomaticItemReturn',
+            value               => '1',
+            forceupdate         => { 'explanation' => 1,
+                                     'type' => 1},
+            explanation         => 'This Variable allow or not to return 
automaticly to his homebranch',
+            type                => 'YesNo',
+        },
     ],
 
 );
@@ -1604,6 +1613,18 @@
 exit;
 
 # $Log: updatedatabase,v $
+# Revision 1.144  2006/06/08 15:36:31  alaurin
+# Add a new system preference 'AutomaticItemReturn' :
+#
+# if this prefence is switched on: the document returned in another library 
than homebranch, the system automaticly transfer the document to his homebranch 
(with notification for librarian in returns.tmpl) .
+#
+# switch off : the document stay in the holdingbranch ...
+#
+# correcting bugs :
+# - comment C4::acquisition (not using in request.pl).
+# - correcting date in request.pl
+# -add the new call of function getbranches in request.pl
+#
 # Revision 1.143  2006/06/07 02:02:47  bob_lyon
 # merging katipo changes...
 #




reply via email to

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