Bugzilla – Attachment 54234 Details for
Bug 17089
Move the star ratings related code to Koha::Ratings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17089: Koha::Ratings - Remove DelRating
SIGNED-OFF-Bug-17089-KohaRatings---Remove-DelRatin.patch (text/plain), 2.12 KB, created by
Owen Leonard
on 2016-08-09 16:40:40 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17089: Koha::Ratings - Remove DelRating
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-08-09 16:40:40 UTC
Size:
2.12 KB
patch
obsolete
>From 6199508db6aee8175668bb3ecb7063bb9e2ae2da Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 12 Jul 2016 11:28:57 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 17089: Koha::Ratings - Remove DelRating >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Ratings.pm | 27 --------------------------- > opac/opac-ratings-ajax.pl | 4 ++-- > 2 files changed, 2 insertions(+), 29 deletions(-) > >diff --git a/C4/Ratings.pm b/C4/Ratings.pm >index 0ec6e03..061d42b 100644 >--- a/C4/Ratings.pm >+++ b/C4/Ratings.pm >@@ -35,7 +35,6 @@ BEGIN { > > @EXPORT = qw( > &GetRating >- &DelRating > ); > } > >@@ -57,9 +56,6 @@ Get a rating for a bib > my $rating_hashref = GetRating( $biblionumber, undef ); > my $rating_hashref = GetRating( $biblionumber, $borrowernumber ); > >-Delete a rating for a bib >- my $rating_hashref = DelRating( $biblionumber, $borrowernumber ); >- > > All subroutines in Ratings.pm return a hashref which contain 4 keys > >@@ -184,28 +180,5 @@ sub GetRating { > return \%rating_hash; > } > >-=head2 DelRating >- >- my $rating_hashref = DelRating( $biblionumber, $borrowernumber ); >- >-Delete a rating for a bib >- >-=cut >- >-sub DelRating { >- my ( $biblionumber, $borrowernumber ) = @_; >- >- my $rating = Koha::Database->new()->schema->resultset('Rating')->find( >- { >- borrowernumber => $borrowernumber, >- biblionumber => $biblionumber >- } >- ); >- >- $rating->delete() if $rating; >- >- return GetRating($biblionumber); >-} >- > 1; > __END__ >diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl >index 63e2ebc..a99a335 100755 >--- a/opac/opac-ratings-ajax.pl >+++ b/opac/opac-ratings-ajax.pl >@@ -73,8 +73,8 @@ my $rating; > $rating_value //= ''; > > if ( $rating_value eq '' ) { >-#### delete >- $rating = DelRating( $biblionumber, $loggedinuser ); >+ Koha::Ratings->find( { biblionumber => $biblionumber, borrowernumber => $loggedinuser } )->delete; >+ $rating = Koha::Ratings->search({ biblionumber => $biblionumber })->get_rating; > } > > elsif ( $rating_value and !$rating_old_value ) { >-- >2.1.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 17089
:
54207
|
54208
|
54209
|
54210
|
54211
|
54212
|
54213
|
54214
|
54225
|
54230
|
54231
|
54232
|
54233
|
54234
|
54235
|
54236
|
54237
|
54238
|
54332
|
54333
|
54334
|
54335
|
54336
|
54337
|
54338
|
54339
|
54340
|
54341