Lines 369-374
sub GetFullSubscription {
Link Here
|
369 |
serial.serialseq, |
369 |
serial.serialseq, |
370 |
serial.planneddate, |
370 |
serial.planneddate, |
371 |
serial.publisheddate, |
371 |
serial.publisheddate, |
|
|
372 |
serial.publisheddatetext, |
372 |
serial.status, |
373 |
serial.status, |
373 |
serial.notes as notes, |
374 |
serial.notes as notes, |
374 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
375 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 525-530
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
525 |
serial.serialseq, |
526 |
serial.serialseq, |
526 |
serial.planneddate, |
527 |
serial.planneddate, |
527 |
serial.publisheddate, |
528 |
serial.publisheddate, |
|
|
529 |
serial.publisheddatetext, |
528 |
serial.status, |
530 |
serial.status, |
529 |
serial.notes as notes, |
531 |
serial.notes as notes, |
530 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
532 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 768-774
sub GetSerials {
Link Here
|
768 |
my $counter = 0; |
770 |
my $counter = 0; |
769 |
$count = 5 unless ($count); |
771 |
$count = 5 unless ($count); |
770 |
my @serials; |
772 |
my @serials; |
771 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
773 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
774 |
publisheddatetext, planneddate,notes, routingnotes |
772 |
FROM serial |
775 |
FROM serial |
773 |
WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) |
776 |
WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) |
774 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
777 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
Lines 788-794
sub GetSerials {
Link Here
|
788 |
} |
791 |
} |
789 |
|
792 |
|
790 |
# OK, now add the last 5 issues arrives/missing |
793 |
# OK, now add the last 5 issues arrives/missing |
791 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
794 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
795 |
publisheddatetext, notes, routingnotes |
792 |
FROM serial |
796 |
FROM serial |
793 |
WHERE subscriptionid = ? |
797 |
WHERE subscriptionid = ? |
794 |
AND (status in (2, 4, 41, 42, 43, 44, 5)) |
798 |
AND (status in (2, 4, 41, 42, 43, 44, 5)) |
Lines 833-839
sub GetSerials2 {
Link Here
|
833 |
|
837 |
|
834 |
my $dbh = C4::Context->dbh; |
838 |
my $dbh = C4::Context->dbh; |
835 |
my $query = qq| |
839 |
my $query = qq| |
836 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
840 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
841 |
publisheddatetext, notes, routingnotes |
837 |
FROM serial |
842 |
FROM serial |
838 |
WHERE subscriptionid=$subscription AND status IN ($status) |
843 |
WHERE subscriptionid=$subscription AND status IN ($status) |
839 |
ORDER BY publisheddate,serialid DESC |
844 |
ORDER BY publisheddate,serialid DESC |
Lines 1159-1165
sub ModSubscriptionHistory {
Link Here
|
1159 |
|
1164 |
|
1160 |
=head2 ModSerialStatus |
1165 |
=head2 ModSerialStatus |
1161 |
|
1166 |
|
1162 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1167 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1168 |
$publisheddatetext, $status, $notes); |
1163 |
|
1169 |
|
1164 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1170 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1165 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1171 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
Lines 1167-1173
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
1167 |
=cut |
1173 |
=cut |
1168 |
|
1174 |
|
1169 |
sub ModSerialStatus { |
1175 |
sub ModSerialStatus { |
1170 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1176 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1177 |
$status, $notes) = @_; |
1171 |
|
1178 |
|
1172 |
return unless ($serialid); |
1179 |
return unless ($serialid); |
1173 |
|
1180 |
|
Lines 1189-1197
sub ModSerialStatus {
Link Here
|
1189 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1196 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1190 |
} else { |
1197 |
} else { |
1191 |
|
1198 |
|
1192 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1199 |
my $query = ' |
|
|
1200 |
UPDATE serial |
1201 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
1202 |
planneddate = ?, status = ?, notes = ? |
1203 |
WHERE serialid = ? |
1204 |
'; |
1193 |
$sth = $dbh->prepare($query); |
1205 |
$sth = $dbh->prepare($query); |
1194 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1206 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1207 |
$planneddate, $status, $notes, $serialid ); |
1195 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1208 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1196 |
$sth = $dbh->prepare($query); |
1209 |
$sth = $dbh->prepare($query); |
1197 |
$sth->execute($subscriptionid); |
1210 |
$sth->execute($subscriptionid); |
Lines 1596-1614
returns the serial id
Link Here
|
1596 |
=cut |
1609 |
=cut |
1597 |
|
1610 |
|
1598 |
sub NewIssue { |
1611 |
sub NewIssue { |
1599 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1612 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1613 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
1600 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1614 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1601 |
|
1615 |
|
1602 |
return unless ($subscriptionid); |
1616 |
return unless ($subscriptionid); |
1603 |
|
1617 |
|
1604 |
my $dbh = C4::Context->dbh; |
1618 |
my $dbh = C4::Context->dbh; |
1605 |
my $query = qq| |
1619 |
my $query = qq| |
1606 |
INSERT INTO serial |
1620 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
1607 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1621 |
publisheddate, publisheddatetext, planneddate, notes) |
1608 |
VALUES (?,?,?,?,?,?,?) |
1622 |
VALUES (?,?,?,?,?,?,?,?) |
1609 |
|; |
1623 |
|; |
1610 |
my $sth = $dbh->prepare($query); |
1624 |
my $sth = $dbh->prepare($query); |
1611 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1625 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1626 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
1612 |
my $serialid = $dbh->{'mysql_insertid'}; |
1627 |
my $serialid = $dbh->{'mysql_insertid'}; |
1613 |
$query = qq| |
1628 |
$query = qq| |
1614 |
SELECT missinglist,recievedlist |
1629 |
SELECT missinglist,recievedlist |