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