Lines 35-41
BEGIN {
Link Here
|
35 |
|
35 |
|
36 |
@EXPORT = qw( |
36 |
@EXPORT = qw( |
37 |
&GetRating |
37 |
&GetRating |
38 |
&DelRating |
|
|
39 |
); |
38 |
); |
40 |
} |
39 |
} |
41 |
|
40 |
|
Lines 57-65
Get a rating for a bib
Link Here
|
57 |
my $rating_hashref = GetRating( $biblionumber, undef ); |
56 |
my $rating_hashref = GetRating( $biblionumber, undef ); |
58 |
my $rating_hashref = GetRating( $biblionumber, $borrowernumber ); |
57 |
my $rating_hashref = GetRating( $biblionumber, $borrowernumber ); |
59 |
|
58 |
|
60 |
Delete a rating for a bib |
|
|
61 |
my $rating_hashref = DelRating( $biblionumber, $borrowernumber ); |
62 |
|
63 |
|
59 |
|
64 |
All subroutines in Ratings.pm return a hashref which contain 4 keys |
60 |
All subroutines in Ratings.pm return a hashref which contain 4 keys |
65 |
|
61 |
|
Lines 184-211
sub GetRating {
Link Here
|
184 |
return \%rating_hash; |
180 |
return \%rating_hash; |
185 |
} |
181 |
} |
186 |
|
182 |
|
187 |
=head2 DelRating |
|
|
188 |
|
189 |
my $rating_hashref = DelRating( $biblionumber, $borrowernumber ); |
190 |
|
191 |
Delete a rating for a bib |
192 |
|
193 |
=cut |
194 |
|
195 |
sub DelRating { |
196 |
my ( $biblionumber, $borrowernumber ) = @_; |
197 |
|
198 |
my $rating = Koha::Database->new()->schema->resultset('Rating')->find( |
199 |
{ |
200 |
borrowernumber => $borrowernumber, |
201 |
biblionumber => $biblionumber |
202 |
} |
203 |
); |
204 |
|
205 |
$rating->delete() if $rating; |
206 |
|
207 |
return GetRating($biblionumber); |
208 |
} |
209 |
|
210 |
1; |
183 |
1; |
211 |
__END__ |
184 |
__END__ |