fixing permissions on scripts
[koha.git] / serials / subscription-copy.pl
1 #!/usr/bin/perl
2
3
4 use strict;
5 use CGI;
6 use Date::Manip;
7
8 use C4::Koha;
9 use C4::Auth;
10 use C4::Date;
11 use C4::Output;
12 use C4::Acquisition;
13 use C4::Context;
14 use C4::Serials;
15
16 my $query = new CGI;
17 my $subscriptionid = $query->param('subscriptionid');
18 my $dbh = C4::Context->dbh;
19 # get old subscription
20 my $subs = &GetSubscription($subscriptionid);
21
22 # make newsubscription()
23 my $subscriptionid =  old_newsubscription($subs->{'auser'},$subs->{'aqbooksellerid'},$subs->{'cost'},$subs->{'aqbudgetid'},
24            $subs->{'biblionumber'},$subs->{'startdate'},$subs->{'periodicity'},$subs->{'firstacquidate'},
25            $subs->{'dow'},$subs->{'irregularity'},$subs->{'numberpattern'},$subs->{'numberlength'},
26            $subs->{'weeklength'},$subs->{'monthlength'},$subs->{'add1'},$subs->{'every1'},
27            $subs->{'whenmorethan1'},$subs->{'setto1'},$subs->{'lastvalue1'},$subs->{'add2'},
28            $subs->{'every2'},$subs->{'whenmorethan2'},$subs->{'setto2'},$subs->{'lastvalue2'},$subs->{'add3'},
29            $subs->{'every3'},$subs->{'whenmorethan3'},$subs->{'setto3'},$subs->{'lastvalue3'},
30            $subs->{'numberingmethod'},$subs->{'status'},$subs->{'notes'},
31                                 );
32 print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
33