Lines 348-353
sub GetFullSubscription {
Link Here
|
348 |
serial.serialseq, |
348 |
serial.serialseq, |
349 |
serial.planneddate, |
349 |
serial.planneddate, |
350 |
serial.publisheddate, |
350 |
serial.publisheddate, |
|
|
351 |
serial.publisheddatetext, |
351 |
serial.status, |
352 |
serial.status, |
352 |
serial.notes as notes, |
353 |
serial.notes as notes, |
353 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
354 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 504-509
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
504 |
serial.serialseq, |
505 |
serial.serialseq, |
505 |
serial.planneddate, |
506 |
serial.planneddate, |
506 |
serial.publisheddate, |
507 |
serial.publisheddate, |
|
|
508 |
serial.publisheddatetext, |
507 |
serial.status, |
509 |
serial.status, |
508 |
serial.notes as notes, |
510 |
serial.notes as notes, |
509 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
511 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 696-702
sub GetSerials {
Link Here
|
696 |
$count = 5 unless ($count); |
698 |
$count = 5 unless ($count); |
697 |
my @serials; |
699 |
my @serials; |
698 |
my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES, NOT_ISSUED ) ); |
700 |
my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES, NOT_ISSUED ) ); |
699 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
701 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
702 |
publisheddatetext, planneddate,notes, routingnotes |
700 |
FROM serial |
703 |
FROM serial |
701 |
WHERE subscriptionid = ? AND status NOT IN ( $statuses ) |
704 |
WHERE subscriptionid = ? AND status NOT IN ( $statuses ) |
702 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
705 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
Lines 716-722
sub GetSerials {
Link Here
|
716 |
} |
719 |
} |
717 |
|
720 |
|
718 |
# OK, now add the last 5 issues arrives/missing |
721 |
# OK, now add the last 5 issues arrives/missing |
719 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
722 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
723 |
publisheddatetext, notes, routingnotes |
720 |
FROM serial |
724 |
FROM serial |
721 |
WHERE subscriptionid = ? |
725 |
WHERE subscriptionid = ? |
722 |
AND status IN ( $statuses ) |
726 |
AND status IN ( $statuses ) |
Lines 765-771
sub GetSerials2 {
Link Here
|
765 |
|
769 |
|
766 |
my $dbh = C4::Context->dbh; |
770 |
my $dbh = C4::Context->dbh; |
767 |
my $query = qq| |
771 |
my $query = qq| |
768 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
772 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
773 |
publisheddatetext, notes, routingnotes |
769 |
FROM serial |
774 |
FROM serial |
770 |
WHERE subscriptionid=$subscription AND status IN ($statuses_string) |
775 |
WHERE subscriptionid=$subscription AND status IN ($statuses_string) |
771 |
ORDER BY publisheddate,serialid DESC |
776 |
ORDER BY publisheddate,serialid DESC |
Lines 1093-1099
sub ModSubscriptionHistory {
Link Here
|
1093 |
|
1098 |
|
1094 |
=head2 ModSerialStatus |
1099 |
=head2 ModSerialStatus |
1095 |
|
1100 |
|
1096 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1101 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1102 |
$publisheddatetext, $status, $notes); |
1097 |
|
1103 |
|
1098 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1104 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1099 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1105 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
Lines 1101-1107
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
1101 |
=cut |
1107 |
=cut |
1102 |
|
1108 |
|
1103 |
sub ModSerialStatus { |
1109 |
sub ModSerialStatus { |
1104 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1110 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1111 |
$status, $notes) = @_; |
1105 |
|
1112 |
|
1106 |
return unless ($serialid); |
1113 |
return unless ($serialid); |
1107 |
|
1114 |
|
Lines 1123-1131
sub ModSerialStatus {
Link Here
|
1123 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1130 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1124 |
} else { |
1131 |
} else { |
1125 |
|
1132 |
|
1126 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1133 |
my $query = ' |
|
|
1134 |
UPDATE serial |
1135 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
1136 |
planneddate = ?, status = ?, notes = ? |
1137 |
WHERE serialid = ? |
1138 |
'; |
1127 |
$sth = $dbh->prepare($query); |
1139 |
$sth = $dbh->prepare($query); |
1128 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1140 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1141 |
$planneddate, $status, $notes, $serialid ); |
1129 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1142 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1130 |
$sth = $dbh->prepare($query); |
1143 |
$sth = $dbh->prepare($query); |
1131 |
$sth->execute($subscriptionid); |
1144 |
$sth->execute($subscriptionid); |
Lines 1529-1547
returns the serial id
Link Here
|
1529 |
=cut |
1542 |
=cut |
1530 |
|
1543 |
|
1531 |
sub NewIssue { |
1544 |
sub NewIssue { |
1532 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1545 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1546 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
1533 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1547 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1534 |
|
1548 |
|
1535 |
return unless ($subscriptionid); |
1549 |
return unless ($subscriptionid); |
1536 |
|
1550 |
|
1537 |
my $dbh = C4::Context->dbh; |
1551 |
my $dbh = C4::Context->dbh; |
1538 |
my $query = qq| |
1552 |
my $query = qq| |
1539 |
INSERT INTO serial |
1553 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
1540 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1554 |
publisheddate, publisheddatetext, planneddate, notes) |
1541 |
VALUES (?,?,?,?,?,?,?) |
1555 |
VALUES (?,?,?,?,?,?,?,?) |
1542 |
|; |
1556 |
|; |
1543 |
my $sth = $dbh->prepare($query); |
1557 |
my $sth = $dbh->prepare($query); |
1544 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1558 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1559 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
1545 |
my $serialid = $dbh->{'mysql_insertid'}; |
1560 |
my $serialid = $dbh->{'mysql_insertid'}; |
1546 |
$query = qq| |
1561 |
$query = qq| |
1547 |
SELECT missinglist,recievedlist |
1562 |
SELECT missinglist,recievedlist |