|
Lines 338-343
sub GetFullSubscription {
Link Here
|
| 338 |
serial.serialseq, |
338 |
serial.serialseq, |
| 339 |
serial.planneddate, |
339 |
serial.planneddate, |
| 340 |
serial.publisheddate, |
340 |
serial.publisheddate, |
|
|
341 |
serial.publisheddatetext, |
| 341 |
serial.status, |
342 |
serial.status, |
| 342 |
serial.notes as notes, |
343 |
serial.notes as notes, |
| 343 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
344 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
|
Lines 494-499
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
| 494 |
serial.serialseq, |
495 |
serial.serialseq, |
| 495 |
serial.planneddate, |
496 |
serial.planneddate, |
| 496 |
serial.publisheddate, |
497 |
serial.publisheddate, |
|
|
498 |
serial.publisheddatetext, |
| 497 |
serial.status, |
499 |
serial.status, |
| 498 |
serial.notes as notes, |
500 |
serial.notes as notes, |
| 499 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
501 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
|
Lines 662-668
sub GetSerials {
Link Here
|
| 662 |
$count = 5 unless ($count); |
664 |
$count = 5 unless ($count); |
| 663 |
my @serials; |
665 |
my @serials; |
| 664 |
my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES, NOT_ISSUED ) ); |
666 |
my $statuses = join( ',', ( ARRIVED, MISSING_STATUSES, NOT_ISSUED ) ); |
| 665 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
667 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
668 |
publisheddatetext, planneddate,notes, routingnotes |
| 666 |
FROM serial |
669 |
FROM serial |
| 667 |
WHERE subscriptionid = ? AND status NOT IN ( $statuses ) |
670 |
WHERE subscriptionid = ? AND status NOT IN ( $statuses ) |
| 668 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
671 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
|
Lines 682-688
sub GetSerials {
Link Here
|
| 682 |
} |
685 |
} |
| 683 |
|
686 |
|
| 684 |
# OK, now add the last 5 issues arrives/missing |
687 |
# OK, now add the last 5 issues arrives/missing |
| 685 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
688 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
689 |
publisheddatetext, notes, routingnotes |
| 686 |
FROM serial |
690 |
FROM serial |
| 687 |
WHERE subscriptionid = ? |
691 |
WHERE subscriptionid = ? |
| 688 |
AND status IN ( $statuses ) |
692 |
AND status IN ( $statuses ) |
|
Lines 731-737
sub GetSerials2 {
Link Here
|
| 731 |
|
735 |
|
| 732 |
my $dbh = C4::Context->dbh; |
736 |
my $dbh = C4::Context->dbh; |
| 733 |
my $query = qq| |
737 |
my $query = qq| |
| 734 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
738 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
739 |
publisheddatetext, notes, routingnotes |
| 735 |
FROM serial |
740 |
FROM serial |
| 736 |
WHERE subscriptionid=$subscription AND status IN ($statuses_string) |
741 |
WHERE subscriptionid=$subscription AND status IN ($statuses_string) |
| 737 |
ORDER BY publisheddate,serialid DESC |
742 |
ORDER BY publisheddate,serialid DESC |
|
Lines 1059-1065
sub ModSubscriptionHistory {
Link Here
|
| 1059 |
|
1064 |
|
| 1060 |
=head2 ModSerialStatus |
1065 |
=head2 ModSerialStatus |
| 1061 |
|
1066 |
|
| 1062 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1067 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1068 |
$publisheddatetext, $status, $notes); |
| 1063 |
|
1069 |
|
| 1064 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1070 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
| 1065 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1071 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
|
Lines 1067-1073
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
| 1067 |
=cut |
1073 |
=cut |
| 1068 |
|
1074 |
|
| 1069 |
sub ModSerialStatus { |
1075 |
sub ModSerialStatus { |
| 1070 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1076 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1077 |
$status, $notes) = @_; |
| 1071 |
|
1078 |
|
| 1072 |
return unless ($serialid); |
1079 |
return unless ($serialid); |
| 1073 |
|
1080 |
|
|
Lines 1089-1097
sub ModSerialStatus {
Link Here
|
| 1089 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1096 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
| 1090 |
} else { |
1097 |
} else { |
| 1091 |
|
1098 |
|
| 1092 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1099 |
my $query = ' |
|
|
1100 |
UPDATE serial |
| 1101 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
| 1102 |
planneddate = ?, status = ?, notes = ? |
| 1103 |
WHERE serialid = ? |
| 1104 |
'; |
| 1093 |
$sth = $dbh->prepare($query); |
1105 |
$sth = $dbh->prepare($query); |
| 1094 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1106 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1107 |
$planneddate, $status, $notes, $serialid ); |
| 1095 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1108 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
| 1096 |
$sth = $dbh->prepare($query); |
1109 |
$sth = $dbh->prepare($query); |
| 1097 |
$sth->execute($subscriptionid); |
1110 |
$sth->execute($subscriptionid); |
|
Lines 1495-1513
returns the serial id
Link Here
|
| 1495 |
=cut |
1508 |
=cut |
| 1496 |
|
1509 |
|
| 1497 |
sub NewIssue { |
1510 |
sub NewIssue { |
| 1498 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1511 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1512 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
| 1499 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1513 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
| 1500 |
|
1514 |
|
| 1501 |
return unless ($subscriptionid); |
1515 |
return unless ($subscriptionid); |
| 1502 |
|
1516 |
|
| 1503 |
my $dbh = C4::Context->dbh; |
1517 |
my $dbh = C4::Context->dbh; |
| 1504 |
my $query = qq| |
1518 |
my $query = qq| |
| 1505 |
INSERT INTO serial |
1519 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
| 1506 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1520 |
publisheddate, publisheddatetext, planneddate, notes) |
| 1507 |
VALUES (?,?,?,?,?,?,?) |
1521 |
VALUES (?,?,?,?,?,?,?,?) |
| 1508 |
|; |
1522 |
|; |
| 1509 |
my $sth = $dbh->prepare($query); |
1523 |
my $sth = $dbh->prepare($query); |
| 1510 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1524 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1525 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
| 1511 |
my $serialid = $dbh->{'mysql_insertid'}; |
1526 |
my $serialid = $dbh->{'mysql_insertid'}; |
| 1512 |
$query = qq| |
1527 |
$query = qq| |
| 1513 |
SELECT missinglist,recievedlist |
1528 |
SELECT missinglist,recievedlist |