[Koha-patches] [PATCH] Fix for 2363
paul.poulain at biblibre.com
paul.poulain at biblibre.com
Sat Apr 18 23:46:24 CEST 2009
From: Paul Poulain <paul.poulain at biblibre.com>
There is a comma at the beginning that shouldn't be there and then there are
commas in the vol, no combo making it hard to read. it should be something
like this:
Vol 28, No 7; Vol 28, No 8; Vol 28, No 9
---
C4/Serials.pm | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/C4/Serials.pm b/C4/Serials.pm
index ace2421..68fecdf 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -1106,9 +1106,9 @@ sub ModSubscriptionHistory {
WHERE subscriptionid=?
";
my $sth = $dbh->prepare($query);
- $recievedlist =~ s/^,//g;
- $missinglist =~ s/^,//g;
- $opacnote =~ s/^,//g;
+ $recievedlist =~ s/^; //;
+ $missinglist =~ s/^; //;
+ $opacnote =~ s/^; //;
$sth->execute(
$histstartdate, $enddate, $recievedlist, $missinglist,
$opacnote, $librariannote, $subscriptionid
@@ -1164,21 +1164,22 @@ sub ModSerialStatus {
my ( $missinglist, $recievedlist ) = $sth->fetchrow;
if ( $status eq 2 ) {
-# warn "receivedlist : $recievedlist serialseq :$serialseq, ".index("$recievedlist","$serialseq");
- $recievedlist .= ",$serialseq"
+ $recievedlist .= "; $serialseq"
unless ( index( "$recievedlist", "$serialseq" ) >= 0 );
}
# warn "missinglist : $missinglist serialseq :$serialseq, ".index("$missinglist","$serialseq");
- $missinglist .= ",$serialseq"
+ $missinglist .= "; $serialseq"
if ( $status eq 4
and not index( "$missinglist", "$serialseq" ) >= 0 );
- $missinglist .= ",not issued $serialseq"
+ $missinglist .= "; not issued $serialseq"
if ( $status eq 5
and index( "$missinglist", "$serialseq" ) >= 0 );
$query =
"UPDATE subscriptionhistory SET recievedlist=?, missinglist=? WHERE subscriptionid=?";
$sth = $dbh->prepare($query);
+ $recievedlist =~ s/^; //;
+ $missinglist =~ s/^; //;
$sth->execute( $recievedlist, $missinglist, $subscriptionid );
}
}
@@ -1557,10 +1558,10 @@ sub NewIssue {
### TODO Add a feature that improves recognition and description.
### As such count (serialseq) i.e. : N18,2(N19),N20
### Would use substr and index But be careful to previous presence of ()
- $recievedlist .= ",$serialseq" unless (index($recievedlist,$serialseq)>0);
+ $recievedlist .= "; $serialseq" unless (index($recievedlist,$serialseq)>0);
}
if ( $status eq 4 ) {
- $missinglist .= ",$serialseq" unless (index($missinglist,$serialseq)>0);
+ $missinglist .= "; $serialseq" unless (index($missinglist,$serialseq)>0);
}
$query = qq|
UPDATE subscriptionhistory
@@ -1568,6 +1569,8 @@ sub NewIssue {
WHERE subscriptionid=?
|;
$sth = $dbh->prepare($query);
+ $recievedlist =~ s/^; //;
+ $missinglist =~ s/^; //;
$sth->execute( $recievedlist, $missinglist, $subscriptionid );
return $serialid;
}
--
1.5.6.3
More information about the Koha-patches
mailing list