9 use C4::Interface::CGI::Output;
15 my $op = $query->param('op');
16 my $dbh = C4::Context->dbh;
17 my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$aqbudgetid, $bookfundid, $startdate, $periodicity,
18 $dow, $numberlength, $weeklength, $monthlength,
19 $seqnum1,$startseqnum1,$seqtype1,$freq1,$step1,
20 $seqnum2,$startseqnum2,$seqtype2,$freq2,$step2,
21 $seqnum3,$startseqnum3,$seqtype3,$freq3,$step3,
22 $numberingmethod, $arrivalplanified, $status, $biblionumber,
23 $bibliotitle, $notes);
25 my ($template, $loggedinuser, $cookie)
26 = get_template_and_user({template_name => "bull/subscription-add.tmpl",
30 flagsrequired => {catalogue => 1},
36 my $subscriptionid = $query->param('subscriptionid');
37 my $subs = &getsubscription($subscriptionid);
38 $auser = $subs->{'user'};
39 $librarian => $subs->{'librarian'},
40 $cost = $subs->{'cost'};
41 $aqbooksellerid = $subs->{'aqbooksellerid'};
42 $aqbooksellername = $subs->{'aqbooksellername'};
43 $bookfundid = $subs->{'bookfundid'};
44 $aqbudgetid = $subs->{'aqbudgetid'};
45 $startdate = $subs->{'startdate'};
46 $periodicity = $subs->{'periodicity'};
47 $dow = $subs->{'dow'};
48 $numberlength = $subs->{'numberlength'};
49 $weeklength = $subs->{'weeklength'};
50 $monthlength = $subs->{'monthlength'};
51 $seqnum1 = $subs->{'seqnum1'};
52 $startseqnum1 = $subs->{'startseqnum1'};
53 $seqtype1 = $subs->{'seqtype1'};
54 $freq1 = $subs->{'freq1'};
55 $step1 = $subs->{'step1'};
56 $seqnum2 = $subs->{'seqnum2'};
57 $startseqnum2 = $subs->{'startseqnum2'};
58 $seqtype2 = $subs->{'seqtype2'};
59 $freq2 = $subs->{'freq2'};
60 $step2 = $subs->{'step2'};
61 $seqnum3 = $subs->{'seqnum3'};
62 $startseqnum3 = $subs->{'startseqnum3'};
63 $seqtype3 = $subs->{'seqtype3'};
64 $freq3 = $subs->{'freq3'};
65 $step3 = $subs->{'step3'};
66 $numberingmethod = $subs->{'numberingmethod'};
67 $arrivalplanified = $subs->{'arrivalplanified'};
68 $status = $subs->{status};
69 $biblionumber = $subs->{'biblionumber'};
70 $bibliotitle = $subs->{'bibliotitle'},
71 $notes = $subs->{'notes'};
75 librarian => $librarian,
76 aqbooksellerid => $aqbooksellerid,
77 aqbooksellername => $aqbooksellername,
79 aqbudgetid => $aqbudgetid,
80 bookfundid => $bookfundid,
81 startdate => $startdate,
82 periodicity => $periodicity,
84 numberlength => $numberlength,
85 weeklength => $weeklength,
86 monthlength => $monthlength,
88 startseqnum =>$startseqnum1,
93 startseqnum2 => $startseqnum2,
94 seqtype2 => $seqtype2,
98 startseqnum3 => $startseqnum3,
99 seqtype3 => $seqtype3,
102 numberingmethod => $numberingmethod,
103 arrivalplanified => $arrivalplanified,
105 biblionumber => $biblionumber,
106 bibliotitle => $bibliotitle,
108 subscriptionid => $subscriptionid
111 "periodicity$periodicity" => 1,
112 "seqtype1$seqtype1" => 1,
113 "seqtype2$seqtype2" => 1,
114 "seqtype3$seqtype3" => 1,
118 # fill seqtype with 0 to avoid a javascript error
125 if ($op eq 'addsubscription') {
126 my $auser = $query->param('user');
127 my $aqbooksellerid = $query->param('aqbooksellerid');
128 my $cost = $query->param('cost');
129 my $aqbudgetid = $query->param('aqbudgetid');
130 my $startdate = $query->param('startdate');
131 my $periodicity = $query->param('periodicity');
132 my $dow = $query->param('dow');
133 my $numberlength = $query->param('numberlength');
134 my $weeklength = $query->param('weeklength');
135 my $monthlength = $query->param('monthlength');
136 my $seqnum1 = $query->param('seqnum1');
137 my $seqtype1 = $query->param('seqtype1');
138 my $freq1 = $query->param('freq1');
139 my $step1 = $query->param('step1');
140 my $seqnum2 = $query->param('seqnum2');
141 my $seqtype2 = $query->param('seqtype2');
142 my $freq2 = $query->param('freq2');
143 my $step2 = $query->param('step2');
144 my $seqnum3 = $query->param('seqnum3');
145 my $seqtype3 = $query->param('seqtype3');
146 my $freq3 = $query->param('freq3');
147 my $step3 = $query->param('step3');
148 my $numberingmethod = $query->param('numberingmethod');
149 my $arrivalplanified = $query->param('arrivalplanified');
151 my $biblionumber = $query->param('biblionumber');
152 my $notes = $query->param('notes');
154 my $sth=$dbh->prepare("insert into subscription (librarian, aqbooksellerid,cost,aqbudgetid,biblionumber,startdate, periodicity,dow,numberlength,weeklength,monthlength,seqnum1,startseqnum1,seqtype1,freq1,step1,seqnum2,startseqnum2,seqtype2,freq2, step2, seqnum3,startseqnum3,seqtype3, freq3, step3,numberingmethod, arrivalplanified, status, notes, pos1, pos2, pos3) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, 0, 0, 0)");
155 newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,$seqnum1,$seqnum1,$seqtype1,$freq1, $step1,$seqnum2,$seqnum2,$seqtype2,$freq2, $step2,$seqnum3,$seqnum3,$seqtype3,$freq3, $step3, $numberingmethod, $arrivalplanified, $status, $notes);
159 output_html_with_http_headers $query, $cookie, $template->output;