Lines 368-373
sub GetFullSubscription {
Link Here
|
368 |
serial.serialseq, |
368 |
serial.serialseq, |
369 |
serial.planneddate, |
369 |
serial.planneddate, |
370 |
serial.publisheddate, |
370 |
serial.publisheddate, |
|
|
371 |
serial.publisheddatetext, |
371 |
serial.status, |
372 |
serial.status, |
372 |
serial.notes as notes, |
373 |
serial.notes as notes, |
373 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
374 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 522-527
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
522 |
serial.serialseq, |
523 |
serial.serialseq, |
523 |
serial.planneddate, |
524 |
serial.planneddate, |
524 |
serial.publisheddate, |
525 |
serial.publisheddate, |
|
|
526 |
serial.publisheddatetext, |
525 |
serial.status, |
527 |
serial.status, |
526 |
serial.notes as notes, |
528 |
serial.notes as notes, |
527 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
529 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 742-748
sub GetSerials {
Link Here
|
742 |
my $counter = 0; |
744 |
my $counter = 0; |
743 |
$count = 5 unless ($count); |
745 |
$count = 5 unless ($count); |
744 |
my @serials; |
746 |
my @serials; |
745 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
747 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
748 |
publisheddatetext, planneddate,notes, routingnotes |
746 |
FROM serial |
749 |
FROM serial |
747 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
750 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
748 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
751 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
Lines 762-768
sub GetSerials {
Link Here
|
762 |
} |
765 |
} |
763 |
|
766 |
|
764 |
# OK, now add the last 5 issues arrives/missing |
767 |
# OK, now add the last 5 issues arrives/missing |
765 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
768 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
769 |
publisheddatetext, notes, routingnotes |
766 |
FROM serial |
770 |
FROM serial |
767 |
WHERE subscriptionid = ? |
771 |
WHERE subscriptionid = ? |
768 |
AND (status in (2,4,5)) |
772 |
AND (status in (2,4,5)) |
Lines 807-813
sub GetSerials2 {
Link Here
|
807 |
|
811 |
|
808 |
my $dbh = C4::Context->dbh; |
812 |
my $dbh = C4::Context->dbh; |
809 |
my $query = qq| |
813 |
my $query = qq| |
810 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
814 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
815 |
publisheddatetext, notes, routingnotes |
811 |
FROM serial |
816 |
FROM serial |
812 |
WHERE subscriptionid=$subscription AND status IN ($status) |
817 |
WHERE subscriptionid=$subscription AND status IN ($status) |
813 |
ORDER BY publisheddate,serialid DESC |
818 |
ORDER BY publisheddate,serialid DESC |
Lines 1177-1183
sub _update_receivedlist {
Link Here
|
1177 |
|
1182 |
|
1178 |
=head2 ModSerialStatus |
1183 |
=head2 ModSerialStatus |
1179 |
|
1184 |
|
1180 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1185 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1186 |
$publisheddatetext, $status, $notes); |
1181 |
|
1187 |
|
1182 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1188 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1183 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1189 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
Lines 1185-1191
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
1185 |
=cut |
1191 |
=cut |
1186 |
|
1192 |
|
1187 |
sub ModSerialStatus { |
1193 |
sub ModSerialStatus { |
1188 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1194 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1195 |
$status, $notes) = @_; |
1189 |
|
1196 |
|
1190 |
return unless ($serialid); |
1197 |
return unless ($serialid); |
1191 |
|
1198 |
|
Lines 1211-1219
sub ModSerialStatus {
Link Here
|
1211 |
if ( not $planneddate or $planneddate eq '0000-00-00' ) { $planneddate = C4::Dates->new()->output('iso') }; |
1218 |
if ( not $planneddate or $planneddate eq '0000-00-00' ) { $planneddate = C4::Dates->new()->output('iso') }; |
1212 |
if ( not $publisheddate or $publisheddate eq '0000-00-00' ) { $publisheddate = C4::Dates->new()->output('iso') }; |
1219 |
if ( not $publisheddate or $publisheddate eq '0000-00-00' ) { $publisheddate = C4::Dates->new()->output('iso') }; |
1213 |
} |
1220 |
} |
1214 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1221 |
my $query = ' |
|
|
1222 |
UPDATE serial |
1223 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
1224 |
planneddate = ?, status = ?, notes = ? |
1225 |
WHERE serialid = ? |
1226 |
'; |
1215 |
$sth = $dbh->prepare($query); |
1227 |
$sth = $dbh->prepare($query); |
1216 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1228 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1229 |
$planneddate, $status, $notes, $serialid ); |
1217 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1230 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1218 |
$sth = $dbh->prepare($query); |
1231 |
$sth = $dbh->prepare($query); |
1219 |
$sth->execute($subscriptionid); |
1232 |
$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 |