Bugzilla – Attachment 48175 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 savereview
Bug-15839-KohaReviews---Remove-savereview.patch (text/plain), 2.09 KB, created by
Jonathan Druart
on 2016-02-17 13:45:49 UTC
(
hide
)
Description:
Bug 15839: Koha::Reviews - Remove savereview
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-17 13:45:49 UTC
Size:
2.09 KB
patch
obsolete
>From 223391a6dfb19f39b23ff94cdd5463b14a5db521 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Feb 2016 16:30:07 +0000 >Subject: [PATCH] Bug 15839: Koha::Reviews - Remove savereview > >--- > C4/Review.pm | 18 ------------------ > opac/opac-review.pl | 13 +++++++++---- > 2 files changed, 9 insertions(+), 22 deletions(-) > >diff --git a/C4/Review.pm b/C4/Review.pm >index 6308926..ebe6a57 100644 >--- a/C4/Review.pm >+++ b/C4/Review.pm >@@ -49,24 +49,6 @@ Review.pm provides many routines for manipulating reviews. > > =head1 FUNCTIONS > >-=head2 savereview >- >- savereview($biblionumber,$borrowernumber, $review); >- >-Save a review in the 'reviews' database >- >-=cut >- >-sub savereview { >- my ( $biblionumber, $borrowernumber, $review ) = @_; >- my $dbh = C4::Context->dbh; >- my $query = "INSERT INTO reviews (borrowernumber,biblionumber, >- review,approved,datereviewed) VALUES >- (?,?,?,0,now())"; >- my $sth = $dbh->prepare($query); >- $sth->execute( $borrowernumber, $biblionumber, $review ); >-} >- > =head2 numberofreviewsbybiblionumber > > my $count=numberofreviewsbybiblionumber($biblionumber); >diff --git a/opac/opac-review.pl b/opac/opac-review.pl >index 1b3640a..eaf65ef 100755 >--- a/opac/opac-review.pl >+++ b/opac/opac-review.pl >@@ -22,11 +22,11 @@ use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Koha; > use C4::Output; >-use C4::Review; > use C4::Biblio; > use C4::Scrubber; > use C4::Debug; > use Koha::DateUtils; >+use Koha::Review; > use Koha::Reviews; > > my $query = new CGI; >@@ -69,9 +69,14 @@ if (defined $review) { > datereviewed => dt_from_string > } > )->store; >- } else { >- savereview($biblionumber, $borrowernumber, $clean); >- } >+ } else { >+ Koha::Review->new( >+ { biblionumber => $biblionumber, >+ borrowernumber => $borrowernumber, >+ review => $clean, >+ } >+ )->store; >+ } > unless (@errors){ $template->param(WINDOW_CLOSE=>1); } > } > } >-- >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