Savannah seems out of synch.Code cleaning removal of Date::Manip
authortgarip1957 <tgarip1957>
Wed, 15 Nov 2006 01:38:26 +0000 (01:38 +0000)
committertgarip1957 <tgarip1957>
Wed, 15 Nov 2006 01:38:26 +0000 (01:38 +0000)
serials/lateissues.pl
serials/serials-home.pl
serials/serials-receive.pl
serials/subscription-add.pl
serials/subscription-detail.pl
serials/subscription-renew.pl

index 6169ca0..59f6d20 100755 (executable)
@@ -56,8 +56,8 @@ my $supplierid = $query->param('supplierid');
 my %supplierlist = GetSuppliersWithLateIssues;
 my @select_supplier;
 push @select_supplier,"";
-foreach my $supplierid (keys %supplierlist){
-    push @select_supplier, $supplierid
+foreach my $supplier (keys %supplierlist){
+    push @select_supplier, $supplier
 }
 my $CGIsupplier=CGI::scrolling_list(
             -name     => 'supplierid',
@@ -67,9 +67,8 @@ my $CGIsupplier=CGI::scrolling_list(
             -size     => 1,
             -multiple => 0 );
 
-my @lateissues;
-@lateissues = GetLateIssues($supplierid) if $supplierid;
-
+my ($count,@lateissues);
+($count,@lateissues) = GetLateIssues($supplierid) ;
 my @supplierinfo=GetBookSeller($supplierid) if $supplierid;
 
 my ($template, $loggedinuser, $cookie)
index 85a5763..0585ed7 100755 (executable)
@@ -52,6 +52,7 @@ use C4::Context;
 my $query = new CGI;
 my $title = $query->param('title');
 my $ISSN = $query->param('ISSN');
+my $supplierid = $query->param('supplierid');
 my $routing = $query->param('routing');
 my $searched = $query->param('searched');
 my $biblionumber = $query->param('biblionumber');
@@ -59,7 +60,7 @@ my $alt_links = 0;
 if(C4::Context->preference("RoutingSerials")){
     $alt_links = 0;
 }
-my @subscriptions = GetSubscriptions($title,$ISSN,$biblionumber);
+my @subscriptions = GetSubscriptions($title,$ISSN,$biblionumber,$supplierid);
 my ($template, $loggedinuser, $cookie)
 = get_template_and_user({template_name => "serials/serials-home.tmpl",
                                query => $query,
index 8a1c1b1..be1179f 100755 (executable)
@@ -122,11 +122,10 @@ if ($op eq 'serialchangestatus') {
        my $sth = $dbh->prepare("select status from serial where serialid=?");
        for (my $i=0;$i<=$#serialids;$i++) {
                $sth->execute($serialids[$i]);
-               
+               my $today=get_today();
                my ($oldstatus) = $sth->fetchrow;
                if ($serialids[$i]) {
-
-        my $planneddate = ($planneddates[$i]?format_date_in_iso($planneddates[$i]):format_date_in_iso("today")) if ($status[$i]==2);
+        my $planneddate = ($planneddates[$i]?format_date_in_iso($planneddates[$i]):$today) if ($status[$i]==2);
                        ModSerialStatus($serialids[$i],$serialseqs[$i],format_date_in_iso($publisheddates[$i]),format_date_in_iso($planneddates[$i]),$status[$i],$notes[$i],$itemnumbers[$i]) unless ($hassubscriptionexpired && $oldstatus ==1 );
                        if (($status[$i]==2) && $itemnumbers[$i]){
                                my %info;
@@ -149,9 +148,9 @@ if ($op eq 'serialchangestatus') {
                                $sth2->execute($holdingbranches[$i],$subscriptionid);
                                $sth2->finish;
                                # remove from missing list if item being checked in is on it
-#                              if ($status2 ==1){
+                              
                                    removeMissingIssue($serialseqs[$i],$subscriptionid);
-#                              }
+                              
                        }
 
                }
index cbe75c2..69493ab 100755 (executable)
@@ -55,8 +55,7 @@ use C4::Interface::CGI::Output;
 use C4::Context;
 use C4::Letters;
 use C4::Members;
-use Date::Manip;
-
+use DateTime;
 my $query = new CGI;
 my $op = $query->param('op');
 my $dbh = C4::Context->dbh;
@@ -80,17 +79,20 @@ my ($template, $loggedinuser, $cookie)
 
 my $weekarrayjs='';
 my $count = 0;
-my ($year, $month, $day) = UnixDate("today", "%Y", "%m", "%d");
-my $firstday = Date_DayOfYear($month,$day,$year);
-my $wkno = Date_WeekOfYear($month,$day,$year,1); # week starting monday
+my $today=get_today();
+ my $dateobj=DATE_obj($today);
+  my $year=$dateobj->year;
+  my $month=$dateobj->month;
+  my $day=$dateobj->day_of_month;
+my $firstday = $dateobj->day_of_year;
+my $wkno = $dateobj->week_number;
 my $weekno = $wkno;
 for(my $i=$firstday;$i<($firstday+365);$i=$i+7){
         $count = $i;
         if($wkno > 52){$year++; $wkno=1;}
         if($count>365){$count=$i-365;}    
-        my ($y,$m,$d) = Date_NthDayOfYear($year,$count);
-        my $output = "$y-$m-$d";
-        $weekarrayjs .= "'Wk $wkno: ".format_date($output)."',";
+     my $newdate=DateTime->from_day_of_year(year=>$year,day_of_year=>$count);
+        $weekarrayjs .= "'Wk $wkno: ".format_date($newdate->ymd)."',";
         $wkno++;    
 }
 chop($weekarrayjs);
index 646bc03..9cd2948 100755 (executable)
@@ -9,7 +9,7 @@ use C4::Serials;
 use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Context;
-use Date::Manip;
+use DateTime;
 
 my $query = new CGI;
 my $op = $query->param('op');
@@ -54,19 +54,22 @@ my ($user, $cookie, $sessionID, $flags)
 
 my $weekarrayjs='';
 my $count = 0;
-my ($year, $month, $day) = UnixDate("today", "%Y", "%m", "%d");
-my $firstday = Date_DayOfYear($month,$day,$year);
-my $wkno = Date_WeekOfYear($month,$day,$year,1); # week starting monday
+my $today=get_today();
+ my $dateobj=DATE_obj($today);
+  my $year=$dateobj->year;
+  my $month=$dateobj->month;
+  my $day=$dateobj->day_of_month;
+my $firstday = $dateobj->day_of_year;
+my $wkno = $dateobj->week_number;
 my $weekno = $wkno;
 for(my $i=$firstday;$i<($firstday+365);$i=$i+7){
-            $count = $i;
-            if($wkno > 52){$year++; $wkno=1;}
-            if($count>365){$count=$i-365;}
-            my ($y,$m,$d) = Date_NthDayOfYear($year,$count);
-            my $output = "$y-$m-$d";
-            $weekarrayjs .= "'Wk $wkno: ".format_date($output)."',";
-            $wkno++;
-    }
+        $count = $i;
+        if($wkno > 52){$year++; $wkno=1;}
+        if($count>365){$count=$i-365;}    
+     my $newdate=DateTime->from_day_of_year(year=>$year,day_of_year=>$count);
+        $weekarrayjs .= "'Wk $wkno: ".format_date($newdate->ymd)."',";
+        $wkno++;    
+}
 chop($weekarrayjs);
 
 $template->param(
index 6ef217c..b5ef08f 100755 (executable)
@@ -55,7 +55,6 @@ use C4::Date;
 use C4::Context;
 use C4::Search;
 use C4::Auth;
-use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Serials;