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