}
sub numberofreviews {
+ my ($status) = @_;
my $dbh = C4::Context->dbh;
my $query =
"SELECT count(*) FROM reviews WHERE approved=?";
my $sth = $dbh->prepare($query);
- $sth->execute( 1 );
+ $sth->execute( $status );
return $sth->fetchrow;
}
&whitelist
&is_approved
&approval_counts
+ &get_count_by_tag_status
&get_filters
);
# %EXPORT_TAGS = ();
return $result;
}
+=head2 get_count_by_tag_status
+
+ get_count_by_tag_status($status);
+
+Takes a status and gets a count of tags with that status
+
+=cut
+
+sub get_count_by_tag_status {
+ my ($status) = @_;
+ my $dbh = C4::Context->dbh;
+ my $query =
+ "SELECT count(*) FROM tags_approval WHERE approved=?";
+ my $sth = $dbh->prepare($query);
+ $sth->execute( $status );
+ return $sth->fetchrow;
+}
+
sub remove_tag ($;$) {
my $tag_id = shift or return undef;
my $user_id = (@_) ? shift : undef;
content: "";
}
.holdcount { font-size : 105%; line-height : 200%; }
-.holdcount a { border : 1px solid #a4bedd; background-color : #e4ecf5; font-weight : bold; -moz-border-radius: 4px; padding : .1em .4em; text-decoration : none; }
+.holdcount a {
+ border : 1px solid #a4bedd;
+ background-color : #e4ecf5;
+ font-weight : bold;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ padding : .1em .4em;
+ text-decoration : none;
+}
.holdcount a:hover { background-color : #ebeff7; }
.container {
border : 1px solid #EEE;
[% END %]
[% IF ( CAN_user_acquisition ) %]
<h3><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></h3>
+ [% IF ( pendingsuggestions ) %]<ul><li><a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/suggestion/suggestion.pl">[% pendingsuggestions %]</a></span></li></ul>[% END %]
[% END %]
[% IF ( CAN_user_reports ) %]
<h3><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></h3>
[% END %]
[% IF ( CAN_user_tools ) %]
<h3><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></h3>
+ [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) %]
+ <ul>
+ [% IF ( pendingcomments ) %]<li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">[% pendingcomments %]</a></span></li>[% END %]
+ [% IF ( pendingtags ) %]<li><a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/tags/review.pl">[% pendingtags %]</a></span></li>[% END %]
+ </ul>
+ [% END %]
[% END %]
<h3><a href="/cgi-bin/koha/about.pl">About Koha</a></h3>
</div>
</div><!-- /koha-news -->
</div>
[% END %]
-
+
</div>
+
[% INCLUDE 'intranet-bottom.inc' %]
<h3>Patrons and circulation</h3>
<dl>
[% IF ( CAN_user_tools_moderate_comments ) %]
- <dt><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a></dt>
- <dd>Moderate patron comments</dd>
+ <dt><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a> [% IF ( pendingcomments ) %]<span class="holdcount"><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">[% pendingcomments %]</a></span>[% END %]</dt>
+ <dd>Moderate patron comments. </dd>
[% END %]
[% IF ( CAN_user_tools_import_patrons ) %]
[% END %]
[% IF ( CAN_user_tools_moderate_tags ) %]
- <dt><a href="/cgi-bin/koha/tags/review.pl">Tags</a></dt>
+ <dt><a href="/cgi-bin/koha/tags/review.pl">Tags</a> [% IF ( pendingtags ) %]<span class="holdcount"><a href="/cgi-bin/koha/tags/review.pl">[% pendingtags %]</a></span>[% END %]</dt>
<dd>Moderate patron tags</dd>
[% END %]
use C4::AuthoritiesMarc;
use C4::Koha;
use C4::NewsChannels;
+use C4::Review qw/numberofreviews/;
+use C4::Suggestions qw/CountSuggestion/;
+use C4::Tags qw/get_count_by_tag_status/;
my $query = new CGI;
my $authtypes = getauthtypes;
my @authtypesloop;
koha_news_count => $koha_news_count
);
+my $pendingcomments = numberofreviews(0);
+my $pendingtags = get_count_by_tag_status(0);
+my $pendingsuggestions = CountSuggestion("ASKED");
+
+$template->param(
+ pendingcomments => $pendingcomments,
+ pendingtags => $pendingtags,
+ pendingsuggestions => $pendingsuggestions
+);
+
output_html_with_http_headers $query, $cookie, $template->output;
my $reviews = getallreviews(1,$offset,$results_per_page);
my $marcflavour = C4::Context->preference("marcflavour");
-my $hits = numberofreviews();
+my $hits = numberofreviews(1);
my $i = 0;
my $latest_comment_date;
for my $result (@$reviews){
use CGI;
use C4::Auth;
use C4::Output;
+use C4::Review qw/numberofreviews/;
+use C4::Tags qw/get_count_by_tag_status/;
my $query = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
+my $pendingcomments = numberofreviews(0);
+my $pendingtags = get_count_by_tag_status(0);
+
+$template->param(
+ pendingcomments => $pendingcomments,
+ pendingtags => $pendingtags
+);
+
output_html_with_http_headers $query, $cookie, $template->output;