Bug 17865 'If a subscription has no history end date, it shows as expired today in OPAC'

--TEST PLAN--
1) View a subscription with no history end date
2) Search for an item with a subcription in OPAC
3) Under subscription tab click more details
4) The end date will be the current date
5) Apply patch and refresh
6) The end date will not be shown

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
Luke Honiss 2017-01-17 02:27:55 +00:00 committed by Mason James
parent 3b4e164903
commit 8b096e91f1
1 changed files with 6 additions and 2 deletions

View File

@ -442,7 +442,11 @@ sub GetSubscriptionsFromBiblionumber {
while ( my $subs = $sth->fetchrow_hashref ) {
$subs->{startdate} = output_pref( { dt => dt_from_string( $subs->{startdate} ), dateonly => 1 } );
$subs->{histstartdate} = output_pref( { dt => dt_from_string( $subs->{histstartdate} ), dateonly => 1 } );
$subs->{histenddate} = output_pref( { dt => dt_from_string( $subs->{histenddate} ), dateonly => 1 } );
if ( defined $subs->{histenddate} ) {
$subs->{histenddate} = output_pref( { dt => dt_from_string( $subs->{histenddate} ), dateonly => 1 } );
} else {
$subs->{histenddate} = "";
}
$subs->{opacnote} =~ s/\n/\<br\/\>/g;
$subs->{missinglist} =~ s/\n/\<br\/\>/g;
$subs->{recievedlist} =~ s/\n/\<br\/\>/g;
@ -450,7 +454,7 @@ sub GetSubscriptionsFromBiblionumber {
$subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
$subs->{ "status" . $subs->{'status'} } = 1;
if ( $subs->{enddate} eq '0000-00-00' ) {
if (not defined $subs->{enddate} ) {
$subs->{enddate} = '';
} else {
$subs->{enddate} = output_pref( { dt => dt_from_string( $subs->{enddate}), dateonly => 1 } );