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