Bugzilla – Attachment 108427 Details for
Bug 26123
Show info about existing OPAC note/Patron message on patron's dashboard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26123: Add notice about new messages to the patron dashboard
Bug-26123-Add-notice-about-new-messages-to-the-pat.patch (text/plain), 4.29 KB, created by
Lucas Gass (lukeg)
on 2020-08-17 23:20:38 UTC
(
hide
)
Description:
Bug 26123: Add notice about new messages to the patron dashboard
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2020-08-17 23:20:38 UTC
Size:
4.29 KB
patch
obsolete
>From e1e13a97c4aeadc4297ec3834b3f7faefa105f51 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Sun, 2 Aug 2020 22:29:20 +0000 >Subject: [PATCH] Bug 26123: Add notice about new messages to the patron > dashboard > >This patch adds a notice to the patron OPAC when a logged on user of the OPAC has 1 or more OPAC messages, this includes both patron messages and the OPAC note. For privacy this doesn't show any of the messages/note on opac-main.tt. Instead it adds up the total number of patron messages + OPAC notes and displays that number in the dashboard >Test plan: >1. Apply patch, restart_all. >2. Add some OPAC messages for a patron and login as that patron. >3. On the OPAC main page you should see a notice about your OPAC messages, incdicating how many you have. >4. Add multiple OPAC messages and make sure it all continues to work. >5. Also add an OPAC note, this should add 1 to the total number of messages on the dashboard. >6. Try an OPAC without any messages. >7. Test it with some other notices that would appear on the dashboard, checkouts, holds, overdues. >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt | 8 ++++++++ > opac/opac-main.pl | 9 +++++++-- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 2288fc6b9f..ef7ec54578 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -215,6 +215,14 @@ > [% IF total_owing && total_owing > 0 %] > <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> > [% END %] >+ [% IF opacnote %] >+ [% message_note_count = patron_messages.count + 1 %] >+ [% ELSE %] >+ [% message_note_count = patron_mssages.count %] >+ [% END %] >+ [% IF (patron_messages && patron_messages.count > 0) || opacnote %] >+ <li><a href="/cgi-bin/koha/opac-user.pl"><span class="count_label">[% message_note_count | html %]</span> message(s)</a></li> >+ [% END %] > </ul> > </div> > [% END %] >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index b5a5b284e9..f0b15886a8 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -30,6 +30,7 @@ use C4::Overdues; > use Koha::Checkouts; > use Koha::Holds; > use Koha::News; >+use Koha::Patron::Messages; > > my $input = new CGI; > my $dbh = C4::Context->dbh; >@@ -75,16 +76,18 @@ if (defined $news_id){ > > # For dashboard > my $patron = Koha::Patrons->find( $borrowernumber ); >+my $borr = $patron->unblessed; > > if ( $patron ) { > my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count; > my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); > my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count; > my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count; >- >+ my $patron_messages = Koha::Patron::Messages->search({borrowernumber => $borrowernumber}); >+ my $patron_note = $borr->{opacnote}; > my $total = $patron->account->balance; > >- if ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 ) { >+ if ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 || $patron_messages > 0 ) { > $template->param( > dashboard_info => 1, > checkouts => $checkouts, >@@ -92,6 +95,8 @@ if ( $patron ) { > holds_pending => $holds_pending, > holds_waiting => $holds_waiting, > total_owing => $total, >+ patron_messages => $patron_messages, >+ opacnote => $patron_note, > ); > } > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26123
:
107664
|
107685
|
108427
|
109122
|
109134
|
111336
|
112139
|
112227
|
112519
|
114769