Bugzilla – Attachment 53802 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 updatereview
Bug-15839-KohaReviews---Remove-updatereview.patch (text/plain), 2.79 KB, created by
Marcel de Rooy
on 2016-07-29 09:44:44 UTC
(
hide
)
Description:
Bug 15839: Koha::Reviews - Remove updatereview
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-07-29 09:44:44 UTC
Size:
2.79 KB
patch
obsolete
>From 21dbd2d2de9b4289180ab21622edf2191e183eed Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Feb 2016 16:28:33 +0000 >Subject: [PATCH] Bug 15839: Koha::Reviews - Remove updatereview >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marc Veron <veron@veron.ch> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Review.pm | 19 +------------------ > opac/opac-review.pl | 11 +++++++++-- > 2 files changed, 10 insertions(+), 20 deletions(-) > >diff --git a/C4/Review.pm b/C4/Review.pm >index b76b1e9..90bdfeb 100644 >--- a/C4/Review.pm >+++ b/C4/Review.pm >@@ -27,7 +27,7 @@ use vars qw(@ISA @EXPORT); > BEGIN { > require Exporter; > @ISA = qw(Exporter); >- @EXPORT = qw(savereview updatereview numberofreviewsbybiblionumber); >+ @EXPORT = qw(savereview numberofreviewsbybiblionumber); > } > > =head1 NAME >@@ -39,7 +39,6 @@ C4::Review - Perl Module containing routines for dealing with reviews of items > use C4::Review; > > savereview($biblionumber,$borrowernumber,$review); >- updatereview($biblionumber,$borrowernumber,$review); > my $count=numberofreviewsbybiblionumber($biblionumber); > > =head1 DESCRIPTION >@@ -66,22 +65,6 @@ sub savereview { > $sth->execute( $borrowernumber, $biblionumber, $review ); > } > >-=head2 updatereview >- >- updateview($biblionumber,$borrowernumber, $review); >- >-Update the review description in the 'reviews' database >- >-=cut >- >-sub updatereview { >- my ( $biblionumber, $borrowernumber, $review ) = @_; >- my $dbh = C4::Context->dbh; >- my $query = "UPDATE reviews SET review=?,datereviewed=now(),approved=0 WHERE borrowernumber=? and biblionumber=?"; >- my $sth = $dbh->prepare($query); >- $sth->execute( $review, $borrowernumber, $biblionumber ); >-} >- > =head2 numberofreviewsbybiblionumber > > my $count=numberofreviewsbybiblionumber($biblionumber); >diff --git a/opac/opac-review.pl b/opac/opac-review.pl >index fd3491a..a965896 100755 >--- a/opac/opac-review.pl >+++ b/opac/opac-review.pl >@@ -26,6 +26,7 @@ use C4::Review; > use C4::Biblio; > use C4::Scrubber; > use C4::Debug; >+use Koha::DateUtils; > use Koha::Reviews; > > my $query = new CGI; >@@ -60,8 +61,14 @@ if (defined $review) { > my $js_ok_review = $clean; > $js_ok_review =~ s/"/"/g; # probably redundant w/ TMPL ESCAPE=JS > $template->param(clean_review=>$js_ok_review); >- if ($savedreview) { >- updatereview($biblionumber, $borrowernumber, $clean); >+ if ($savedreview) { >+ $savedreview->set( >+ { >+ review => $clean, >+ approved => 0, >+ datereviewed => dt_from_string >+ } >+ )->store; > } else { > savereview($biblionumber, $borrowernumber, $clean); > } >-- >1.7.10.4
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