Bugzilla – Attachment 26980 Details for
Bug 12022
Independent branches does not isolate pending and approved comments by branch.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12022 - Independent branches does not isolate pending and approved comments by branch.
Bug-12022---Independent-branches-does-not-isolate-.patch (text/plain), 2.55 KB, created by
Kyle M Hall (khall)
on 2014-04-10 14:33:00 UTC
(
hide
)
Description:
Bug 12022 - Independent branches does not isolate pending and approved comments by branch.
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-04-10 14:33:00 UTC
Size:
2.55 KB
patch
obsolete
>From 312b0c50814c58e61a92c39c55fc5c966997f3c5 Mon Sep 17 00:00:00 2001 >From: ByWater Staff <staff@bywatersolutions.com> >Date: Thu, 10 Apr 2014 10:15:35 -0400 >Subject: [PATCH] Bug 12022 - Independent branches does not isolate pending and approved comments by branch. > >Given Branches A and B > >Branch A patron logs on to OPAC and leaves a comment for a title. >Branch B staff is then able to see these comments in Home > Tools >> Comments > Approved comments, in both the "Approved Comments" >and "Comments awaiting moderation" tabs. > >Test Plan: >1) Create some comments for two libraries >2) Enable IndependentBranches >3) View the comments, not you see comments > from both library's patrons >4) Apply the patch for bug 10276 >5) Apply this patch >6) View the comments again, note you only > see the comments for the patrons of the > library you are logged in as. >--- > C4/Review.pm | 35 +++++++++++++++++++++++++++++------ > 1 files changed, 29 insertions(+), 6 deletions(-) > >diff --git a/C4/Review.pm b/C4/Review.pm >index dd989ed..b06a646 100644 >--- a/C4/Review.pm >+++ b/C4/Review.pm >@@ -21,6 +21,7 @@ use strict; > use warnings; > > use C4::Context; >+use C4::Branch; > > use vars qw($VERSION @ISA @EXPORT); > >@@ -123,14 +124,36 @@ sub getreviews { > } > > sub getallreviews { >- my ($status, $offset, $row_count) = @_; >- my @params = ($status,($offset ? $offset : 0),($row_count ? $row_count : 20)); >- my $dbh = C4::Context->dbh; >- my $query = >- "SELECT * FROM reviews WHERE approved=? order by datereviewed desc LIMIT ?, ?"; >+ my ( $status, $offset, $row_count ) = @_; >+ my @params; >+ my $dbh = C4::Context->dbh; >+ >+ my $query = " >+ SELECT reviews.* >+ FROM reviews >+ LEFT JOIN borrowers USING ( borrowernumber ) >+ WHERE approved = ? >+ "; >+ push( @params, $status ); >+ >+ if ( C4::Context->preference("IndependentBranches") ) { >+ unless ( C4::Context->IsSuperLibrarian() ) { >+ my @branches = GetIndependentGroupModificationRights(); >+ $query .= >+ " AND ( borrowers.branchcode IN ( " >+ . join( ',', ('?') x @branches ) >+ . " ) OR borrowers.branchcode = '')"; >+ push( @params, @branches ); >+ } >+ } >+ >+ $query .= " ORDER BY datereviewed desc LIMIT ?, ?"; >+ push( @params, ( $offset ? $offset : 0 ), >+ ( $row_count ? $row_count : 20 ) ); >+ > my $sth = $dbh->prepare($query) || warn $dbh->err_str; > $sth->execute(@params); >- return $sth->fetchall_arrayref({}); >+ return $sth->fetchall_arrayref( {} ); > } > > =head2 approvereview >-- >1.7.2.5
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 12022
:
26979
|
26980
|
54785