7 use C4::Interface::CGI::Output;
13 my $op = $query->param('op');
14 my $dbh = C4::Context->dbh;
15 my $sid = $query->param('subsid');
16 my $ser = $query->param('serial');
17 warn "$ser la valeur du nom du formulaire";
18 if ($op eq 'modsubscriptionhistory')
20 my $auser = $query->param('user');
21 my $status = $query->param('status');
22 my $waited = $query->param('waited');
23 my $begin = $query->param('begin');
24 my $end = $query->param('end');
25 my $arrived = $query->param('arrived');
26 my $gapped = $query->param('gapped');
27 my $opac = $query->param('opac');
28 my $intra = $query->param('intra');
30 my $sth=$dbh->prepare("update subscriptionhistory set startdate=?, enddate=?,missinglist=?, recievedlist=?, opacnote=?, librariannote=? where subscriptionid = ?");
31 $sth->execute($begin, $end, $gapped, $arrived, $opac, $intra, $sid);
37 $sth = $dbh->prepare("select recievedlist from subscriptionhistory where subscriptionid = ?");
39 my $received = $sth->fetchrow;
40 $sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
42 my $val = $sth->fetchrow_hashref;
43 $sth = $dbh->prepare("update serial set serialseq = ? where subscriptionid = ? and status = 1");
44 my ($temp, $X, $Y, $Z, $Xpos, $Ypos, $Zpos) = Get_Next_Seq($val->{'numberingmethod'},$val->{'seqnum1'},$val->{'freq1'}, $val->{'step1'}, $val->{'seqtype1'}, $val->{'seqnum2'}, $val->{'freq2'}, $val->{'step2'}, $val->{'seqtype2'}, $val->{'seqnum3'}, $val->{'freq3'}, $val->{'step3'}, $val->{'seqtype3'}, $val->{'pos1'}, $val->{'pos2'}, $val->{'pos3'});
45 $sth->execute($temp, $sid);
46 $sth = $dbh->prepare("update subscription set seqnum1=?, seqnum2=?,seqnum3=?,pos1=?,pos2=?,pos3=? where subscriptionid = ?");
47 $sth->execute($X, $Y, $Z, $Xpos, $Ypos, $Zpos, $sid);
48 $sth = $dbh->prepare("update subscriptionhistory set recievedlist=? where subscriptionid = ?");
49 if (length($received) > 2)
51 $sth->execute("$received,$waited", $sid);
55 $sth->execute($waited, $sid);
61 $sth = $dbh->prepare("select missinglist from subscriptionhistory where subscriptionid = ?");
63 my $missing = $sth->fetchrow;
64 $sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
66 my $val = $sth->fetchrow_hashref;
67 $sth = $dbh->prepare("update serial set status = 2 where subscriptionid = ? and status = 1");
69 $sth = $dbh->prepare("insert into serial (serialseq,subscriptionid,biblionumber,status, planneddate) values (?,?,?,?,?)");
70 my ($temp, $X, $Y, $Z, $Xpos, $Ypos, $Zpos) = Get_Next_Seq($val->{'numberingmethod'},$val->{'seqnum1'},$val->{'freq1'}, $val->{'step1'}, $val->{'seqtype1'}, $val->{'seqnum2'}, $val->{'freq2'}, $val->{'step2'}, $val->{'seqtype2'}, $val->{'seqnum3'}, $val->{'freq3'}, $val->{'step3'}, $val->{'seqtype3'}, $val->{'pos1'}, $val->{'pos2'}, $val->{'pos3'});
71 $sth->execute($temp, $sid, $val->{'biblionumber'}, 1, 0);
72 $sth = $dbh->prepare("update subscription set seqnum1=?, seqnum2=?,seqnum3=?,pos1=?,pos2=?,pos3=? where subscriptionid = ?");
73 $sth->execute($X, $Y, $Z, $Xpos, $Ypos, $Zpos, $sid);
74 $sth = $dbh->prepare("update subscriptionhistory set missinglist=? where subscriptionid = ?");
75 if (length($missing) > 2)
77 $sth->execute("$missing,$waited", $sid);
81 $sth->execute($waited, $sid);
87 warn ("Error vous avez fait None dans le formulaire receipt\n");
93 my $sth=$dbh->prepare("select serialseq, status, planneddate from serial where subscriptionid = ? and status = ?");
94 $sth->execute($sid, 1);
95 my $sol = $sth->fetchrow_hashref;
96 my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
98 my $solhistory = $sth->fetchrow_hashref;
99 my ($template, $loggedinuser, $cookie)
100 = get_template_and_user({template_name => "bull/statecollection.tmpl",
103 authnotrequired => 0,
104 flagsrequired => {catalogue => 1},
108 my ($user, $cookie, $sessionID, $flags)
109 = checkauth($query, 0, {catalogue => 1}, "intranet");
114 status => $sol->{'status'},
115 waited => $sol->{'serialseq'},
116 begin => $solhistory->{'startdate'},
117 end => $solhistory->{'enddate'},
118 arrived => $solhistory->{'recievedlist'},
119 gapped => $solhistory->{'missinglist'},
120 opac => $solhistory->{'opacnote'},
121 intra => $solhistory->{'librariannote'},
124 output_html_with_http_headers $query, $cookie, $template->output;