[Koha-cvs] koha/intranet/cgi-bin/serials subscription-add.pl [rel_TG]

Tumer Garip tgarip at neu.edu.tr
Sun Mar 11 21:28:12 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_TG
Changes by:	Tumer Garip <tgarip1957>	07/03/11 20:28:12

Modified files:
	intranet/cgi-bin/serials: subscription-add.pl 

Log message:
	DateTime replaced with Date::Calc

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/intranet/cgi-bin/serials/subscription-add.pl?cvsroot=koha&only_with_tag=rel_TG&r1=1.1.2.1&r2=1.1.2.2

Patches:
Index: subscription-add.pl
===================================================================
RCS file: /sources/koha/koha/intranet/cgi-bin/serials/Attic/subscription-add.pl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- subscription-add.pl	10 Mar 2007 01:27:27 -0000	1.1.2.1
+++ subscription-add.pl	11 Mar 2007 20:28:12 -0000	1.1.2.2
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: subscription-add.pl,v 1.1.2.1 2007/03/10 01:27:27 tgarip1957 Exp $
+# $Id: subscription-add.pl,v 1.1.2.2 2007/03/11 20:28:12 tgarip1957 Exp $
 
 =head1 NAME
 
@@ -55,7 +55,7 @@
 use C4::Context;
 use C4::Letters;
 use C4::Members;
-use DateTime;
+use Date::Calc qw(:all);
 my $query = new CGI;
 my $op = $query->param('op');
 my $dbh = C4::Context->dbh;
@@ -80,19 +80,17 @@
 my $weekarrayjs='';
 my $count = 0;
 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 ($year,$month,$day)=split /-|\/|\.|:/,$today;
+  
+my $firstday = Day_of_Year($year,$month,$day);
+my $wkno = Week_of_Year($year,$month,$day);  
 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 $newdate=DateTime->from_day_of_year(year=>$year,day_of_year=>$count);
-        $weekarrayjs .= "'Wk $wkno: ".format_date($newdate->ymd)."',";
+     my ($nyear,$nmonth,$nday)=Add_Delta_Days($year,1,$count);
+        $weekarrayjs .= "'Wk $wkno: ".format_date($nyear."-"$nmonth."-"$nday)."',";
         $wkno++;    
 }
 chop($weekarrayjs);





More information about the Koha-cvs mailing list