Bugzilla – Attachment 54207 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 - Add Koha::Rating[s] classes
Bug-17089-KohaRatings---Add-KohaRatings-classes.patch (text/plain), 3.48 KB, created by
Jonathan Druart
on 2016-08-09 14:13:46 UTC
(
hide
)
Description:
Bug 17089: Koha::Ratings - Add Koha::Rating[s] classes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-09 14:13:46 UTC
Size:
3.48 KB
patch
obsolete
>From b6d0f3c41ce7421474cac14220430452ce62146b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 12 Jul 2016 11:28:25 +0100 >Subject: [PATCH] Bug 17089: Koha::Ratings - Add Koha::Rating[s] classes > >The subroutines in C4::Ratings are only CRUD operations. >This patch set moves the entire module to Koha::Rating[s] based on >Koha::Object[s] > >Test plan for the whole patch set: >0/ Set OpacStarRatings to "results and details" >1/ Log in at the OPAC >2/ Launch a search, you should see the star ratings >3/ Go on a detail page, you should see the star ratings >4/ Rate the record >5/ Log in with another patron >6/ Go on the same detail page, you should see the previous rating >7/ Rate the racord, you should see "2 votes" and the average rating >value. >8/ Cancel your rate >9/ Disable JavaScript and repeat 7 > >Note: You cannot cancel your rate if JavaScript is disabled (not a >regression). >--- > Koha/Rating.pm | 44 ++++++++++++++++++++++++++++++++++++++++++++ > Koha/Ratings.pm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 94 insertions(+) > create mode 100644 Koha/Rating.pm > create mode 100644 Koha/Ratings.pm > >diff --git a/Koha/Rating.pm b/Koha/Rating.pm >new file mode 100644 >index 0000000..1bdeb69 >--- /dev/null >+++ b/Koha/Rating.pm >@@ -0,0 +1,44 @@ >+package Koha::Rating; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::Rating - Koha Rating Object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'Rating'; >+} >+ >+1; >diff --git a/Koha/Ratings.pm b/Koha/Ratings.pm >new file mode 100644 >index 0000000..27ee47e >--- /dev/null >+++ b/Koha/Ratings.pm >@@ -0,0 +1,50 @@ >+package Koha::Ratings; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::Rating; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::Ratings - Koha Rating Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'Rating'; >+} >+ >+sub object_class { >+ return 'Koha::Rating'; >+} >+ >+1; >-- >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