circ subdir - Dates.pm integration and warnings fixes.
authorJoe Atzberger <joe.atzberger@liblime.com>
Tue, 4 Dec 2007 23:40:55 +0000 (17:40 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 5 Dec 2007 00:21:12 +0000 (18:21 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
circ/bookcount.pl
circ/branchoverdues.pl
circ/circulation.pl
circ/overdue.pl
circ/returns.pl
circ/stats.pl
circ/transferstodo.pl
circ/transferstoreceive.pl
circ/waitingreserves.pl
circ/ysearch.pl

index 6894f8b..48b3ae2 100755 (executable)
@@ -30,7 +30,7 @@ use C4::Koha;
 use C4::Auth;
 use C4::Branch; # GetBranches
 use C4::Biblio; # GetBiblioItemData
-use C4::Date;
+use C4::Dates;
 
 my $input        = new CGI;
 my $itm          = $input->param('itm');
index fc14693..b7c4387 100755 (executable)
@@ -21,7 +21,7 @@ use C4::Context;
 use CGI;
 use C4::Output;
 use C4::Auth;
-use C4::Date;
+use C4::Dates;
 use C4::Overdues;    # AddNotifyLine
 use C4::Biblio;
 use C4::Koha;
index e307fdd..d6acddb 100755 (executable)
@@ -27,7 +27,7 @@ use CGI;
 use C4::Output;
 use C4::Print;
 use C4::Auth qw/:DEFAULT get_session/;
-use C4::Date;
+use C4::Dates;
 use C4::Branch; # GetBranches
 use C4::Koha;   # GetPrinter
 use C4::Circulation;
@@ -141,7 +141,7 @@ if($duedatespec) {
 #        ($year, $month, $day) = ($duedatespec) ? split /-/, $duedatespec : (0,0,0);
 #}
 
-my @datearr = localtime( time() );
+my @datearr = localtime();
 
 # FIXME - Could just use POSIX::strftime("%Y%m%d", localtime);
 my $todaysdate =
index 760ba7c..7be3830 100755 (executable)
@@ -24,21 +24,19 @@ use C4::Output;
 use CGI;
 use C4::Auth;
 use C4::Branch;
-use C4::Date;
+use C4::Dates;
 
 my $input = new CGI;
-my $type  = $input->param('type');
-
-my $theme = $input->param('theme');    # only used if allowthemeoverride is set
-my $order=$input->param('order');
-my $bornamefilter=$input->param('borname');
-my $borcatfilter=$input->param('borcat');
-my $itemtypefilter=$input->param('itemtype');
-my $borflagsfilter=$input->param('borflags') || " ";
-my $branchfilter=$input->param('branch');
-my $showall=$input->param('showall');
-my $theme = $input->param('theme'); # only used if allowthemeoverride is set
-
+my $type    = $input->param('type');
+my $theme   = $input->param('theme');    # only used if allowthemeoverride is set
+my $order   = $input->param('order');
+my $showall = $input->param('showall');
+
+my  $bornamefilter = $input->param('borname');
+my   $borcatfilter = $input->param('borcat');
+my $itemtypefilter = $input->param('itemtype');
+my $borflagsfilter = $input->param('borflags') || " ";
+my   $branchfilter = $input->param('branch');
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
index 3a60c34..e37c97a 100755 (executable)
@@ -31,7 +31,7 @@ use C4::Context;
 use C4::Auth;
 use C4::Output;
 use C4::Circulation;
-use C4::Date;
+use C4::Dates;
 use C4::Print;
 use C4::Reserves;
 use C4::Biblio;
index 5c1248b..23841ba 100755 (executable)
@@ -78,8 +78,8 @@ warn "d : $date // d2 : $date2";
 my @payments = TotalPaid( $date, $date2 );
 my $count    = @payments;
 my $total    = 0;
+my $totalw   = 0;
 my $oldtime;
-my $totalw = 0;
 my @loop;
 my %row;
 my $i = 0;
@@ -136,11 +136,7 @@ while ( $i < $count ) {
             }
         }
     }
-    my $hour = substr( $payments[$i]{'timestamp'}, 8,  2 );
-    my $min  = substr( $payments[$i]{'timestamp'}, 10, 2 );
-    my $sec  = substr( $payments[$i]{'timestamp'}, 12, 2 );
-    my $time = "$hour:$min:$sec";
-    my $time2 = "$payments[$i]{'date'}";
+    my $time2 = $payments[$i]{'date'};
     my $branch = Getpaidbranch( $time2, $payments[$i]{'borrowernumber'} );
     my $borrowernumber = $payments[$i]{'borrowernumber'};
     my $oldtime        = $payments[$i]{'timestamp'};
@@ -150,12 +146,8 @@ while ( $i < $count ) {
         && $oldtype == $payments[$i]{'accounttype'}
         && $oldtime eq $payments[$i]{'timestamp'} )
     {
-        my $hour = substr( $payments[$i]{'timestamp'}, 8,  2 );
-        my $min  = substr( $payments[$i]{'timestamp'}, 10, 2 );
-        my $sec  = substr( $payments[$i]{'timestamp'}, 12, 2 );
-        my $time = "$hour:$min:$sec";
-        my $time2 = "$payments[$i]{'date'}";
-        my $branch = Getpaidbranch( $time2, $payments[$i]{'borrowernumber'} );
+        my $xtime2 = $payments[$i]{'date'};
+        my $branch = Getpaidbranch( $xtime2, $payments[$i]{'borrowernumber'} );
         if ( $payments[$i]{'accounttype'} eq 'W' ) {
             $totalw += $payments[$i]{'amount'};
         }
index ff00c88..fd5e2da 100755 (executable)
@@ -24,7 +24,7 @@ use C4::Output;
 use CGI;
 use C4::Branch; # GetBranches
 use C4::Auth;
-use C4::Date;
+use C4::Dates;
 use C4::Circulation;
 use C4::Reserves;
 use C4::Members;
index 697a41a..8f65260 100755 (executable)
@@ -24,7 +24,7 @@ use C4::Context;
 use C4::Output;
 use C4::Branch;
 use C4::Auth;
-use C4::Date;
+use C4::Dates;
 use C4::Biblio;
 use C4::Circulation;
 use C4::Members;
@@ -41,7 +41,7 @@ my $input = new CGI;
 
 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) {
@@ -93,15 +93,11 @@ foreach my $br ( keys %$branches ) {
             my $gettitle     = GetBiblioFromItemNumber( $num->{'itemnumber'} );
             my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );
 
-            $getransf{'title'}        = $gettitle->{'title'};
             $getransf{'datetransfer'} = format_date( $num->{'datesent'} );
-            $getransf{'biblionumber'} = $gettitle->{'biblionumber'};
-            $getransf{'itemnumber'}   = $gettitle->{'itemnumber'};
-            $getransf{'barcode'}      = $gettitle->{'barcode'};
-            $getransf{'itemtype'}       = $itemtypeinfo->{'description'};
-            $getransf{'homebranch'}     = $gettitle->{'homebranch'};
-            $getransf{'holdingbranch'}  = $gettitle->{'holdingbranch'};
-            $getransf{'itemcallnumber'} = $gettitle->{'itemcallnumber'};
+            $getransf{'itemtype'} = $itemtypeinfo->{'description'};
+                       foreach (qw(title biblionumber itemnumber barcode homebranch holdingbranch itemcallnumber)) {
+               $getransf{$_} = $gettitle->{$_};
+                       }
 
             #                          we check if we have a reserv for this transfer
             my @checkreserv = GetReservesFromItemnumber($num->{'itemnumber'} );
@@ -128,7 +124,7 @@ foreach my $br ( keys %$branches ) {
 
 $template->param(
     branchesloop => \@branchesloop,
-    show_date    => format_date($todaysdate),
+    show_date    => format_date(join("-", &Today)),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index a802e95..692c38a 100755 (executable)
@@ -24,7 +24,7 @@ use C4::Context;
 use C4::Output;
 use C4::Branch; # GetBranchName
 use C4::Auth;
-use C4::Date;
+use C4::Dates;
 use C4::Circulation;
 use C4::Members;
 use C4::Biblio;
index 9b42a57..e3bc267 100755 (executable)
@@ -35,7 +35,7 @@ my $query   = $input->param('query');
 print $input->header(-type => 'text/plain', -charset => 'ISO-8859-1');
 
 my $dbh = C4::Context->dbh;
-my $query = "SELECT surname, firstname, cardnumber, address, city, zipcode ".
+$query = "SELECT surname, firstname, cardnumber, address, city, zipcode ".
             "FROM borrowers " .
             "WHERE surname LIKE '". $query . "%' " .
             "OR firstname LIKE '" . $query . "%' " .