Lines 363-368
sub GetFullSubscription {
Link Here
|
363 |
serial.serialseq, |
363 |
serial.serialseq, |
364 |
serial.planneddate, |
364 |
serial.planneddate, |
365 |
serial.publisheddate, |
365 |
serial.publisheddate, |
|
|
366 |
serial.publisheddatetext, |
366 |
serial.status, |
367 |
serial.status, |
367 |
serial.notes as notes, |
368 |
serial.notes as notes, |
368 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
369 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 524-529
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
524 |
serial.serialseq, |
525 |
serial.serialseq, |
525 |
serial.planneddate, |
526 |
serial.planneddate, |
526 |
serial.publisheddate, |
527 |
serial.publisheddate, |
|
|
528 |
serial.publisheddatetext, |
527 |
serial.status, |
529 |
serial.status, |
528 |
serial.notes as notes, |
530 |
serial.notes as notes, |
529 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
531 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 739-745
sub GetSerials {
Link Here
|
739 |
my $counter = 0; |
741 |
my $counter = 0; |
740 |
$count = 5 unless ($count); |
742 |
$count = 5 unless ($count); |
741 |
my @serials; |
743 |
my @serials; |
742 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
744 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
745 |
publisheddatetext, planneddate,notes, routingnotes |
743 |
FROM serial |
746 |
FROM serial |
744 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
747 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
745 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
748 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
Lines 759-765
sub GetSerials {
Link Here
|
759 |
} |
762 |
} |
760 |
|
763 |
|
761 |
# OK, now add the last 5 issues arrives/missing |
764 |
# OK, now add the last 5 issues arrives/missing |
762 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
765 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
766 |
publisheddatetext, notes, routingnotes |
763 |
FROM serial |
767 |
FROM serial |
764 |
WHERE subscriptionid = ? |
768 |
WHERE subscriptionid = ? |
765 |
AND (status in (2,4,5)) |
769 |
AND (status in (2,4,5)) |
Lines 801-807
sub GetSerials2 {
Link Here
|
801 |
my ( $subscription, $status ) = @_; |
805 |
my ( $subscription, $status ) = @_; |
802 |
my $dbh = C4::Context->dbh; |
806 |
my $dbh = C4::Context->dbh; |
803 |
my $query = qq| |
807 |
my $query = qq| |
804 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
808 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
809 |
publisheddatetext, notes, routingnotes |
805 |
FROM serial |
810 |
FROM serial |
806 |
WHERE subscriptionid=$subscription AND status IN ($status) |
811 |
WHERE subscriptionid=$subscription AND status IN ($status) |
807 |
ORDER BY publisheddate,serialid DESC |
812 |
ORDER BY publisheddate,serialid DESC |
Lines 1096-1102
sub ModSubscriptionHistory {
Link Here
|
1096 |
|
1101 |
|
1097 |
=head2 ModSerialStatus |
1102 |
=head2 ModSerialStatus |
1098 |
|
1103 |
|
1099 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1104 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1105 |
$publisheddatetext, $status, $notes); |
1100 |
|
1106 |
|
1101 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1107 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1102 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1108 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
Lines 1104-1110
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
1104 |
=cut |
1110 |
=cut |
1105 |
|
1111 |
|
1106 |
sub ModSerialStatus { |
1112 |
sub ModSerialStatus { |
1107 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1113 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1114 |
$status, $notes) = @_; |
1108 |
|
1115 |
|
1109 |
#It is a usual serial |
1116 |
#It is a usual serial |
1110 |
# 1st, get previous status : |
1117 |
# 1st, get previous status : |
Lines 1120-1129
sub ModSerialStatus {
Link Here
|
1120 |
DelIssue( {'serialid'=>$serialid, 'subscriptionid'=>$subscriptionid,'serialseq'=>$serialseq} ); |
1127 |
DelIssue( {'serialid'=>$serialid, 'subscriptionid'=>$subscriptionid,'serialseq'=>$serialseq} ); |
1121 |
} |
1128 |
} |
1122 |
else { |
1129 |
else { |
1123 |
my $query = |
1130 |
my $query = ' |
1124 |
'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1131 |
UPDATE serial |
|
|
1132 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
1133 |
planneddate = ?, status = ?, notes = ? |
1134 |
WHERE serialid = ? |
1135 |
'; |
1125 |
$sth = $dbh->prepare($query); |
1136 |
$sth = $dbh->prepare($query); |
1126 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1137 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1138 |
$planneddate, $status, $notes, $serialid ); |
1127 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1139 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1128 |
$sth = $dbh->prepare($query); |
1140 |
$sth = $dbh->prepare($query); |
1129 |
$sth->execute($subscriptionid); |
1141 |
$sth->execute($subscriptionid); |
Lines 1479-1495
returns the serial id
Link Here
|
1479 |
=cut |
1491 |
=cut |
1480 |
|
1492 |
|
1481 |
sub NewIssue { |
1493 |
sub NewIssue { |
1482 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1494 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1495 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
1483 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1496 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1484 |
|
1497 |
|
1485 |
my $dbh = C4::Context->dbh; |
1498 |
my $dbh = C4::Context->dbh; |
1486 |
my $query = qq| |
1499 |
my $query = qq| |
1487 |
INSERT INTO serial |
1500 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
1488 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1501 |
publisheddate, publisheddatetext, planneddate, notes) |
1489 |
VALUES (?,?,?,?,?,?,?) |
1502 |
VALUES (?,?,?,?,?,?,?,?) |
1490 |
|; |
1503 |
|; |
1491 |
my $sth = $dbh->prepare($query); |
1504 |
my $sth = $dbh->prepare($query); |
1492 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1505 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1506 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
1493 |
my $serialid = $dbh->{'mysql_insertid'}; |
1507 |
my $serialid = $dbh->{'mysql_insertid'}; |
1494 |
$query = qq| |
1508 |
$query = qq| |
1495 |
SELECT missinglist,recievedlist |
1509 |
SELECT missinglist,recievedlist |