Jonathan Druart
86395f2282
The subroutines in C4::Reviews are only doing CRUD operations. This patch set moves them to 2 new Koha::Review[s] classes. Test plan for the whole patch set: 0/ Set the reviewson syspref 1/ At the OPAC, create a couple of reviews for a record Try and create a review without html tags different that br b i em big small strong: You should get a warning. 2/ Edit a review 3/ On the Staff interface, you should see a "Comments pending approval" link on the mainpage 4/ Approve 1 review and delete the other 5/ At the OPAC you should only see 1 review (the approved one) in the "Comments" tab 6/ Modify the review 7/ The review should appear again in the "comments awaiting moderation" tab. Note that even the comment has not been changed, it will have to be reapproved (FIXME later). This behavior already existed prior to this patch. Tested all patches together (with database updated) Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
50 lines
1 KiB
Perl
50 lines
1 KiB
Perl
package Koha::Reviews;
|
|
|
|
# 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::Review;
|
|
|
|
use base qw(Koha::Objects);
|
|
|
|
=head1 NAME
|
|
|
|
Koha::Reviews - Koha Review Object set class
|
|
|
|
=head1 API
|
|
|
|
=head2 Class Methods
|
|
|
|
=cut
|
|
|
|
=head3 type
|
|
|
|
=cut
|
|
|
|
sub _type {
|
|
return 'Review';
|
|
}
|
|
|
|
sub object_class {
|
|
return 'Koha::Review';
|
|
}
|
|
|
|
1;
|