[Koha-cvs] koha/circ currenttransfers.pl [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Thu Nov 23 12:21:27 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/11/23 11:21:27

Modified files:
	circ           : currenttransfers.pl 

Log message:
	fix some bugs,removing some warns.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/circ/currenttransfers.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.5&r2=1.3.2.6

Patches:
Index: currenttransfers.pl
===================================================================
RCS file: /sources/koha/koha/circ/currenttransfers.pl,v
retrieving revision 1.3.2.5
retrieving revision 1.3.2.6
diff -u -b -r1.3.2.5 -r1.3.2.6
--- currenttransfers.pl	22 Nov 2006 16:53:33 -0000	1.3.2.5
+++ currenttransfers.pl	23 Nov 2006 11:21:27 -0000	1.3.2.6
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: currenttransfers.pl,v 1.3.2.5 2006/11/22 16:53:33 alaurin Exp $
+# $Id: currenttransfers.pl,v 1.3.2.6 2006/11/23 11:21:27 toins Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -41,6 +41,7 @@
 
 my $theme = $input->param('theme');    # only used if allowthemeoverride is set
 my $itemnumber = $input->param('itemnumber');
+my $todaysdate = join "-", &Today;
 
 # if we have a resturn of the form to delete the transfer, we launch the subrroutine
 if ($itemnumber) {
@@ -61,16 +62,6 @@
 # set the userenv branch
 my $default = C4::Context->userenv->{'branch'};
 
-my @datearr    = localtime( time() );
-my $todaysdate =
-    ( 1900 + $datearr[5] ) . '-'
-  . sprintf( "%0.2d", ( $datearr[4] + 1 ) ) . '-'
-  . sprintf( "%0.2d", $datearr[3] );
-
-warn "todaysdate=>" . $todaysdate;
-my $todaysdate2 = join "-", &Today;
-warn "todaysdate2=>" . $todaysdate2;
-
 # get the all the branches for reference
 my $branches = GetBranches();
 my @branchesloop;
@@ -79,21 +70,17 @@
     my %branchloop;
     $branchloop{'branchname'} = $branches->{$br}->{'branchname'};
     $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'};
-
-    # # # # # # # # # # # # # # # # # # # # # #
     my @gettransfers =
       GetTransfersFromBib( $branches->{$br}->{'branchcode'}, $default );
+
     if (@gettransfers) {
         foreach my $num (@gettransfers) {
             my %getransf;
             my %env;
 
-#my $calcDate=DateCalc($num->{'datesent'},"+".C4::Context->preference('TransfersMaxDaysWarning')."  days");
-#my $warning=Date_Cmp(ParseDate("today"),$calcDate);
-
-            #new
             my ( $sent_year, $sent_month, $sent_day ) = split "-",
               $num->{'datesent'};
+            $sent_day = ( split " ", $sent_day )[0];
             ( $sent_year, $sent_month, $sent_day ) =
               Add_Delta_YM( $sent_year, $sent_month, $sent_day,
                 C4::Context->preference('TransfersMaxDaysWarning'), 0 );
@@ -101,8 +88,6 @@
             my $today    = Date_to_Days(&Today);
             my $warning  = ( $today > $calcDate );
 
-            #endnew
-
             if ( $warning > 0 ) {
                 $getransf{'messcompa'} = 1;
             }
@@ -114,7 +99,6 @@
             $getransf{'biblionumber'} = $gettitle->{'biblionumber'};
             $getransf{'itemnumber'}   = $gettitle->{'itemnumber'};
             $getransf{'barcode'}      = $gettitle->{'barcode'};
-
             # 				$getransf{'barcode'} = 'toto le bozo';
             $getransf{'itemtype'}       = $itemtypeinfo->{'description'};
             $getransf{'homebranch'}     = $gettitle->{'homebranch'};
@@ -149,10 +133,11 @@
     }
     push( @branchesloop, \%branchloop );
 }
+
 $template->param(
     branchesloop => \@branchesloop,
-    show_date    => format_date($todaysdate)
+    show_date    => $todaysdate
 );
 
-print "Content-Type: text/html\n\n", $template->output;
+output_html_with_http_headers $input, $cookie, $template->output;
 





More information about the Koha-cvs mailing list