Lines 22-28
use Modern::Perl;
Link Here
|
22 |
|
22 |
|
23 |
use C4::Auth qw(haspermission); |
23 |
use C4::Auth qw(haspermission); |
24 |
use C4::Context; |
24 |
use C4::Context; |
25 |
use C4::Dates qw(format_date format_date_in_iso); |
|
|
26 |
use DateTime; |
25 |
use DateTime; |
27 |
use Date::Calc qw(:all); |
26 |
use Date::Calc qw(:all); |
28 |
use POSIX qw(strftime); |
27 |
use POSIX qw(strftime); |
Lines 32-37
use C4::Debug;
Link Here
|
32 |
use C4::Serials::Frequency; |
31 |
use C4::Serials::Frequency; |
33 |
use C4::Serials::Numberpattern; |
32 |
use C4::Serials::Numberpattern; |
34 |
use Koha::AdditionalField; |
33 |
use Koha::AdditionalField; |
|
|
34 |
use Koha::DateUtils; |
35 |
|
35 |
|
36 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
36 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
37 |
|
37 |
|
Lines 467-475
sub GetSubscriptionsFromBiblionumber {
Link Here
|
467 |
$sth->execute($biblionumber); |
467 |
$sth->execute($biblionumber); |
468 |
my @res; |
468 |
my @res; |
469 |
while ( my $subs = $sth->fetchrow_hashref ) { |
469 |
while ( my $subs = $sth->fetchrow_hashref ) { |
470 |
$subs->{startdate} = format_date( $subs->{startdate} ); |
470 |
$subs->{startdate} = output_pref( { dt => dt_from_string( $subs->{startdate} ), dateonly => 1 } ); |
471 |
$subs->{histstartdate} = format_date( $subs->{histstartdate} ); |
471 |
$subs->{histstartdate} = output_pref( { dt => dt_from_string( $subs->{histstartdate} ), dateonly => 1 } ); |
472 |
$subs->{histenddate} = format_date( $subs->{histenddate} ); |
472 |
$subs->{histenddate} = output_pref( { dt => dt_from_string( $subs->{histenddate} ), dateonly => 1 } ); |
473 |
$subs->{opacnote} =~ s/\n/\<br\/\>/g; |
473 |
$subs->{opacnote} =~ s/\n/\<br\/\>/g; |
474 |
$subs->{missinglist} =~ s/\n/\<br\/\>/g; |
474 |
$subs->{missinglist} =~ s/\n/\<br\/\>/g; |
475 |
$subs->{recievedlist} =~ s/\n/\<br\/\>/g; |
475 |
$subs->{recievedlist} =~ s/\n/\<br\/\>/g; |
Lines 480-486
sub GetSubscriptionsFromBiblionumber {
Link Here
|
480 |
if ( $subs->{enddate} eq '0000-00-00' ) { |
480 |
if ( $subs->{enddate} eq '0000-00-00' ) { |
481 |
$subs->{enddate} = ''; |
481 |
$subs->{enddate} = ''; |
482 |
} else { |
482 |
} else { |
483 |
$subs->{enddate} = format_date( $subs->{enddate} ); |
483 |
$subs->{enddate} = output_pref( { dt => dt_from_string( $subs->{enddate}), dateonly => 1 } ); |
484 |
} |
484 |
} |
485 |
$subs->{'abouttoexpire'} = abouttoexpire( $subs->{'subscriptionid'} ); |
485 |
$subs->{'abouttoexpire'} = abouttoexpire( $subs->{'subscriptionid'} ); |
486 |
$subs->{'subscriptionexpired'} = HasSubscriptionExpired( $subs->{'subscriptionid'} ); |
486 |
$subs->{'subscriptionexpired'} = HasSubscriptionExpired( $subs->{'subscriptionid'} ); |
Lines 710-716
sub GetSerials {
Link Here
|
710 |
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list |
710 |
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list |
711 |
for my $datefield ( qw( planneddate publisheddate) ) { |
711 |
for my $datefield ( qw( planneddate publisheddate) ) { |
712 |
if ($line->{$datefield} && $line->{$datefield}!~m/^00/) { |
712 |
if ($line->{$datefield} && $line->{$datefield}!~m/^00/) { |
713 |
$line->{$datefield} = format_date( $line->{$datefield}); |
713 |
$line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } ); |
714 |
} else { |
714 |
} else { |
715 |
$line->{$datefield} = q{}; |
715 |
$line->{$datefield} = q{}; |
716 |
} |
716 |
} |
Lines 733-739
sub GetSerials {
Link Here
|
733 |
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list |
733 |
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list |
734 |
for my $datefield ( qw( planneddate publisheddate) ) { |
734 |
for my $datefield ( qw( planneddate publisheddate) ) { |
735 |
if ($line->{$datefield} && $line->{$datefield}!~m/^00/) { |
735 |
if ($line->{$datefield} && $line->{$datefield}!~m/^00/) { |
736 |
$line->{$datefield} = format_date( $line->{$datefield}); |
736 |
$line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } ); |
737 |
} else { |
737 |
} else { |
738 |
$line->{$datefield} = q{}; |
738 |
$line->{$datefield} = q{}; |
739 |
} |
739 |
} |
Lines 788-794
sub GetSerials2 {
Link Here
|
788 |
$line->{$datefield} = q{}; |
788 |
$line->{$datefield} = q{}; |
789 |
} |
789 |
} |
790 |
else { |
790 |
else { |
791 |
$line->{$datefield} = format_date( $line->{$datefield} ); |
791 |
$line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } ); |
792 |
} |
792 |
} |
793 |
} |
793 |
} |
794 |
push @serials, $line; |
794 |
push @serials, $line; |
Lines 824-831
sub GetLatestSerials {
Link Here
|
824 |
my @serials; |
824 |
my @serials; |
825 |
while ( my $line = $sth->fetchrow_hashref ) { |
825 |
while ( my $line = $sth->fetchrow_hashref ) { |
826 |
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list |
826 |
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list |
827 |
$line->{"planneddate"} = format_date( $line->{"planneddate"} ); |
827 |
$line->{planneddate} = output_pref( { dt => dt_from_string( $line->{planneddate} ), dateonly => 1 } ); |
828 |
$line->{"publisheddate"} = format_date( $line->{"publisheddate"} ); |
828 |
$line->{publisheddate} = output_pref( { dt => dt_from_string( $line->{publisheddate} ), dateonly => 1 } ); |
829 |
push @serials, $line; |
829 |
push @serials, $line; |
830 |
} |
830 |
} |
831 |
|
831 |
|
Lines 1983-1993
sub GetLateOrMissingIssues {
Link Here
|
1983 |
|
1983 |
|
1984 |
if ($line->{planneddate} && $line->{planneddate} !~/^0+\-/) { |
1984 |
if ($line->{planneddate} && $line->{planneddate} !~/^0+\-/) { |
1985 |
$line->{planneddateISO} = $line->{planneddate}; |
1985 |
$line->{planneddateISO} = $line->{planneddate}; |
1986 |
$line->{planneddate} = format_date( $line->{planneddate} ); |
1986 |
$line->{planneddate} = output_pref( { dt => dt_from_string( $line->{"planneddate"} ), dateonly => 1 } ); |
1987 |
} |
1987 |
} |
1988 |
if ($line->{claimdate} && $line->{claimdate} !~/^0+\-/) { |
1988 |
if ($line->{claimdate} && $line->{claimdate} !~/^0+\-/) { |
1989 |
$line->{claimdateISO} = $line->{claimdate}; |
1989 |
$line->{claimdateISO} = $line->{claimdate}; |
1990 |
$line->{claimdate} = format_date( $line->{claimdate} ); |
1990 |
$line->{claimdate} = output_pref( { dt => dt_from_string( $line->{"claimdate"} ), dateonly => 1 } ); |
1991 |
} |
1991 |
} |
1992 |
$line->{"status".$line->{status}} = 1; |
1992 |
$line->{"status".$line->{status}} = 1; |
1993 |
|
1993 |
|