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 numberofreviewsbybiblionumber); |
32 |
@EXPORT = qw(savereview numberofreviewsbybiblionumber); |
33 |
} |
33 |
} |
34 |
|
34 |
|
35 |
=head1 NAME |
35 |
=head1 NAME |
Lines 41-47
C4::Review - Perl Module containing routines for dealing with reviews of items
Link Here
|
41 |
use C4::Review; |
41 |
use C4::Review; |
42 |
|
42 |
|
43 |
savereview($biblionumber,$borrowernumber,$review); |
43 |
savereview($biblionumber,$borrowernumber,$review); |
44 |
updatereview($biblionumber,$borrowernumber,$review); |
|
|
45 |
my $count=numberofreviewsbybiblionumber($biblionumber); |
44 |
my $count=numberofreviewsbybiblionumber($biblionumber); |
46 |
|
45 |
|
47 |
=head1 DESCRIPTION |
46 |
=head1 DESCRIPTION |
Lines 68-89
sub savereview {
Link Here
|
68 |
$sth->execute( $borrowernumber, $biblionumber, $review ); |
67 |
$sth->execute( $borrowernumber, $biblionumber, $review ); |
69 |
} |
68 |
} |
70 |
|
69 |
|
71 |
=head2 updatereview |
|
|
72 |
|
73 |
updateview($biblionumber,$borrowernumber, $review); |
74 |
|
75 |
Update the review description in the 'reviews' database |
76 |
|
77 |
=cut |
78 |
|
79 |
sub updatereview { |
80 |
my ( $biblionumber, $borrowernumber, $review ) = @_; |
81 |
my $dbh = C4::Context->dbh; |
82 |
my $query = "UPDATE reviews SET review=?,datereviewed=now(),approved=0 WHERE borrowernumber=? and biblionumber=?"; |
83 |
my $sth = $dbh->prepare($query); |
84 |
$sth->execute( $review, $borrowernumber, $biblionumber ); |
85 |
} |
86 |
|
87 |
=head2 numberofreviewsbybiblionumber |
70 |
=head2 numberofreviewsbybiblionumber |
88 |
|
71 |
|
89 |
my $count=numberofreviewsbybiblionumber($biblionumber); |
72 |
my $count=numberofreviewsbybiblionumber($biblionumber); |