From da68b830cb4bd07c3daf3a1c00242675d18f760e Mon Sep 17 00:00:00 2001 From: tgarip1957 Date: Wed, 15 Nov 2006 01:38:26 +0000 Subject: [PATCH] Savannah seems out of synch.Code cleaning removal of Date::Manip --- serials/lateissues.pl | 9 ++++----- serials/serials-home.pl | 3 ++- serials/serials-receive.pl | 9 ++++----- serials/subscription-add.pl | 18 ++++++++++-------- serials/subscription-detail.pl | 27 +++++++++++++++------------ serials/subscription-renew.pl | 1 - 6 files changed, 35 insertions(+), 32 deletions(-) diff --git a/serials/lateissues.pl b/serials/lateissues.pl index 6169ca04f7..59f6d208e1 100755 --- a/serials/lateissues.pl +++ b/serials/lateissues.pl @@ -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) diff --git a/serials/serials-home.pl b/serials/serials-home.pl index 85a576311c..0585ed7665 100755 --- a/serials/serials-home.pl +++ b/serials/serials-home.pl @@ -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, diff --git a/serials/serials-receive.pl b/serials/serials-receive.pl index 8a1c1b11b3..be1179f6d5 100755 --- a/serials/serials-receive.pl +++ b/serials/serials-receive.pl @@ -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); -# } + } } diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index cbe75c2621..69493abb04 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -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); diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 646bc03d19..9cd294846f 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -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( diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl index 6ef217c075..b5ef08fd7b 100755 --- a/serials/subscription-renew.pl +++ b/serials/subscription-renew.pl @@ -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; -- 2.39.5