Today
);
use POSIX qw( strftime );
-use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblio );
+use C4::Biblio qw( GetMarcFromKohaField ModBiblio );
use C4::Log qw( logaction ); # logaction
use C4::Serials::Frequency qw( GetSubscriptionFrequency );
use C4::Serials::Numberpattern;
use Koha::AdditionalFieldValues;
-use Koha::DateUtils qw( dt_from_string output_pref );
+use Koha::Biblios;
use Koha::Serial;
use Koha::Subscriptions;
use Koha::Subscription::Histories;
$sth->execute($biblionumber);
my @res;
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 } );
- if ( defined $subs->{histenddate} ) {
- $subs->{histenddate} = output_pref( { dt => dt_from_string( $subs->{histenddate} ), dateonly => 1 } );
- } else {
- $subs->{histenddate} = "";
- }
$subs->{opacnote} //= "";
$subs->{ "periodicity" . $subs->{periodicity} } = 1;
$subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
$subs->{ "status" . $subs->{'status'} } = 1;
- if (not defined $subs->{enddate} ) {
- $subs->{enddate} = '';
- } else {
- $subs->{enddate} = output_pref( { dt => dt_from_string( $subs->{enddate}), dateonly => 1 } );
- }
$subs->{'abouttoexpire'} = abouttoexpire( $subs->{'subscriptionid'} );
$subs->{'subscriptionexpired'} = HasSubscriptionExpired( $subs->{'subscriptionid'} );
$subs->{cannotedit} = not can_edit_subscription( $subs );
while ( my $line = $sth->fetchrow_hashref ) {
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
- for my $datefield ( qw( planneddate publisheddate) ) {
- if ($line->{$datefield} && $line->{$datefield}!~m/^00/) {
- $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } );
- } else {
- $line->{$datefield} = q{};
- }
- }
push @serials, $line;
}
while ( ( my $line = $sth->fetchrow_hashref ) && $counter < $count ) {
$counter++;
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
- for my $datefield ( qw( planneddate publisheddate) ) {
- if ($line->{$datefield} && $line->{$datefield}!~m/^00/) {
- $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } );
- } else {
- $line->{$datefield} = q{};
- }
- }
push @serials, $line;
}
while ( my $line = $sth->fetchrow_hashref ) {
$line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
- # Format dates for display
- for my $datefield ( qw( planneddate publisheddate ) ) {
- if (!defined($line->{$datefield}) || $line->{$datefield} =~m/^00/) {
- $line->{$datefield} = q{};
- }
- else {
- $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } );
- }
- }
push @serials, $line;
}
return @serials;
#set serial flag on biblio if not already set.
my $biblio = Koha::Biblios->find( $biblionumber );
if ( $biblio and !$biblio->serial ) {
- my $record = GetMarcBiblio({ biblionumber => $biblionumber });
+ my $record = $biblio->metadata->record;
my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial' );
if ($tag) {
eval { $record->field($tag)->update( $subf => 1 ); };
$sth->execute( EXPECTED, LATE, CLAIMED );
my @issuelist;
while ( my $line = $sth->fetchrow_hashref ) {
-
- if ($line->{planneddate} && $line->{planneddate} !~/^0+\-/) {
- $line->{planneddateISO} = $line->{planneddate};
- $line->{planneddate} = output_pref( { dt => dt_from_string( $line->{"planneddate"} ), dateonly => 1 } );
- }
- if ($line->{claimdate} && $line->{claimdate} !~/^0+\-/) {
- $line->{claimdateISO} = $line->{claimdate};
- $line->{claimdate} = output_pref( { dt => dt_from_string( $line->{"claimdate"} ), dateonly => 1 } );
- }
$line->{"status".$line->{status}} = 1;
my $subscription_object = Koha::Subscriptions->find($line->{subscriptionid});