Lines 29-35
BEGIN {
Link Here
|
29 |
$VERSION = 3.07.00.049; |
29 |
$VERSION = 3.07.00.049; |
30 |
require Exporter; |
30 |
require Exporter; |
31 |
@ISA = qw(Exporter); |
31 |
@ISA = qw(Exporter); |
32 |
@EXPORT = qw(savereview updatereview numberofreviews numberofreviewsbybiblionumber); |
32 |
@EXPORT = qw(savereview updatereview numberofreviewsbybiblionumber); |
33 |
} |
33 |
} |
34 |
|
34 |
|
35 |
=head1 NAME |
35 |
=head1 NAME |
Lines 42-48
C4::Review - Perl Module containing routines for dealing with reviews of items
Link Here
|
42 |
|
42 |
|
43 |
savereview($biblionumber,$borrowernumber,$review); |
43 |
savereview($biblionumber,$borrowernumber,$review); |
44 |
updatereview($biblionumber,$borrowernumber,$review); |
44 |
updatereview($biblionumber,$borrowernumber,$review); |
45 |
my $count=numberofreviews($status); |
|
|
46 |
my $count=numberofreviewsbybiblionumber($biblionumber); |
45 |
my $count=numberofreviewsbybiblionumber($biblionumber); |
47 |
|
46 |
|
48 |
=head1 DESCRIPTION |
47 |
=head1 DESCRIPTION |
Lines 85-109
sub updatereview {
Link Here
|
85 |
$sth->execute( $review, $borrowernumber, $biblionumber ); |
84 |
$sth->execute( $review, $borrowernumber, $biblionumber ); |
86 |
} |
85 |
} |
87 |
|
86 |
|
88 |
=head2 numberofreviews |
|
|
89 |
|
90 |
my $count=numberofreviews( [$status] ); |
91 |
|
92 |
Return the number of reviews where in the 'reviews' database : 'approved' = $status |
93 |
(By default $status = 1) |
94 |
|
95 |
=cut |
96 |
|
97 |
sub numberofreviews { |
98 |
my ($param) = @_; |
99 |
my $status = ( defined($param) ? $param : 1 ); |
100 |
my $dbh = C4::Context->dbh; |
101 |
my $query = "SELECT count(*) FROM reviews WHERE approved=?"; |
102 |
my $sth = $dbh->prepare($query); |
103 |
$sth->execute($status); |
104 |
return $sth->fetchrow; |
105 |
} |
106 |
|
107 |
=head2 numberofreviewsbybiblionumber |
87 |
=head2 numberofreviewsbybiblionumber |
108 |
|
88 |
|
109 |
my $count=numberofreviewsbybiblionumber($biblionumber); |
89 |
my $count=numberofreviewsbybiblionumber($biblionumber); |