Bugzilla – Attachment 83036 Details for
Bug 11492
Receiving a serial item causes routing list notes to be lost
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11492: Keep routing notes when receiving next serial
Bug-11492-Keep-routing-notes-when-receiving-next-s.patch (text/plain), 7.31 KB, created by
Devinim
on 2018-12-11 12:34:17 UTC
(
hide
)
Description:
Bug 11492: Keep routing notes when receiving next serial
Filename:
MIME Type:
Creator:
Devinim
Created:
2018-12-11 12:34:17 UTC
Size:
7.31 KB
patch
obsolete
>From df9c59eaea309d896ef9855496579293f327e2c6 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Fri, 7 Dec 2018 01:03:42 +0000 >Subject: [PATCH] Bug 11492: Keep routing notes when receiving next serial >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch ensures the routing notes are carried over when generating >the next serial. > >To test: >1) Create a routing list for a subscription >2) Add a borrower and a note to the routing list >3) Generate the next serial (serials-collection.pl) >4) Edit the routing list to see the notes >5) Note that the notes have disappeared >6) Apply patch >7) Edit the routing list, add a note >8) Generate the next serial >9) Edit the routing list and confirm the note is still there >10) Confirm you are still able to edit serials (serials-edit.pl) and >routing notes stay > >Sponsored-by: Plant and Food Research Limited > >Signed-off-by: Nazlı Ãetin <nazli@devinim.com.tr> >--- > C4/Serials.pm | 18 ++++++++---------- > serials/serials-collection.pl | 5 +++-- > serials/serials-edit.pl | 3 ++- > t/db_dependent/Serials.t | 2 +- > 4 files changed, 14 insertions(+), 14 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 91498ee262..570c947df7 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1087,13 +1087,13 @@ sub ModSerialStatus { > #It is a usual serial > # 1st, get previous status : > my $dbh = C4::Context->dbh; >- my $query = "SELECT serial.subscriptionid,serial.status,subscription.periodicity >+ my $query = "SELECT serial.subscriptionid,serial.status,subscription.periodicity,serial.routingnotes > FROM serial, subscription > WHERE serial.subscriptionid=subscription.subscriptionid > AND serialid=?"; > my $sth = $dbh->prepare($query); > $sth->execute($serialid); >- my ( $subscriptionid, $oldstatus, $periodicity ) = $sth->fetchrow; >+ my ( $subscriptionid, $oldstatus, $periodicity, $routingnotes ) = $sth->fetchrow; > my $frequency = GetSubscriptionFrequency($periodicity); > > # change status & update subscriptionhistory >@@ -1101,16 +1101,15 @@ sub ModSerialStatus { > if ( $status == DELETED ) { > DelIssue( { 'serialid' => $serialid, 'subscriptionid' => $subscriptionid, 'serialseq' => $serialseq } ); > } else { >- > my $query = ' > UPDATE serial > SET serialseq = ?, publisheddate = ?, publisheddatetext = ?, >- planneddate = ?, status = ?, notes = ? >+ planneddate = ?, status = ?, notes = ?, routingnotes = ? > WHERE serialid = ? > '; > $sth = $dbh->prepare($query); > $sth->execute( $serialseq, $publisheddate, $publisheddatetext, >- $planneddate, $status, $notes, $serialid ); >+ $planneddate, $status, $notes, $routingnotes, $serialid ); > $query = "SELECT * FROM subscription WHERE subscriptionid = ?"; > $sth = $dbh->prepare($query); > $sth->execute($subscriptionid); >@@ -1164,9 +1163,7 @@ sub ModSerialStatus { > WHERE subscriptionid = ?"; > $sth = $dbh->prepare($query); > $sth->execute( $newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1, $newinnerloop2, $newinnerloop3, $subscriptionid ); >- >- NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, 1, $nextpubdate, $nextpubdate ); >- >+ NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, 1, $nextpubdate, $nextpubdate, $publisheddatetext, $notes, $routingnotes ); > # check if an alert must be sent... (= a letter is defined & status became "arrived" > if ( $subscription->{letter} && $status == ARRIVED && $oldstatus != ARRIVED ) { > require C4::Letters; >@@ -1515,7 +1512,7 @@ sub ReNewSubscription { > > =head2 NewIssue > >-NewIssue($serialseq,$subscriptionid,$biblionumber,$status, $planneddate, $publisheddate, $notes) >+NewIssue($serialseq,$subscriptionid,$biblionumber,$status, $planneddate, $publisheddate, $notes, $routingnotes) > > Create a new issue stored on the database. > Note : we have to update the recievedlist and missinglist on subscriptionhistory for this subscription. >@@ -1525,7 +1522,7 @@ returns the serial id > > sub NewIssue { > my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, >- $publisheddate, $publisheddatetext, $notes ) = @_; >+ $publisheddate, $publisheddatetext, $notes, $routingnotes ) = @_; > ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? > > return unless ($subscriptionid); >@@ -1547,6 +1544,7 @@ sub NewIssue { > publisheddate => $publisheddate, > publisheddatetext => $publisheddatetext, > notes => $notes, >+ routingnotes => $routingnotes > } > )->store(); > >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index e8735b319d..39e08f1a87 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -59,7 +59,7 @@ if($op eq 'gennext' && @subscriptionid){ > my $subscriptionid = $subscriptionid[0]; > my $sth = $dbh->prepare(" > SELECT publisheddate, publisheddatetext, serialid, serialseq, >- planneddate >+ planneddate, notes, routingnotes > FROM serial > WHERE status = 1 AND subscriptionid = ? > "); >@@ -88,7 +88,8 @@ if($op eq 'gennext' && @subscriptionid){ > my $planneddate = $date_received_today ? dt_from_string : $nextpublisheddate; > ## Creating the new issue > NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, >- 1, $planneddate, $nextpublisheddate ); >+ 1, $planneddate, $nextpublisheddate, $issue->{publisheddatetext}, >+ $issue->{notes}, $issue->{routingnotes} ); > > ## Updating the subscription seq status > my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? >diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl >index 33e11ad3bc..0b25dc4169 100755 >--- a/serials/serials-edit.pl >+++ b/serials/serials-edit.pl >@@ -238,7 +238,8 @@ if ( $op and $op eq 'serialchangestatus' ) { > $plan_date, > $pub_date, > $publisheddatetexts[$i], >- $notes[$i] >+ $notes[$i], >+ $serialdatalist[0]->{'routingnotes'} > ); > } > } >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 4c0f56a38d..7269a4735a 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -164,7 +164,7 @@ subtest 'Values should not be erased on editing' => sub { > ); > my ( undef, undef, $itemnumber ) = C4::Items::AddItemFromMarc( $item_record, $biblionumber ); > my $serialid = C4::Serials::NewIssue( "serialseq", $subscriptionid, $biblionumber, >- 1, undef, undef, "publisheddatetext", "notes" ); >+ 1, undef, undef, "publisheddatetext", "notes", "routingnotes" ); > C4::Serials::AddItem2Serial( $serialid, $itemnumber ); > my $serial_info = C4::Serials::GetSerialInformation($serialid); > my ($itemcallnumber_info) = grep { $_->{kohafield} eq 'items.itemcallnumber' } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11492
:
82945
|
82946
|
83036
|
83192
|
89675
|
89676
|
90214
|
90215