|
Lines 354-359
sub GetFullSubscription {
Link Here
|
| 354 |
serial.serialseq, |
354 |
serial.serialseq, |
| 355 |
serial.planneddate, |
355 |
serial.planneddate, |
| 356 |
serial.publisheddate, |
356 |
serial.publisheddate, |
|
|
357 |
serial.publisheddatetext, |
| 357 |
serial.status, |
358 |
serial.status, |
| 358 |
serial.notes as notes, |
359 |
serial.notes as notes, |
| 359 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
360 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
|
Lines 515-520
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
| 515 |
serial.serialseq, |
516 |
serial.serialseq, |
| 516 |
serial.planneddate, |
517 |
serial.planneddate, |
| 517 |
serial.publisheddate, |
518 |
serial.publisheddate, |
|
|
519 |
serial.publisheddatetext, |
| 518 |
serial.status, |
520 |
serial.status, |
| 519 |
serial.notes as notes, |
521 |
serial.notes as notes, |
| 520 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
522 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
|
Lines 719-725
sub GetSerials {
Link Here
|
| 719 |
my $counter = 0; |
721 |
my $counter = 0; |
| 720 |
$count = 5 unless ($count); |
722 |
$count = 5 unless ($count); |
| 721 |
my @serials; |
723 |
my @serials; |
| 722 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
724 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
725 |
publisheddatetext, planneddate,notes, routingnotes |
| 723 |
FROM serial |
726 |
FROM serial |
| 724 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
727 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
| 725 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
728 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
|
Lines 739-745
sub GetSerials {
Link Here
|
| 739 |
} |
742 |
} |
| 740 |
|
743 |
|
| 741 |
# OK, now add the last 5 issues arrives/missing |
744 |
# OK, now add the last 5 issues arrives/missing |
| 742 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
745 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
746 |
publisheddatetext, notes, routingnotes |
| 743 |
FROM serial |
747 |
FROM serial |
| 744 |
WHERE subscriptionid = ? |
748 |
WHERE subscriptionid = ? |
| 745 |
AND (status in (2,4,5)) |
749 |
AND (status in (2,4,5)) |
|
Lines 781-787
sub GetSerials2 {
Link Here
|
| 781 |
my ( $subscription, $status ) = @_; |
785 |
my ( $subscription, $status ) = @_; |
| 782 |
my $dbh = C4::Context->dbh; |
786 |
my $dbh = C4::Context->dbh; |
| 783 |
my $query = qq| |
787 |
my $query = qq| |
| 784 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
788 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
789 |
publisheddatetext, notes, routingnotes |
| 785 |
FROM serial |
790 |
FROM serial |
| 786 |
WHERE subscriptionid=$subscription AND status IN ($status) |
791 |
WHERE subscriptionid=$subscription AND status IN ($status) |
| 787 |
ORDER BY publisheddate,serialid DESC |
792 |
ORDER BY publisheddate,serialid DESC |
|
Lines 1076-1082
sub ModSubscriptionHistory {
Link Here
|
| 1076 |
|
1081 |
|
| 1077 |
=head2 ModSerialStatus |
1082 |
=head2 ModSerialStatus |
| 1078 |
|
1083 |
|
| 1079 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1084 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1085 |
$publisheddatetext, $status, $notes); |
| 1080 |
|
1086 |
|
| 1081 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1087 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
| 1082 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1088 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
|
Lines 1084-1090
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
| 1084 |
=cut |
1090 |
=cut |
| 1085 |
|
1091 |
|
| 1086 |
sub ModSerialStatus { |
1092 |
sub ModSerialStatus { |
| 1087 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1093 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1094 |
$status, $notes) = @_; |
| 1088 |
|
1095 |
|
| 1089 |
#It is a usual serial |
1096 |
#It is a usual serial |
| 1090 |
# 1st, get previous status : |
1097 |
# 1st, get previous status : |
|
Lines 1100-1109
sub ModSerialStatus {
Link Here
|
| 1100 |
DelIssue( {'serialid'=>$serialid, 'subscriptionid'=>$subscriptionid,'serialseq'=>$serialseq} ); |
1107 |
DelIssue( {'serialid'=>$serialid, 'subscriptionid'=>$subscriptionid,'serialseq'=>$serialseq} ); |
| 1101 |
} |
1108 |
} |
| 1102 |
else { |
1109 |
else { |
| 1103 |
my $query = |
1110 |
my $query = ' |
| 1104 |
'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1111 |
UPDATE serial |
|
|
1112 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
| 1113 |
planneddate = ?, status = ?, notes = ? |
| 1114 |
WHERE serialid = ? |
| 1115 |
'; |
| 1105 |
$sth = $dbh->prepare($query); |
1116 |
$sth = $dbh->prepare($query); |
| 1106 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1117 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1118 |
$planneddate, $status, $notes, $serialid ); |
| 1107 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1119 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
| 1108 |
$sth = $dbh->prepare($query); |
1120 |
$sth = $dbh->prepare($query); |
| 1109 |
$sth->execute($subscriptionid); |
1121 |
$sth->execute($subscriptionid); |
|
Lines 1459-1475
returns the serial id
Link Here
|
| 1459 |
=cut |
1471 |
=cut |
| 1460 |
|
1472 |
|
| 1461 |
sub NewIssue { |
1473 |
sub NewIssue { |
| 1462 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1474 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1475 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
| 1463 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1476 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
| 1464 |
|
1477 |
|
| 1465 |
my $dbh = C4::Context->dbh; |
1478 |
my $dbh = C4::Context->dbh; |
| 1466 |
my $query = qq| |
1479 |
my $query = qq| |
| 1467 |
INSERT INTO serial |
1480 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
| 1468 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1481 |
publisheddate, publisheddatetext, planneddate, notes) |
| 1469 |
VALUES (?,?,?,?,?,?,?) |
1482 |
VALUES (?,?,?,?,?,?,?,?) |
| 1470 |
|; |
1483 |
|; |
| 1471 |
my $sth = $dbh->prepare($query); |
1484 |
my $sth = $dbh->prepare($query); |
| 1472 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1485 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1486 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
| 1473 |
my $serialid = $dbh->{'mysql_insertid'}; |
1487 |
my $serialid = $dbh->{'mysql_insertid'}; |
| 1474 |
$query = qq| |
1488 |
$query = qq| |
| 1475 |
SELECT missinglist,recievedlist |
1489 |
SELECT missinglist,recievedlist |