From 4848a8346ec60b45c82081c9fe030d05b0f59b35 Mon Sep 17 00:00:00 2001 From: rangi Date: Sat, 17 Jun 2006 04:26:38 +0000 Subject: [PATCH] Admin interface to approve reviews, not finished yet Needs a script to delete a review and to approve one. Will work on this later (taking a break to watch rugby) --- C4/Review.pm | 21 ++++++++++++++++ .../prog/en/reviews/reviewswaiting.tmpl | 23 +++++++++++++++++ reviews/reviewswaiting.pl | 25 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl create mode 100755 reviews/reviewswaiting.pl diff --git a/C4/Review.pm b/C4/Review.pm index 1522a1102a..0bb15161ad 100644 --- a/C4/Review.pm +++ b/C4/Review.pm @@ -140,6 +140,27 @@ sub getallreviews { $sth->finish(); return(\@results); } + +=head2 approvereview + + approvereview($biblionumber,$borrowernumber); + +Takes a borrowernumber and a biblionumber and marks that review approved + + +=cut + +sub approvereview { + my ($biblionumber,$borrowernumber)=@_; + my $dbh=C4::Context->dbh(); + my $query="UPDATE reviews + SET approved=? + WHERE biblionumber=? AND borrowernumber=?"; + my $sth=$dbh->prepare($query); + $sth->execute(1,$biblionumber,$borrowernumber); + $sth->finish(); +} + 1; __END__ diff --git a/koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl b/koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl new file mode 100644 index 0000000000..515b0c0e55 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl @@ -0,0 +1,23 @@ +Reviews waiting for Approval -- + +/includes/calendar/calendar-system.css"> + + + + + + + +

Reviews

+ + + + + + + +
+
+ + + diff --git a/reviews/reviewswaiting.pl b/reviews/reviewswaiting.pl new file mode 100755 index 0000000000..94f78aa0e2 --- /dev/null +++ b/reviews/reviewswaiting.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use strict; +use CGI; +use C4::Auth; +use C4::Output; +use C4::Interface::CGI::Output; +use C4::Context; +use HTML::Template; +use C4::Review; + +my $query = new CGI; +my ($template, $loggedinuser, $cookie) += get_template_and_user({template_name => "reviews/reviewswaiting.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => {catalogue => 1}, + debug => 1, + }); + +my $reviews=getallreviews(0); +$template->param(reviews => $reviews); + +output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5