Lines 419-427
sub PrepareSerialsData {
Link Here
|
419 |
|
419 |
|
420 |
foreach my $subs (@{$lines}) { |
420 |
foreach my $subs (@{$lines}) { |
421 |
for my $datefield ( qw(publisheddate planneddate) ) { |
421 |
for my $datefield ( qw(publisheddate planneddate) ) { |
422 |
# handle both undef and undef returned as 0000-00-00 |
422 |
# handle 0000-00-00 dates |
423 |
if (!defined $subs->{$datefield} or $subs->{$datefield}=~m/^00/) { |
423 |
if (defined $subs->{$datefield} and $subs->{$datefield} =~ m/^00/) { |
424 |
$subs->{$datefield} = 'XXX'; |
424 |
$subs->{$datefield} = undef; |
425 |
} |
425 |
} |
426 |
} |
426 |
} |
427 |
$subs->{ "status" . $subs->{'status'} } = 1; |
427 |
$subs->{ "status" . $subs->{'status'} } = 1; |
Lines 1235-1244
sub ModSerialStatus {
Link Here
|
1235 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1235 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1236 |
} else { |
1236 |
} else { |
1237 |
|
1237 |
|
1238 |
unless ($frequency->{'unit'}) { |
|
|
1239 |
if ( not $planneddate or $planneddate eq '0000-00-00' ) { $planneddate = C4::Dates->new()->output('iso') }; |
1240 |
if ( not $publisheddate or $publisheddate eq '0000-00-00' ) { $publisheddate = C4::Dates->new()->output('iso') }; |
1241 |
} |
1242 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1238 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1243 |
$sth = $dbh->prepare($query); |
1239 |
$sth = $dbh->prepare($query); |
1244 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1240 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
Lines 2532-2544
skipped then the returned date will be 2007-05-10
Link Here
|
2532 |
return : |
2528 |
return : |
2533 |
$resultdate - then next date in the sequence (ISO date) |
2529 |
$resultdate - then next date in the sequence (ISO date) |
2534 |
|
2530 |
|
2535 |
Return $publisheddate if subscription is irregular |
2531 |
Return undef if subscription is irregular |
2536 |
|
2532 |
|
2537 |
=cut |
2533 |
=cut |
2538 |
|
2534 |
|
2539 |
sub GetNextDate { |
2535 |
sub GetNextDate { |
2540 |
my ( $subscription, $publisheddate, $updatecount ) = @_; |
2536 |
my ( $subscription, $publisheddate, $updatecount ) = @_; |
2541 |
|
2537 |
|
|
|
2538 |
return unless $subscription and $publisheddate; |
2539 |
|
2542 |
my $freqdata = GetSubscriptionFrequency($subscription->{'periodicity'}); |
2540 |
my $freqdata = GetSubscriptionFrequency($subscription->{'periodicity'}); |
2543 |
|
2541 |
|
2544 |
if ($freqdata->{'unit'}) { |
2542 |
if ($freqdata->{'unit'}) { |
Lines 2676-2684
sub GetNextDate {
Link Here
|
2676 |
} |
2674 |
} |
2677 |
return sprintf("%04d-%02d-%02d", $year, $month, $day); |
2675 |
return sprintf("%04d-%02d-%02d", $year, $month, $day); |
2678 |
} |
2676 |
} |
2679 |
else { |
|
|
2680 |
return $publisheddate; |
2681 |
} |
2682 |
} |
2677 |
} |
2683 |
|
2678 |
|
2684 |
=head2 _numeration |
2679 |
=head2 _numeration |