Lines 315-320
sub GetFullSubscription {
Link Here
|
315 |
serial.serialseq, |
315 |
serial.serialseq, |
316 |
serial.planneddate, |
316 |
serial.planneddate, |
317 |
serial.publisheddate, |
317 |
serial.publisheddate, |
|
|
318 |
serial.publisheddatetext, |
318 |
serial.status, |
319 |
serial.status, |
319 |
serial.notes as notes, |
320 |
serial.notes as notes, |
320 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
321 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 471-476
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
471 |
serial.serialseq, |
472 |
serial.serialseq, |
472 |
serial.planneddate, |
473 |
serial.planneddate, |
473 |
serial.publisheddate, |
474 |
serial.publisheddate, |
|
|
475 |
serial.publisheddatetext, |
474 |
serial.status, |
476 |
serial.status, |
475 |
serial.notes as notes, |
477 |
serial.notes as notes, |
476 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
478 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
Lines 714-720
sub GetSerials {
Link Here
|
714 |
my $counter = 0; |
716 |
my $counter = 0; |
715 |
$count = 5 unless ($count); |
717 |
$count = 5 unless ($count); |
716 |
my @serials; |
718 |
my @serials; |
717 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
719 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
720 |
publisheddatetext, planneddate,notes, routingnotes |
718 |
FROM serial |
721 |
FROM serial |
719 |
WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) |
722 |
WHERE subscriptionid = ? AND status NOT IN (2, 4, 41, 42, 43, 44, 5) |
720 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
723 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
Lines 734-740
sub GetSerials {
Link Here
|
734 |
} |
737 |
} |
735 |
|
738 |
|
736 |
# OK, now add the last 5 issues arrives/missing |
739 |
# OK, now add the last 5 issues arrives/missing |
737 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
740 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
741 |
publisheddatetext, notes, routingnotes |
738 |
FROM serial |
742 |
FROM serial |
739 |
WHERE subscriptionid = ? |
743 |
WHERE subscriptionid = ? |
740 |
AND (status in (2, 4, 41, 42, 43, 44, 5)) |
744 |
AND (status in (2, 4, 41, 42, 43, 44, 5)) |
Lines 779-785
sub GetSerials2 {
Link Here
|
779 |
|
783 |
|
780 |
my $dbh = C4::Context->dbh; |
784 |
my $dbh = C4::Context->dbh; |
781 |
my $query = qq| |
785 |
my $query = qq| |
782 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
786 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
787 |
publisheddatetext, notes, routingnotes |
783 |
FROM serial |
788 |
FROM serial |
784 |
WHERE subscriptionid=$subscription AND status IN ($status) |
789 |
WHERE subscriptionid=$subscription AND status IN ($status) |
785 |
ORDER BY publisheddate,serialid DESC |
790 |
ORDER BY publisheddate,serialid DESC |
Lines 1105-1111
sub ModSubscriptionHistory {
Link Here
|
1105 |
|
1110 |
|
1106 |
=head2 ModSerialStatus |
1111 |
=head2 ModSerialStatus |
1107 |
|
1112 |
|
1108 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1113 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1114 |
$publisheddatetext, $status, $notes); |
1109 |
|
1115 |
|
1110 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1116 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1111 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1117 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
Lines 1113-1119
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
1113 |
=cut |
1119 |
=cut |
1114 |
|
1120 |
|
1115 |
sub ModSerialStatus { |
1121 |
sub ModSerialStatus { |
1116 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1122 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1123 |
$status, $notes) = @_; |
1117 |
|
1124 |
|
1118 |
return unless ($serialid); |
1125 |
return unless ($serialid); |
1119 |
|
1126 |
|
Lines 1135-1143
sub ModSerialStatus {
Link Here
|
1135 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1142 |
DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); |
1136 |
} else { |
1143 |
} else { |
1137 |
|
1144 |
|
1138 |
my $query = 'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1145 |
my $query = ' |
|
|
1146 |
UPDATE serial |
1147 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
1148 |
planneddate = ?, status = ?, notes = ? |
1149 |
WHERE serialid = ? |
1150 |
'; |
1139 |
$sth = $dbh->prepare($query); |
1151 |
$sth = $dbh->prepare($query); |
1140 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1152 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1153 |
$planneddate, $status, $notes, $serialid ); |
1141 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1154 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1142 |
$sth = $dbh->prepare($query); |
1155 |
$sth = $dbh->prepare($query); |
1143 |
$sth->execute($subscriptionid); |
1156 |
$sth->execute($subscriptionid); |
Lines 1542-1560
returns the serial id
Link Here
|
1542 |
=cut |
1555 |
=cut |
1543 |
|
1556 |
|
1544 |
sub NewIssue { |
1557 |
sub NewIssue { |
1545 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1558 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1559 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
1546 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1560 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1547 |
|
1561 |
|
1548 |
return unless ($subscriptionid); |
1562 |
return unless ($subscriptionid); |
1549 |
|
1563 |
|
1550 |
my $dbh = C4::Context->dbh; |
1564 |
my $dbh = C4::Context->dbh; |
1551 |
my $query = qq| |
1565 |
my $query = qq| |
1552 |
INSERT INTO serial |
1566 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
1553 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1567 |
publisheddate, publisheddatetext, planneddate, notes) |
1554 |
VALUES (?,?,?,?,?,?,?) |
1568 |
VALUES (?,?,?,?,?,?,?,?) |
1555 |
|; |
1569 |
|; |
1556 |
my $sth = $dbh->prepare($query); |
1570 |
my $sth = $dbh->prepare($query); |
1557 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1571 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1572 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
1558 |
my $serialid = $dbh->{'mysql_insertid'}; |
1573 |
my $serialid = $dbh->{'mysql_insertid'}; |
1559 |
$query = qq| |
1574 |
$query = qq| |
1560 |
SELECT missinglist,recievedlist |
1575 |
SELECT missinglist,recievedlist |