From 7e35f340d15ac2fde5b133ded2bd8e6f344e7092 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Sat, 18 Apr 2009 23:46:24 +0200 Subject: [PATCH] Fix for 2363 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 Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Serials.pm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index ace2421410..68fecdf4fc 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; } -- 2.39.5