ffzg/recall_notices.pl: added --interval and --dedup
[koha.git] / opac / opac-review.pl
index f8e86ba..86a9848 100755 (executable)
@@ -25,6 +25,8 @@ use C4::Output;
 use C4::Biblio;
 use C4::Scrubber;
 use C4::Debug;
+
+use Koha::Biblios;
 use Koha::DateUtils;
 use Koha::Review;
 use Koha::Reviews;
@@ -45,7 +47,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 # FIXME: need to allow user to delete their own comment(s)
 
 my ( $clean, @errors, $savedreview );
-my $biblio = GetBiblioData($biblionumber);
+my $biblio = Koha::Biblios->find( $biblionumber );
 
 if( !$biblio ) {
     push @errors, { nobiblio => 1 };
@@ -69,9 +71,6 @@ if( !@errors && defined $review ) {
                        if ($clean ne $review) {
                                push @errors, {scrubbed=>$clean};
                        }
-                       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) {
                 $savedreview->set(
                     {
@@ -85,6 +84,7 @@ if( !@errors && defined $review ) {
                     {   biblionumber   => $biblionumber,
                         borrowernumber => $borrowernumber,
                         review         => $clean,
+                        datereviewed   => dt_from_string
                     }
                 )->store->reviewid;
             }
@@ -101,7 +101,7 @@ $template->param(
     'borrowernumber' => $borrowernumber,
     'review'         => $review,
     'reviewid'       => $reviewid || 0,
-    'title'          => $biblio->{'title'},
+    'title'          => $biblio->title,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;