Bugzilla – Attachment 48171 Details for
Bug 15839
Move the reviews related code to Koha::Reviews
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15839: Koha::Reviews - Remove deletereview
Bug-15839-KohaReviews---Remove-deletereview.patch (text/plain), 1.80 KB, created by
Jonathan Druart
on 2016-02-17 13:45:37 UTC
(
hide
)
Description:
Bug 15839: Koha::Reviews - Remove deletereview
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-17 13:45:37 UTC
Size:
1.80 KB
patch
obsolete
>From 13cab7bee181d1861f86b37b7fcdcce2c37efd31 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Feb 2016 16:06:46 +0000 >Subject: [PATCH] Bug 15839: Koha::Reviews - Remove deletereview > >Note that a future enhancement should take into account the possible >error returned by ->approve, ->unapprove and ->delete >--- > C4/Review.pm | 20 +------------------- > reviews/reviewswaiting.pl | 3 ++- > 2 files changed, 3 insertions(+), 20 deletions(-) > >diff --git a/C4/Review.pm b/C4/Review.pm >index 13a15c7..fc0b0b7 100644 >--- a/C4/Review.pm >+++ b/C4/Review.pm >@@ -29,8 +29,7 @@ BEGIN { > $VERSION = 3.07.00.049; > require Exporter; > @ISA = qw(Exporter); >- @EXPORT = qw(getreview savereview updatereview numberofreviews numberofreviewsbybiblionumber >- deletereview); >+ @EXPORT = qw(getreview savereview updatereview numberofreviews numberofreviewsbybiblionumber); > } > > =head1 NAME >@@ -140,23 +139,6 @@ sub numberofreviewsbybiblionumber { > return $sth->fetchrow; > } > >-=head2 deletereview >- >- deletereview($reviewid); >- >-Takes a reviewid and deletes it >- >-=cut >- >-sub deletereview { >- my ($reviewid) = @_; >- my $dbh = C4::Context->dbh(); >- my $query = "DELETE FROM reviews >- WHERE reviewid=?"; >- my $sth = $dbh->prepare($query); >- $sth->execute($reviewid); >-} >- > 1; > __END__ > >diff --git a/reviews/reviewswaiting.pl b/reviews/reviewswaiting.pl >index b1b8234..74b92f5 100755 >--- a/reviews/reviewswaiting.pl >+++ b/reviews/reviewswaiting.pl >@@ -54,7 +54,8 @@ elsif ( $op eq 'unapprove' ) { > $review->unapprove if $review; > } > elsif ( $op eq 'delete' ) { >- deletereview($reviewid); >+ my $review = Koha::Reviews->find( $reviewid ); >+ $review->delete if $review; > } > > my $reviews = Koha::Reviews->search( >-- >2.7.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15839
:
48166
|
48167
|
48168
|
48169
|
48170
|
48171
|
48172
|
48173
|
48174
|
48175
|
48176
|
48280
|
48281
|
48282
|
48283
|
48284
|
48285
|
48286
|
48287
|
48288
|
48289
|
48290
|
51197
|
51198
|
51199
|
51200
|
51201
|
51202
|
51203
|
51204
|
51205
|
51206
|
51207
|
53794
|
53795
|
53796
|
53797
|
53798
|
53799
|
53800
|
53801
|
53802
|
53803
|
53804
|
53805
|
53806
|
53807