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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (+7 lines)
Lines 227-232 Link Here
227
                                    [% IF total_owing && total_owing > 0 %]
227
                                    [% IF total_owing && total_owing > 0 %]
228
                                        <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> due in fines and charges</a></li>
228
                                        <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> due in fines and charges</a></li>
229
                                    [% END %]
229
                                    [% END %]
230
                                    [% IF patron_messages && patron_messages.count > 0 || opacnote %]
231
                                        [% IF opacnote %]
232
                                            <li><a href="/cgi-bin/koha/opac-user.pl"><span class="count_label">[% patron_messages.count + 1 | html %]</span> message(s)</a></li>
233
                                        [% ELSE %]
234
                                            <li><a href="/cgi-bin/koha/opac-user.pl"><span class="count_label">[% patron_messages.count | html %]</span> message(s)</a></li>
235
                                        [% END %]
236
                                    [% END %]
230
                                </ul>
237
                                </ul>
231
                            </div>
238
                            </div>
232
                        [% END %]
239
                        [% END %]
(-)a/opac/opac-main.pl (-3 / +10 lines)
Lines 30-35 use C4::Overdues; Link Here
30
use Koha::Checkouts;
30
use Koha::Checkouts;
31
use Koha::Holds;
31
use Koha::Holds;
32
use Koha::News;
32
use Koha::News;
33
use Koha::Patron::Messages;
33
34
34
my $input = CGI->new;
35
my $input = CGI->new;
35
my $dbh   = C4::Context->dbh;
36
my $dbh   = C4::Context->dbh;
Lines 81-90 if ( $patron ) { Link Here
81
    my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber);
82
    my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber);
82
    my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count;
83
    my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count;
83
    my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count;
84
    my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count;
84
85
    my $patron_messages = Koha::Patron::Messages->search(
86
            {
87
                borrowernumber => $borrowernumber,
88
                message_type => 'B',
89
            });
90
    my $patron_note = $patron->opacnote;
85
    my $total = $patron->account->balance;
91
    my $total = $patron->account->balance;
86
92
87
    if  ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 ) {
93
    if  ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 || $patron_messages > 0 || $patron_note > 0 ) {
88
        $template->param(
94
        $template->param(
89
            dashboard_info => 1,
95
            dashboard_info => 1,
90
            checkouts           => $checkouts,
96
            checkouts           => $checkouts,
Lines 92-97 if ( $patron ) { Link Here
92
            holds_pending       => $holds_pending,
98
            holds_pending       => $holds_pending,
93
            holds_waiting       => $holds_waiting,
99
            holds_waiting       => $holds_waiting,
94
            total_owing         => $total,
100
            total_owing         => $total,
101
            patron_messages     => $patron_messages,
102
            opacnote            => $patron_note,
95
        );
103
        );
96
    }
104
    }
97
}
105
}
98
- 

Return to bug 26123