Lines 44-61
Id of the subscription this script has to renew
Link Here
|
44 |
|
44 |
|
45 |
use Modern::Perl; |
45 |
use Modern::Perl; |
46 |
|
46 |
|
47 |
use CGI qw ( -utf8 ); |
47 |
use CGI qw ( -utf8 ); |
48 |
use Carp qw( carp ); |
48 |
use Carp qw( carp ); |
49 |
use C4::Koha; |
49 |
use C4::Koha; |
50 |
use C4::Auth qw( get_template_and_user ); |
50 |
use C4::Auth qw( get_template_and_user ); |
51 |
use C4::Context; |
51 |
use C4::Context; |
52 |
use C4::Auth qw( get_template_and_user ); |
52 |
use C4::Auth qw( get_template_and_user ); |
53 |
use C4::Output qw( output_and_exit output_html_with_http_headers ); |
53 |
use C4::Output qw( output_and_exit output_html_with_http_headers ); |
54 |
use C4::Serials qw( GetSubscription GetSubscriptionLength NewSubscription ReNewSubscription GetSerials GetNextExpected); |
54 |
use C4::Serials qw( GetSubscription GetSubscriptionLength NewSubscription ReNewSubscription GetSerials GetNextExpected); |
55 |
use C4::Serials::Frequency; |
55 |
use C4::Serials::Frequency; |
56 |
use C4::Serials::Numberpattern; |
56 |
use C4::Serials::Numberpattern; |
57 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
57 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
58 |
use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days Add_Delta_YM); |
58 |
use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days Add_Delta_YM); |
59 |
|
59 |
|
60 |
my $query = CGI->new; |
60 |
my $query = CGI->new; |
61 |
my $dbh = C4::Context->dbh; |
61 |
my $dbh = C4::Context->dbh; |
Lines 148-156
if ( $op eq "cud-renew" ) {
Link Here
|
148 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
148 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
149 |
} |
149 |
} |
150 |
|
150 |
|
151 |
my $newstartdate = output_pref( { str => $subscription->{enddate}, dateonly => 1 } ) |
151 |
my $newstartdate = output_pref( { str => $subscription->{enddate}, dateonly => 1, dateformat => 'iso' } ) |
152 |
or output_pref( { dt => dt_from_string, dateonly => 1 } ); |
152 |
or output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ); |
153 |
|
|
|
154 |
my ($serials_number) = GetSerials($subscriptionid); |
153 |
my ($serials_number) = GetSerials($subscriptionid); |
155 |
if ( $serials_number > 1 ) { |
154 |
if ( $serials_number > 1 ) { |
156 |
$template->param( more_than_one_serial => 1 ); |
155 |
$template->param( more_than_one_serial => 1 ); |
Lines 181-187
if ( $op eq "cud-renew" ) {
Link Here
|
181 |
my $numberpattern = GetSubscriptionNumberpattern( $subscription->{numberpattern} ); |
180 |
my $numberpattern = GetSubscriptionNumberpattern( $subscription->{numberpattern} ); |
182 |
|
181 |
|
183 |
$template->param( |
182 |
$template->param( |
184 |
startdate => $newstartdate, |
|
|
185 |
subscription => $subscription, |
183 |
subscription => $subscription, |
186 |
numberpattern => $numberpattern, |
184 |
numberpattern => $numberpattern, |
187 |
startdate => $newstartdate, |
185 |
startdate => $newstartdate, |
188 |
- |
|
|