Bugzilla – Attachment 54211 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]
Bug 17089: Koha::Ratings - Remove DelRating
Bug-17089-KohaRatings---Remove-DelRating.patch (text/plain), 2.02 KB, created by
Jonathan Druart
on 2016-08-09 14:14:09 UTC
(
hide
)
Description:
Bug 17089: Koha::Ratings - Remove DelRating
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-09 14:14:09 UTC
Size:
2.02 KB
patch
obsolete
>From 1f46bf58c55372d654e9a9133238cecbb35127cf 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] Bug 17089: Koha::Ratings - Remove DelRating > >--- > 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.8.1
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