use Modern::Perl;
use CGI qw ( -utf8 );
-use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days Add_Delta_YM);
-use C4::Koha;
-use C4::Biblio;
-use C4::Auth;
-use C4::Acquisition;
-use C4::Output;
+use Date::Calc qw( Add_Delta_Days Add_Delta_YM );
+use C4::Koha qw( GetAuthorisedValues );
+use C4::Biblio qw( GetMarcBiblio );
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_and_exit output_html_with_http_headers );
use C4::Context;
-use C4::Serials;
+use C4::Serials qw( GetSubscription GetNextExpected GetSerials GetSubscriptionLength NewSubscription ModNextExpected ModSubscription );
use C4::Serials::Frequency;
use C4::Serials::Numberpattern;
-use C4::Letters;
+use C4::Letters qw( GetLetters );
use Koha::AdditionalFields;
use Koha::Biblios;
-use Koha::DateUtils;
+use Koha::DateUtils qw( output_pref );
use Koha::ItemTypes;
-use Carp;
+use Carp qw( carp );
use Koha::Subscription::Numberpattern;
use Koha::Subscription::Frequency;
= get_template_and_user({template_name => "serials/subscription-add.tt",
query => $query,
type => "intranet",
- authnotrequired => 0,
flagsrequired => {serials => $permission},
- debug => 1,
});
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
}
$firstissuedate = $subs->{firstacquidate} || ''; # in iso format.
- for (qw(startdate firstacquidate histstartdate enddate histenddate)) {
- next unless defined $subs->{$_};
- # TODO : Handle date formats properly.
- if ($subs->{$_} eq '0000-00-00') {
- $subs->{$_} = ''
- } else {
- $subs->{$_} = $subs->{$_};
- }
- }
- if (!defined $subs->{letter}) {
- $subs->{letter}= q{};
- }
+ if (!defined $subs->{letter}) {
+ $subs->{letter}= q{};
+ }
my $nextexpected = GetNextExpected($subscriptionid);
$nextexpected->{'isfirstissue'} = $nextexpected->{planneddate} eq $firstissuedate ;
$subs->{nextacquidate} = $nextexpected->{planneddate} if($op eq 'modify');