Bug 11637: don't try to guess publication dates for irregular subscriptions

Test plan:
Create a subscription with an irregular numbering pattern.

Verify the prediction pattern. With this patch, it should show "unknown"
instead of the date of the first issue publication date.

This patch does not fix the issue on generating the next serial.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This is a partial fix for a small regression in the serials module.
Now the prediction pattern doesn't predict dates when you test it,
and shows 'Unknown' instead.

We still need to fix the 'planned date' set for the expected serial.
There should be no date, it should also be 'unknown'.

Passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Jonathan Druart 2014-02-21 17:16:43 +01:00 committed by Galen Charlton
parent 24470f70e1
commit fac91e2ce1

View file

@ -55,6 +55,7 @@ my $subtype = $input->param('subtype');
my $sublength = $input->param('sublength');
my $custompattern = $input->param('custompattern');
my $frequency = GetSubscriptionFrequency($frequencyid);
my %pattern = (
numberingmethod => $input->param('numberingmethod') // '',
@ -118,7 +119,7 @@ my @predictions_loop;
my ($calculated) = GetSeq(\%subscription, \%pattern);
push @predictions_loop, {
number => $calculated,
publicationdate => $date,
publicationdate => ($frequency->{unit} ? $date : undef),
issuenumber => $issuenumber,
dow => Day_of_Week(split /-/, $date),
};
@ -142,7 +143,7 @@ while( $i < 1000 ) {
$date = GetNextDate(\%subscription, $date);
}
if(defined $date){
$line{'publicationdate'} = $date;
$line{'publicationdate'} = $date if $frequency->{unit};
$line{'dow'} = Day_of_Week(split /-/, $date);
}
@ -177,8 +178,6 @@ $template->param(
predictions_loop => \@predictions_loop,
);
my $frequency = GetSubscriptionFrequency($frequencyid);
if ( $frequency->{unit} and not $custompattern ) {
$template->param( ask_for_irregularities => 1 );
if ( $frequency->{unit} eq 'day' and $frequency->{unitsperissue} == 1 ) {