View | Details | Raw Unified | Return to bug 7259
Collapse All | Expand All

(-)a/C4/Review.pm (-1 / +2 lines)
Lines 91-101 sub updatereview { Link Here
91
}
91
}
92
92
93
sub numberofreviews {
93
sub numberofreviews {
94
    my ($status) = @_;
94
    my $dbh            = C4::Context->dbh;
95
    my $dbh            = C4::Context->dbh;
95
    my $query          =
96
    my $query          =
96
      "SELECT count(*) FROM reviews WHERE approved=?";
97
      "SELECT count(*) FROM reviews WHERE approved=?";
97
    my $sth = $dbh->prepare($query);
98
    my $sth = $dbh->prepare($query);
98
    $sth->execute( 1 );
99
    $sth->execute( $status );
99
  return $sth->fetchrow;
100
  return $sth->fetchrow;
100
}
101
}
101
102
(-)a/C4/Tags.pm (+19 lines)
Lines 40-45 BEGIN { Link Here
40
		&whitelist
40
		&whitelist
41
		&is_approved
41
		&is_approved
42
		&approval_counts
42
		&approval_counts
43
		&get_count_by_tag_status
43
		&get_filters
44
		&get_filters
44
	);
45
	);
45
	# %EXPORT_TAGS = ();
46
	# %EXPORT_TAGS = ();
Lines 92-97 sub approval_counts () { Link Here
92
	return $result;
93
	return $result;
93
}
94
}
94
95
96
=head2 get_count_by_tag_status
97
98
  get_count_by_tag_status($status);
99
100
Takes a status and gets a count of tags with that status
101
102
=cut
103
104
sub get_count_by_tag_status  {
105
    my ($status) = @_;
106
    my $dbh            = C4::Context->dbh;
107
    my $query          =
108
      "SELECT count(*) FROM tags_approval WHERE approved=?";
109
    my $sth = $dbh->prepare($query);
110
    $sth->execute( $status );
111
  return $sth->fetchrow;
112
}
113
95
sub remove_tag ($;$) {
114
sub remove_tag ($;$) {
96
	my $tag_id  = shift or return undef;
115
	my $tag_id  = shift or return undef;
97
	my $user_id = (@_) ? shift : undef;
116
	my $user_id = (@_) ? shift : undef;
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (-1 / +9 lines)
Lines 1925-1931 ul.budget_hierarchy li:first-child:after { Link Here
1925
    content: "";
1925
    content: "";
1926
}
1926
}
1927
.holdcount { font-size : 105%; line-height : 200%; }
1927
.holdcount { font-size : 105%; line-height : 200%; }
1928
.holdcount a { border : 1px solid #a4bedd; background-color : #e4ecf5; font-weight : bold; -moz-border-radius: 4px; padding : .1em .4em; text-decoration : none; }
1928
.holdcount a {
1929
	border : 1px solid #a4bedd;
1930
	background-color : #e4ecf5;
1931
	font-weight : bold;
1932
	-moz-border-radius: 4px;
1933
	border-radius: 4px;
1934
	padding : .1em .4em;
1935
	text-decoration : none;
1936
}
1929
.holdcount a:hover { background-color : #ebeff7; }
1937
.holdcount a:hover { background-color : #ebeff7; }
1930
.container {
1938
.container {
1931
	border : 1px solid #EEE;
1939
	border : 1px solid #EEE;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +9 lines)
Lines 82-87 Link Here
82
    [% END %]
82
    [% END %]
83
	[% IF ( CAN_user_acquisition ) %]
83
	[% IF ( CAN_user_acquisition ) %]
84
	<h3><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></h3>
84
	<h3><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></h3>
85
    [% 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 %]
85
	[% END %]
86
	[% END %]
86
    [% IF ( CAN_user_reports ) %]
87
    [% IF ( CAN_user_reports ) %]
87
    <h3><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></h3>
88
    <h3><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></h3>
Lines 94-99 Link Here
94
    [% END %]
95
    [% END %]
95
    [% IF ( CAN_user_tools ) %] 
96
    [% IF ( CAN_user_tools ) %] 
96
    <h3><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></h3>
97
    <h3><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></h3>
98
        [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) %]
99
            <ul>
100
                [% 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 %]
101
                [% 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 %]
102
            </ul>
103
        [% END %]
97
    [% END %]
104
    [% END %]
98
    <h3><a href="/cgi-bin/koha/about.pl">About Koha</a></h3>
105
    <h3><a href="/cgi-bin/koha/about.pl">About Koha</a></h3>
99
	</div>
106
	</div>
Lines 117-122 Link Here
117
		</div><!-- /koha-news -->
124
		</div><!-- /koha-news -->
118
	</div>
125
	</div>
119
[% END %]
126
[% END %]
120
	
127
121
</div>
128
</div>
129
122
[% INCLUDE 'intranet-bottom.inc' %]
130
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt (-3 / +3 lines)
Lines 16-23 Link Here
16
<h3>Patrons and circulation</h3>
16
<h3>Patrons and circulation</h3>
17
<dl>
17
<dl>
18
    [% IF ( CAN_user_tools_moderate_comments ) %]
18
    [% IF ( CAN_user_tools_moderate_comments ) %]
19
    <dt><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a></dt>
19
    <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>
20
	<dd>Moderate patron comments</dd>
20
	<dd>Moderate patron comments. </dd>
21
    [% END %]
21
    [% END %]
22
    
22
    
23
    [% IF ( CAN_user_tools_import_patrons ) %]
23
    [% IF ( CAN_user_tools_import_patrons ) %]
Lines 46-52 Link Here
46
    [% END %]
46
    [% END %]
47
47
48
    [% IF ( CAN_user_tools_moderate_tags ) %]
48
    [% IF ( CAN_user_tools_moderate_tags ) %]
49
    <dt><a href="/cgi-bin/koha/tags/review.pl">Tags</a></dt>
49
    <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>
50
	<dd>Moderate patron tags</dd>
50
	<dd>Moderate patron tags</dd>
51
    [% END %]
51
    [% END %]
52
52
(-)a/mainpage.pl (+13 lines)
Lines 27-32 use C4::Auth; Link Here
27
use C4::AuthoritiesMarc;
27
use C4::AuthoritiesMarc;
28
use C4::Koha;
28
use C4::Koha;
29
use C4::NewsChannels;
29
use C4::NewsChannels;
30
use C4::Review qw/numberofreviews/;
31
use C4::Suggestions qw/CountSuggestion/;
32
use C4::Tags qw/get_count_by_tag_status/;
30
my $query     = new CGI;
33
my $query     = new CGI;
31
my $authtypes = getauthtypes;
34
my $authtypes = getauthtypes;
32
my @authtypesloop;
35
my @authtypesloop;
Lines 67-70 $template->param( Link Here
67
    koha_news_count => $koha_news_count
70
    koha_news_count => $koha_news_count
68
);
71
);
69
72
73
my $pendingcomments = numberofreviews(0);
74
my $pendingtags = get_count_by_tag_status(0);
75
my $pendingsuggestions       = CountSuggestion("ASKED");
76
77
$template->param(
78
    pendingcomments    => $pendingcomments,
79
    pendingtags        => $pendingtags,
80
    pendingsuggestions => $pendingsuggestions
81
);
82
70
output_html_with_http_headers $query, $cookie, $template->output;
83
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-showreviews.pl (-1 / +1 lines)
Lines 73-79 if (!$@ and C4::Context->preference('ShowReviewer') and C4::Context->preference( Link Here
73
73
74
my $reviews = getallreviews(1,$offset,$results_per_page);
74
my $reviews = getallreviews(1,$offset,$results_per_page);
75
my $marcflavour      = C4::Context->preference("marcflavour");
75
my $marcflavour      = C4::Context->preference("marcflavour");
76
my $hits = numberofreviews();
76
my $hits = numberofreviews(1);
77
my $i = 0;
77
my $i = 0;
78
my $latest_comment_date;
78
my $latest_comment_date;
79
for my $result (@$reviews){
79
for my $result (@$reviews){
(-)a/tools/tools-home.pl (-1 / +10 lines)
Lines 21-26 use warnings; Link Here
21
use CGI;
21
use CGI;
22
use C4::Auth;
22
use C4::Auth;
23
use C4::Output;
23
use C4::Output;
24
use C4::Review qw/numberofreviews/;
25
use C4::Tags qw/get_count_by_tag_status/;
24
26
25
my $query = new CGI;
27
my $query = new CGI;
26
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 34-37 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
34
    }
36
    }
35
);
37
);
36
38
39
my $pendingcomments = numberofreviews(0);
40
my $pendingtags = get_count_by_tag_status(0);
41
42
$template->param(
43
    pendingcomments => $pendingcomments,
44
    pendingtags     => $pendingtags
45
);
46
37
output_html_with_http_headers $query, $cookie, $template->output;
47
output_html_with_http_headers $query, $cookie, $template->output;
38
- 

Return to bug 7259