C4::Review - Perl Module containing routines for dealing with reviews of items
use C4::Review; my $review=getreview($biblionumber,$borrowernumber); savereview($biblionumber,$borrowernumber,$review); updatereview($biblionumber,$borrowernumber,$review); my $count=numberofreviews($status); my $count=numberofreviewsbybiblionumber($biblionumber); my $reviews=getreviews($biblionumber, $status); my $reviews=getallreviews($status, [$offset], [$row_count]);
Review.pm provides many routines for manipulating reviews.
$review = getreview($biblionumber,$borrowernumber);
Takes a borrowernumber and a biblionumber and returns the review of that biblio
savereview($biblionumber,$borrowernumber, $review);
Save a review in the 'reviews' database
updateview($biblionumber,$borrowernumber, $review);
Update the review description in the 'reviews' database
my $count=numberofreviews( [$status] );
Return the number of reviews where in the 'reviews' database : 'approved' = $status (By default $status = 1)
my $count=numberofreviewsbybiblionumber($biblionumber);
Return the number of reviews approved for a given biblionumber
my $reviews=getreviews($biblionumber, $status);
Return all reviews where in the 'reviews' database : 'biblionumber' = $biblionumber and 'approved' = $status
my $reviews=getallreviews($status, [$offset], [$row_count]);
Return all reviews where in the 'reviews' database : 'approved' = $status
If offset and row_count are fiven, it's return all reviews between the $offset position and the ($offset + $row_count) position. (By default : $offset = 0 and $row_count = 20)
approvereview($reviewid);
Takes a reviewid and marks that review approved
unapprovereview($reviewid);
Takes a reviewid and marks that review as not approved
deletereview($reviewid);
Takes a reviewid and deletes it
Koha Team