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

(-)a/acqui/acqui-home.pl (-3 / +8 lines)
Lines 35-43 use C4::Acquisition; Link Here
35
use C4::Budgets;
35
use C4::Budgets;
36
use C4::Members;
36
use C4::Members;
37
use C4::Debug;
37
use C4::Debug;
38
use C4::Suggestions;
39
use Koha::Acquisition::Currencies;
38
use Koha::Acquisition::Currencies;
40
use Koha::Patrons;
39
use Koha::Patrons;
40
use Koha::Suggestions;
41
41
42
my $query = CGI->new;
42
my $query = CGI->new;
43
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
43
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
Lines 51-57 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
51
);
51
);
52
52
53
my $status           = $query->param('status') || "ASKED";
53
my $status           = $query->param('status') || "ASKED";
54
my $suggestions_count       = CountSuggestion($status);
54
# Get current branch count and total viewable count, if they don't match then pass
55
# both to template
56
my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED" });
57
my $local_pendingsuggestions_count = $pendingsuggestions->filter_by_user_branch(1)->count();
58
my $pendingsuggestions_count = $pendingsuggestions->filter_by_user_branch()->count();
59
$template->param( all_pendingsuggestions => $pendingsuggestions_count != $local_pendingsuggestions_count ? $pendingsuggestions_count : 0 );
55
60
56
my $budget_arr = GetBudgetHierarchy;
61
my $budget_arr = GetBudgetHierarchy;
57
62
Lines 114-120 $template->param( Link Here
114
    totspent_active     => $totspent_active,
119
    totspent_active     => $totspent_active,
115
    totordered_active   => $totordered_active,
120
    totordered_active   => $totordered_active,
116
    totavail_active     => $totavail_active,
121
    totavail_active     => $totavail_active,
117
    suggestions_count   => $suggestions_count,
122
    suggestions_count   => $local_pendingsuggestions_count,
118
);
123
);
119
124
120
my $cur = Koha::Acquisition::Currencies->get_active;
125
my $cur = Koha::Acquisition::Currencies->get_active;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-1 / +7 lines)
Lines 54-60 Link Here
54
    <div id="acqui_acqui_home_suggestions">
54
    <div id="acqui_acqui_home_suggestions">
55
        <fieldset>
55
        <fieldset>
56
        <legend>Pending suggestions</legend>
56
        <legend>Pending suggestions</legend>
57
            <p>[% suggestions_count | html %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl#ASKED">Manage suggestions</a>.</p>
57
            <p>
58
            [% suggestions_count | html %]
59
            [% IF (all_pendingsuggestions > 0) %]
60
                <span id="all_pendingsuggestions"> ( [% all_pendingsuggestions | html %] )</span>
61
            [% END %]
62
            suggestions waiting.
63
            <a href="/cgi-bin/koha/suggestion/suggestion.pl#ASKED">Manage suggestions</a>.</p>
58
        </fieldset>
64
        </fieldset>
59
    </div>
65
    </div>
60
</div>
66
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +4 lines)
Lines 148-154 Link Here
148
                                <div class="pending-info" id="suggestions_pending">
148
                                <div class="pending-info" id="suggestions_pending">
149
149
150
                                    <a href="/cgi-bin/koha/suggestion/suggestion.pl#ASKED">Suggestions pending approval</a>:
150
                                    <a href="/cgi-bin/koha/suggestion/suggestion.pl#ASKED">Suggestions pending approval</a>:
151
                                    <span class="pending-number-link">[% pendingsuggestions | html %]</span>
151
                                    <span id="pendingsuggestions" class="pending-number-link">[% pendingsuggestions | html %]</span>
152
                                    [% IF (all_pendingsuggestions > 0) %]
153
                                        <span id="all_pendingsuggestions" class="pending-number-link">( [% all_pendingsuggestions | html %] )</span>
154
                                    [% END %]
152
                                </div>
155
                                </div>
153
                                [% END %]
156
                                [% END %]
154
157
(-)a/mainpage.pl (-4 / +10 lines)
Lines 25-36 use C4::Output; Link Here
25
use C4::Auth;
25
use C4::Auth;
26
use C4::Koha;
26
use C4::Koha;
27
use C4::NewsChannels; # GetNewsToDisplay
27
use C4::NewsChannels; # GetNewsToDisplay
28
use C4::Suggestions qw/CountSuggestion/;
29
use C4::Tags qw/get_count_by_tag_status/;
28
use C4::Tags qw/get_count_by_tag_status/;
30
use Koha::Patron::Modifications;
29
use Koha::Patron::Modifications;
31
use Koha::Patron::Discharge;
30
use Koha::Patron::Discharge;
32
use Koha::Reviews;
31
use Koha::Reviews;
33
use Koha::ArticleRequests;
32
use Koha::ArticleRequests;
33
use Koha::Suggestions;
34
34
35
my $query = new CGI;
35
my $query = new CGI;
36
36
Lines 65-71 my $branch = Link Here
65
65
66
my $pendingcomments    = Koha::Reviews->search_limited({ approved => 0 })->count;
66
my $pendingcomments    = Koha::Reviews->search_limited({ approved => 0 })->count;
67
my $pendingtags        = get_count_by_tag_status(0);
67
my $pendingtags        = get_count_by_tag_status(0);
68
my $pendingsuggestions = CountSuggestion("ASKED");
68
69
# Get current branch count and total viewable count, if they don't match then pass
70
# both to template
71
my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED" });
72
my $local_pendingsuggestions_count = $pendingsuggestions->filter_by_user_branch(1)->count();
73
my $pendingsuggestions_count = $pendingsuggestions->filter_by_user_branch()->count();
74
$template->param( all_pendingsuggestions => $pendingsuggestions_count != $local_pendingsuggestions_count ? $pendingsuggestions_count : 0 );
75
69
my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count( $branch );
76
my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count( $branch );
70
my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 });
77
my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 });
71
my $pending_article_requests = Koha::ArticleRequests->search_limited(
78
my $pending_article_requests = Koha::ArticleRequests->search_limited(
Lines 78-84 my $pending_article_requests = Koha::ArticleRequests->search_limited( Link Here
78
$template->param(
85
$template->param(
79
    pendingcomments                => $pendingcomments,
86
    pendingcomments                => $pendingcomments,
80
    pendingtags                    => $pendingtags,
87
    pendingtags                    => $pendingtags,
81
    pendingsuggestions             => $pendingsuggestions,
88
    pendingsuggestions             => $local_pendingsuggestions_count,
82
    pending_borrower_modifications => $pending_borrower_modifications,
89
    pending_borrower_modifications => $pending_borrower_modifications,
83
    pending_discharge_requests     => $pending_discharge_requests,
90
    pending_discharge_requests     => $pending_discharge_requests,
84
    pending_article_requests       => $pending_article_requests,
91
    pending_article_requests       => $pending_article_requests,
85
- 

Return to bug 25033