|
Lines 353-358
sub GetFullSubscription {
Link Here
|
| 353 |
serial.serialseq, |
353 |
serial.serialseq, |
| 354 |
serial.planneddate, |
354 |
serial.planneddate, |
| 355 |
serial.publisheddate, |
355 |
serial.publisheddate, |
|
|
356 |
serial.publisheddatetext, |
| 356 |
serial.status, |
357 |
serial.status, |
| 357 |
serial.notes as notes, |
358 |
serial.notes as notes, |
| 358 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
359 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
|
Lines 514-519
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
| 514 |
serial.serialseq, |
515 |
serial.serialseq, |
| 515 |
serial.planneddate, |
516 |
serial.planneddate, |
| 516 |
serial.publisheddate, |
517 |
serial.publisheddate, |
|
|
518 |
serial.publisheddatetext, |
| 517 |
serial.status, |
519 |
serial.status, |
| 518 |
serial.notes as notes, |
520 |
serial.notes as notes, |
| 519 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
521 |
year(IF(serial.publisheddate="00-00-0000",serial.planneddate,serial.publisheddate)) as year, |
|
Lines 650-656
sub GetSerials {
Link Here
|
| 650 |
my $counter = 0; |
652 |
my $counter = 0; |
| 651 |
$count = 5 unless ($count); |
653 |
$count = 5 unless ($count); |
| 652 |
my @serials; |
654 |
my @serials; |
| 653 |
my $query = "SELECT serialid,serialseq, status, publisheddate, planneddate,notes, routingnotes |
655 |
my $query = "SELECT serialid,serialseq, status, publisheddate, |
|
|
656 |
publisheddatetext, planneddate,notes, routingnotes |
| 654 |
FROM serial |
657 |
FROM serial |
| 655 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
658 |
WHERE subscriptionid = ? AND status NOT IN (2,4,5) |
| 656 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
659 |
ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; |
|
Lines 670-676
sub GetSerials {
Link Here
|
| 670 |
} |
673 |
} |
| 671 |
|
674 |
|
| 672 |
# OK, now add the last 5 issues arrives/missing |
675 |
# OK, now add the last 5 issues arrives/missing |
| 673 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
676 |
$query = "SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
677 |
publisheddatetext, notes, routingnotes |
| 674 |
FROM serial |
678 |
FROM serial |
| 675 |
WHERE subscriptionid = ? |
679 |
WHERE subscriptionid = ? |
| 676 |
AND (status in (2,4,5)) |
680 |
AND (status in (2,4,5)) |
|
Lines 712-718
sub GetSerials2 {
Link Here
|
| 712 |
my ( $subscription, $status ) = @_; |
716 |
my ( $subscription, $status ) = @_; |
| 713 |
my $dbh = C4::Context->dbh; |
717 |
my $dbh = C4::Context->dbh; |
| 714 |
my $query = qq| |
718 |
my $query = qq| |
| 715 |
SELECT serialid,serialseq, status, planneddate, publisheddate,notes, routingnotes |
719 |
SELECT serialid,serialseq, status, planneddate, publisheddate, |
|
|
720 |
publisheddatetext, notes, routingnotes |
| 716 |
FROM serial |
721 |
FROM serial |
| 717 |
WHERE subscriptionid=$subscription AND status IN ($status) |
722 |
WHERE subscriptionid=$subscription AND status IN ($status) |
| 718 |
ORDER BY publisheddate,serialid DESC |
723 |
ORDER BY publisheddate,serialid DESC |
|
Lines 1007-1013
sub ModSubscriptionHistory {
Link Here
|
| 1007 |
|
1012 |
|
| 1008 |
=head2 ModSerialStatus |
1013 |
=head2 ModSerialStatus |
| 1009 |
|
1014 |
|
| 1010 |
ModSerialStatus($serialid,$serialseq, $planneddate,$publisheddate,$status,$notes) |
1015 |
ModSerialStatus($serialid, $serialseq, $planneddate, $publisheddate, |
|
|
1016 |
$publisheddatetext, $status, $notes); |
| 1011 |
|
1017 |
|
| 1012 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
1018 |
This function modify the serial status. Serial status is a number.(eg 2 is "arrived") |
| 1013 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
1019 |
Note : if we change from "waited" to something else,then we will have to create a new "waited" entry |
|
Lines 1015-1021
Note : if we change from "waited" to something else,then we will have to create
Link Here
|
| 1015 |
=cut |
1021 |
=cut |
| 1016 |
|
1022 |
|
| 1017 |
sub ModSerialStatus { |
1023 |
sub ModSerialStatus { |
| 1018 |
my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; |
1024 |
my ($serialid, $serialseq, $planneddate, $publisheddate, $publisheddatetext, |
|
|
1025 |
$status, $notes) = @_; |
| 1019 |
|
1026 |
|
| 1020 |
#It is a usual serial |
1027 |
#It is a usual serial |
| 1021 |
# 1st, get previous status : |
1028 |
# 1st, get previous status : |
|
Lines 1031-1040
sub ModSerialStatus {
Link Here
|
| 1031 |
DelIssue( {'serialid'=>$serialid, 'subscriptionid'=>$subscriptionid,'serialseq'=>$serialseq} ); |
1038 |
DelIssue( {'serialid'=>$serialid, 'subscriptionid'=>$subscriptionid,'serialseq'=>$serialseq} ); |
| 1032 |
} |
1039 |
} |
| 1033 |
else { |
1040 |
else { |
| 1034 |
my $query = |
1041 |
my $query = ' |
| 1035 |
'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; |
1042 |
UPDATE serial |
|
|
1043 |
SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, |
| 1044 |
planneddate = ?, status = ?, notes = ? |
| 1045 |
WHERE serialid = ? |
| 1046 |
'; |
| 1036 |
$sth = $dbh->prepare($query); |
1047 |
$sth = $dbh->prepare($query); |
| 1037 |
$sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); |
1048 |
$sth->execute( $serialseq, $publisheddate, $publisheddatetext, |
|
|
1049 |
$planneddate, $status, $notes, $serialid ); |
| 1038 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
1050 |
$query = "SELECT * FROM subscription WHERE subscriptionid = ?"; |
| 1039 |
$sth = $dbh->prepare($query); |
1051 |
$sth = $dbh->prepare($query); |
| 1040 |
$sth->execute($subscriptionid); |
1052 |
$sth->execute($subscriptionid); |
|
Lines 1390-1406
returns the serial id
Link Here
|
| 1390 |
=cut |
1402 |
=cut |
| 1391 |
|
1403 |
|
| 1392 |
sub NewIssue { |
1404 |
sub NewIssue { |
| 1393 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes ) = @_; |
1405 |
my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, |
|
|
1406 |
$publisheddate, $publisheddatetext, $notes ) = @_; |
| 1394 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
1407 |
### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? |
| 1395 |
|
1408 |
|
| 1396 |
my $dbh = C4::Context->dbh; |
1409 |
my $dbh = C4::Context->dbh; |
| 1397 |
my $query = qq| |
1410 |
my $query = qq| |
| 1398 |
INSERT INTO serial |
1411 |
INSERT INTO serial (serialseq, subscriptionid, biblionumber, status, |
| 1399 |
(serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes) |
1412 |
publisheddate, publisheddatetext, planneddate, notes) |
| 1400 |
VALUES (?,?,?,?,?,?,?) |
1413 |
VALUES (?,?,?,?,?,?,?,?) |
| 1401 |
|; |
1414 |
|; |
| 1402 |
my $sth = $dbh->prepare($query); |
1415 |
my $sth = $dbh->prepare($query); |
| 1403 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes ); |
1416 |
$sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, |
|
|
1417 |
$publisheddate, $publisheddatetext, $planneddate, $notes ); |
| 1404 |
my $serialid = $dbh->{'mysql_insertid'}; |
1418 |
my $serialid = $dbh->{'mysql_insertid'}; |
| 1405 |
$query = qq| |
1419 |
$query = qq| |
| 1406 |
SELECT missinglist,recievedlist |
1420 |
SELECT missinglist,recievedlist |