Lines 373-378
sub GetFullSubscription {
Link Here
|
373 |
serial.serialseq, |
373 |
serial.serialseq, |
374 |
serial.planneddate, |
374 |
serial.planneddate, |
375 |
serial.publisheddate, |
375 |
serial.publisheddate, |
|
|
376 |
serial.publisheddatetext, |
376 |
serial.status, |
377 |
serial.status, |
377 |
serial.notes as notes, |
378 |
serial.notes as notes, |
378 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
379 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 529-534
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
529 |
serial.serialseq, |
530 |
serial.serialseq, |
530 |
serial.planneddate, |
531 |
serial.planneddate, |
531 |
serial.publisheddate, |
532 |
serial.publisheddate, |
|
|
533 |
serial.publisheddatetext, |
532 |
serial.status, |
534 |
serial.status, |
533 |
serial.notes as notes, |
535 |
serial.notes as notes, |
534 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
536 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 772-778
sub GetSerials {
Link Here
|
772 |
my $counter = 0; |
774 |
my $counter = 0; |
773 |
$count = 5 unless ($count); |
775 |
$count = 5 unless ($count); |
774 |
my @serials; |
776 |
my @serials; |
775 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
777 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
778 |
publisheddatetext, planneddate,notes, routingnotes |
776 |
FROM serial |
779 |
FROM serial |
777 |
WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) |
780 |
WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) |
778 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
781 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
Lines 792-798
sub GetSerials {
Link Here
|
792 |
} |
795 |
} |
793 |
|
796 |
|
794 |
# OK, now add the last 5 issues arrives/missing |
797 |
# OK, now add the last 5 issues arrives/missing |
795 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
798 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
799 |
publisheddatetext, notes, routingnotes |
796 |
FROM serial |
800 |
FROM serial |
797 |
WHERE subscriptionid = ? |
801 |
WHERE subscriptionid = ? |
798 |
AND (status in (2, 4, 41, 42, 43, 44, 5)) |
802 |
AND (status in (2, 4, 41, 42, 43, 44, 5)) |
Lines 837-843
sub GetSerials2 {
Link Here
|
837 |
|
841 |
|
838 |
my $dbh = C4::Context->dbh; |
842 |
my $dbh = C4::Context->dbh; |
839 |
my $query = qq| |
843 |
my $query = qq| |
840 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
844 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
845 |
publisheddatetext, notes, routingnotes |
841 |
FROM serial |
846 |
FROM serial |
842 |
WHERE subscriptionid=$subscription AND status IN ($status) |
847 |
WHERE subscriptionid=$subscription AND status IN ($status) |
843 |
ORDER BY publisheddate,serialid DESC |
848 |
ORDER BY publisheddate,serialid DESC |
Lines 1163-1169
sub ModSubscriptionHistory {
Link Here
|
1163 |
|
1168 |
|
1164 |
=head2 ModSerialStatus |
1169 |
=head2 ModSerialStatus |
1165 |
|
1170 |
|
1166 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1171 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1172 |
$publisheddatetext, $status, $notes); |
1167 |
|
1173 |
|
1168 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1174 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1169 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1175 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
Lines 1171-1177
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
1171 |
=cut |
1177 |
=cut |
1172 |
|
1178 |
|
1173 |
sub ModSerialStatus { |
1179 |
sub ModSerialStatus { |
1174 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1180 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1181 |
$status, $notes) = @_; |
1175 |
|
1182 |
|
1176 |
return unless ($serialid); |
1183 |
return unless ($serialid); |
1177 |
|
1184 |
|
Lines 1193-1201
sub ModSerialStatus {
Link Here
|
1193 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1200 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1194 |
} else { |
1201 |
} else { |
1195 |
|
1202 |
|
1196 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1203 |
my $query = ' |
|
|
1204 |
UPDATE serial |
1205 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
1206 |
planneddate = ?, status = ?, notes = ? |
1207 |
WHERE serialid = ? |
1208 |
'; |
1197 |
$sth = $dbh->prepare($query); |
1209 |
$sth = $dbh->prepare($query); |
1198 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1210 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1211 |
$planneddate, $status, $notes, $serialid ); |
1199 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1212 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1200 |
$sth = $dbh->prepare($query); |
1213 |
$sth = $dbh->prepare($query); |
1201 |
$sth->execute($subscriptionid); |
1214 |
$sth->execute($subscriptionid); |
Lines 1600-1618
returns the serial id
Link Here
|
1600 |
=cut |
1613 |
=cut |
1601 |
|
1614 |
|
1602 |
sub NewIssue { |
1615 |
sub NewIssue { |
1603 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1616 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1617 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
1604 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1618 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1605 |
|
1619 |
|
1606 |
return unless ($subscriptionid); |
1620 |
return unless ($subscriptionid); |
1607 |
|
1621 |
|
1608 |
my $dbh = C4::Context->dbh; |
1622 |
my $dbh = C4::Context->dbh; |
1609 |
my $query = qq| |
1623 |
my $query = qq| |
1610 |
INSERT INTO serial |
1624 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
1611 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1625 |
publisheddate, publisheddatetext, planneddate, notes) |
1612 |
VALUES (?,?,?,?,?,?,?) |
1626 |
VALUES (?,?,?,?,?,?,?,?) |
1613 |
|; |
1627 |
|; |
1614 |
my $sth = $dbh->prepare($query); |
1628 |
my $sth = $dbh->prepare($query); |
1615 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1629 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1630 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
1616 |
my $serialid = $dbh->{'mysql_insertid'}; |
1631 |
my $serialid = $dbh->{'mysql_insertid'}; |
1617 |
$query = qq| |
1632 |
$query = qq| |
1618 |
SELECT missinglist,recievedlist |
1633 |
SELECT missinglist,recievedlist |