Bugzilla – Attachment 10342 Details for
Bug 8260
Deleting patrons leaves holes in routing list ranking
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Force re-order of routing list rankings on page load
0001-Bug-8260-Correction-Routing-List-Ranking-Re-order.patch (text/plain), 2.26 KB, created by
David Cook
on 2012-06-18 03:13:54 UTC
(
hide
)
Description:
Force re-order of routing list rankings on page load
Filename:
MIME Type:
Creator:
David Cook
Created:
2012-06-18 03:13:54 UTC
Size:
2.26 KB
patch
obsolete
>From 1ddf1d240abf0e81ad4a532cebdef5e0ed4ad6aa Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 18 Jun 2012 13:02:42 +1000 >Subject: [PATCH] Bug 8260 Correction: Routing List Ranking Re-order >Content-Type: text/plain; charset="utf-8" > >--- > C4/Serials.pm | 25 +++++++++++++++++++++++++ > serials/routing.pl | 2 ++ > 2 files changed, 27 insertions(+), 0 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 8e5bbcb..bb74a6c 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -50,6 +50,7 @@ BEGIN { > &GetDistributedTo &SetDistributedTo > &getroutinglist &delroutingmember &addroutingmember > &reorder_members >+ &reorder_member_ranking > &check_routing &updateClaim &removeMissingIssue > &CountIssues > HasItems >@@ -2000,6 +2001,30 @@ sub reorder_members { > return; > } > >+=head2 reorder_member_ranking >+ >+reorder_member_ranking($subscriptionid) >+ >+this function is used to reorder the routing list without adding or deleting any members, which is necessary when the ranking goes out of sync due to the cascading delete of a borrower >+ >+=cut >+ >+sub reorder_member_ranking { >+ my ( $subscriptionid, $routingid, $rank ) = @_; >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare( "SELECT * FROM subscriptionroutinglist WHERE subscriptionid = ? ORDER BY ranking ASC" ); >+ $sth->execute($subscriptionid); >+ my @result; >+ while ( my $line = $sth->fetchrow_hashref ) { >+ push( @result, $line->{'routingid'} ); >+ } >+ >+ for ( my $j = 0 ; $j < @result ; $j++ ) { >+ my $sth = $dbh->prepare( "UPDATE subscriptionroutinglist SET ranking = '" . ( $j + 1 ) . "' WHERE routingid = '" . $result[$j] . "'" ); >+ $sth->execute; >+ } >+} >+ > =head2 delroutingmember > > delroutingmember($routingid,$subscriptionid) >diff --git a/serials/routing.pl b/serials/routing.pl >index a95631b..0c5ac9f 100755 >--- a/serials/routing.pl >+++ b/serials/routing.pl >@@ -66,6 +66,8 @@ if($op eq 'save'){ > print $query->redirect("routing-preview.pl?subscriptionid=$subscriptionid&issue=$urldate"); > } > >+reorder_member_ranking($subscriptionid); >+ > my @routinglist = getroutinglist($subscriptionid); > my $subs = GetSubscription($subscriptionid); > my ($count,@serials) = GetSerials($subscriptionid); >-- >1.7.7.4 >
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 8260
:
10342
|
90393
|
94215
|
94226