Bugzilla – Attachment 73654 Details for
Bug 20518
Don't show "Messages" header and link on patron details if there are no messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20518 - Don't show "Messages" header and link on patron details if there are no messages
Bug-20518---Dont-show-Messages-header-and-link-on-.patch (text/plain), 6.10 KB, created by
Owen Leonard
on 2018-04-04 16:45:34 UTC
(
hide
)
Description:
Bug 20518 - Don't show "Messages" header and link on patron details if there are no messages
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-04-04 16:45:34 UTC
Size:
6.10 KB
patch
obsolete
>From 7967019ef43344b7350bc8f9aba49e3152964760 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 4 Apr 2018 16:33:34 +0000 >Subject: [PATCH] Bug 20518 - Don't show "Messages" header and link on patron > details if there are no messages > >This patch modifies the patron detail page so that the "Messages" header >is not displayed if there are no messages. > >Unrelated: A minor change was made to moremember.pl to quiet an error in >the log, "Use of uninitialized value $print in string eq at >members/moremember.pl line 219." > >To test, apply the patch and open the detail page for a patron who has >no messages. There should be no "Messages" header or "add message" link. > >Add a message to the patron's account. The message should appear, along >with the "Messages" header and "add message" link. > >The error logs should show no errors. >--- > .../prog/en/modules/members/moremember.tt | 51 ++++++++++++---------- > members/moremember.pl | 6 ++- > 2 files changed, 31 insertions(+), 26 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 44cdb94..163fb13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -63,31 +63,34 @@ > </ul> > </div> > [% END %] >- <div id="messages" class="circmessage"> >- <h4>Messages:</h4> >- <ul> >- [% FOREACH patron_message IN patron_messages %] >- <li> >- [% IF(patron_message.message_type == "L") %] >- <span class="circ-hlt"> >- [% ELSE %] >- <span> >- [% END %] >- [% patron_message.message_date | $KohaDates %] >- [% Branches.GetName( patron_message.branchcode ) %] >- [% IF patron_message.manager_id %] >- ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron_message.manager_id %]">[% patron_message.get_column('manager_firstname') %] [% patron_message.get_column('manager_surname') %]</a> ) >+ >+ [% IF ( patron_messages ) %] >+ <div id="messages" class="circmessage"> >+ <h4>Messages:</h4> >+ <ul> >+ [% FOREACH patron_message IN patron_messages %] >+ <li> >+ [% IF(patron_message.message_type == "L") %] >+ <span class="circ-hlt"> >+ [% ELSE %] >+ <span> > [% END %] >- <i>"[% patron_message.message | html %]"</i> >- </span> >- [% IF patron_message.branchcode == branchcode OR Koha.Preference('AllowAllMessageDeletion') %] >- <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id %]&borrowernumber=[% patron_message.borrowernumber %]&from=moremember" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a> >- [% END %] >- </li> >- [% END %] >- </ul> >- <a id="addnewmessageLabel" href="#add_message_form" class="btn btn-link btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Add a new message</a> >- </div> >+ [% patron_message.message_date | $KohaDates %] >+ [% Branches.GetName( patron_message.branchcode ) %] >+ [% IF patron_message.manager_id %] >+ ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron_message.manager_id %]">[% patron_message.get_column('manager_firstname') %] [% patron_message.get_column('manager_surname') %]</a> ) >+ [% END %] >+ <i>"[% patron_message.message | html %]"</i> >+ </span> >+ [% IF patron_message.branchcode == branchcode OR Koha.Preference('AllowAllMessageDeletion') %] >+ <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id %]&borrowernumber=[% patron_message.borrowernumber %]&from=moremember" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a> >+ [% END %] >+ </li> >+ [% END %] >+ </ul> >+ <a id="addnewmessageLabel" href="#add_message_form" class="btn btn-link btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Add a new message</a> >+ </div> >+ [% END %] > > [% IF ( flagged ) %] > <div id="circmessages" class="circmessage attention"> >diff --git a/members/moremember.pl b/members/moremember.pl >index 0f7eddd..f898adb 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -216,7 +216,7 @@ my $library = Koha::Libraries->find( $data->{branchcode})->unblessed; > @{$data}{keys %$library} = values %$library; # merge in all branch columns # FIXME This is really ugly, we should pass the library instead > > # If printing a page, send the account informations to the template >-if ($print eq "page") { >+if (defined $print and $print eq "page") { > my $accts = Koha::Account::Lines->search( > { borrowernumber => $patron->borrowernumber, amountoutstanding => { '>' => 0 } }, > { order_by => { -desc => 'accountlines_id' } } >@@ -328,6 +328,9 @@ my $patron_messages = Koha::Patron::Messages->search( > } > ); > >+if( $patron_messages->count > 0 ){ >+ $template->param( patron_messages => $patron_messages ); >+} > > # Display the language description instead of the code > # Note that this is certainly wrong >@@ -353,7 +356,6 @@ $template->param( > PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, > relatives_issues_count => $relatives_issues_count, > relatives_borrowernumbers => \@relatives, >- patron_messages => $patron_messages, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.1.4
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 20518
:
73654
|
73787
|
73827