Bugzilla – Attachment 114769 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 message notification to patron dashboard
Bug-26123-Add-message-notification-to-patron-dashb.patch (text/plain), 4.32 KB, created by
Katrin Fischer
on 2021-01-03 14:36:40 UTC
(
hide
)
Description:
Bug 26123: Add message notification to patron dashboard
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-01-03 14:36:40 UTC
Size:
4.32 KB
patch
obsolete
>From 72c40aa399a5604c0b1d9491c41638b53fced26e Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 7 Oct 2020 14:53:37 +0000 >Subject: [PATCH] Bug 26123: Add message notification to patron dashboard >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: >1. Apply patch, restart_all >2. Add some OPAC messages by clicking 'Add a message' on Home ⺠Circulation ⺠Checkouts ⺠patron >3. Log into the OPAC as that patron and you should see a notice about how many messages you have with a link to opac-user.pl >4. Add multiple OPAC messages and make sure it all continues to work. >5. Also add an OPAC note from memberentry.pl. Refresh the OPAC and you should see a 1 message added to the total >6. Try an OPAC without any messages. If there are no messages or any other kind of notification the dashboard should NOT appear at all. >7. Add a 'staff - internal' note. It should not count towards your total messages in the dashboard. >8. Test it with some other notices that would appear on the dashboard, checkouts, holds, overdues. > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt | 7 +++++++ > opac/opac-main.pl | 13 ++++++++++--- > 2 files changed, 17 insertions(+), 3 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 420a514bda..37c50aacdc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -232,6 +232,13 @@ > [% 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 patron_messages && patron_messages.count > 0 || opacnote %] >+ [% IF opacnote %] >+ <li><a href="/cgi-bin/koha/opac-user.pl"><span class="count_label">[% patron_messages.count + 1 | html %]</span> message(s)</a></li> >+ [% ELSE %] >+ <li><a href="/cgi-bin/koha/opac-user.pl"><span class="count_label">[% patron_messages.count | html %]</span> message(s)</a></li> >+ [% END %] >+ [% END %] > </ul> > </div> > [% END %] >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index c572866284..f885a8ab48 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 = CGI->new; > my $dbh = C4::Context->dbh; >@@ -81,10 +82,14 @@ if ( $patron ) { > 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, >+ message_type => 'B', >+ }); >+ my $patron_note = $patron->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_note || $patron_messages->count ) { > $template->param( > dashboard_info => 1, > checkouts => $checkouts, >@@ -92,6 +97,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