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)
This commit is contained in:
parent
c9d0afceac
commit
4848a8346e
3 changed files with 69 additions and 0 deletions
21
C4/Review.pm
21
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__
|
||||
|
||||
|
|
23
koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl
Normal file
23
koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Reviews waiting for Approval --<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<!-- Additions to enable Calendar system -->
|
||||
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-system.css">
|
||||
<!-- End of additions --><!-- Additions to enable Calendar system -->
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar.js"></script>
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-en.js"></script>
|
||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-setup.js"></script>
|
||||
<!-- End of additions -->
|
||||
<!-- ------------------------MAIN BODY OF PAGE------------------------ -->
|
||||
|
||||
<h1>Reviews</h1>
|
||||
|
||||
<table>
|
||||
<!-- TMPL_LOOP NAME="reviews" -->
|
||||
<tr>
|
||||
<td><!-- TMPL_VAR NAME="review" -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|
||||
|
25
reviews/reviewswaiting.pl
Executable file
25
reviews/reviewswaiting.pl
Executable file
|
@ -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;
|
Loading…
Reference in a new issue