Bugzilla – Attachment 70402 Details for
Bug 19801
Display messages on user details page as well as on check out page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19801 - Display messages on user details page as well as on Check Out page
Bug-19801---Display-messages-on-user-details-page-.patch (text/plain), 6.06 KB, created by
Biblibre Sandboxes
on 2018-01-10 14:02:41 UTC
(
hide
)
Description:
Bug 19801 - Display messages on user details page as well as on Check Out page
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2018-01-10 14:02:41 UTC
Size:
6.06 KB
patch
obsolete
>From ff5e479cdbde0c2a74507bb9a53eac39767cd353 Mon Sep 17 00:00:00 2001 >From: Liz Rea <liz@catalyst.net.nz> >Date: Wed, 13 Dec 2017 15:14:58 +1300 >Subject: [PATCH] Bug 19801 - Display messages on user details page as well as > on Check Out page > >To test: > >Look up a borrower, add a message (internal or opac) >Click the Details tab for that borrower >Messages should be displayed above the user information [is this the right place? it could go below] >adding messages on this page should make them immediately available >deleting messages on this page should delete them immediately and bring you back to the detail page. > >Basically, make sure messages work from both the Check out and detail pages and that there are no typos. > >Messages should work the same as they always have from the Check Out page. > >sponsored-by: Catalyst IT >Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com> > >Signed-off-by: Marjorie Vila <marjorie.barry-vila@collecto.ca> >--- > circ/del_message.pl | 9 +++++-- > .../prog/en/modules/members/moremember.tt | 28 ++++++++++++++++++++-- > members/moremember.pl | 14 +++++++++++ > 3 files changed, 47 insertions(+), 4 deletions(-) > >diff --git a/circ/del_message.pl b/circ/del_message.pl >index ccce661..d7cf91c 100755 >--- a/circ/del_message.pl >+++ b/circ/del_message.pl >@@ -43,5 +43,10 @@ my $message_id = $input->param('message_id'); > my $message = Koha::Patron::Messages->find($message_id); > $message->delete if $message; > >-print $input->redirect( >- "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); >+if ( $input->param('from') == "moremember" ) { >+ print $input->redirect( >+ "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); >+} else { >+ print $input->redirect( >+ "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); >+} >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 180d941..67c168a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -41,6 +41,7 @@ var relatives_borrowernumbers = new Array(); > [% END %] > > var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); >+var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone."); > > columns_settings = [% ColumnsSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) %] > >@@ -190,6 +191,31 @@ function validate1(date) { > </ul> > </div> > [% END %] >+ <div id="messages" class="circmessage"> >+ <h4>Messages:</h4> >+ <ul> >+ [% FOREACH message IN messages %] >+ <li> >+ [% IF(message.message_type == "L") %] >+ <span class="circ-hlt"> >+ [% ELSE %] >+ <span> >+ [% END %] >+ [% message.message_date | $KohaDates %] >+ [% Branches.GetName( message.branchcode ) %] >+ [% IF message.manager_id %] >+ ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.manager_id %]">[% message.get_column('manager_firstname') %] [% message.get_column('manager_surname') %]</a> ) >+ [% END %] >+ <i>"[% message.message | html %]"</i> >+ </span> >+ [% IF message.branchcode == branchcode OR Koha.Preference('AllowAllMessageDeletion') %] >+ <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id %]&borrowernumber=[% 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> > > [% IF ( flagged ) %] > <div id="circmessages" class="circmessage attention"> >@@ -217,7 +243,6 @@ function validate1(date) { > </ul> > </div> > [% END %] >- > <h3>[% UNLESS ( I ) %] > [% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])</h3> > <div class="yui-u first"> >@@ -500,7 +525,6 @@ function validate1(date) { > > </div> > </div> >- > <div id="finesholdsissues" class="toptabs"> > <ul> > <li><a href="#checkouts">[% issuecount %] Checkout(s)</a></li> >diff --git a/members/moremember.pl b/members/moremember.pl >index 27185ef..f10e905 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -55,6 +55,7 @@ use Koha::AuthorisedValues; > use Koha::CsvProfiles; > use Koha::Patron::Debarments qw(GetDebarments); > use Koha::Patron::Images; >+use Koha::Patron::Messages; > use Module::Load; > if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { > load Koha::NorwegianPatronDB, qw( NLGetSyncDataFromBorrowernumber ); >@@ -332,6 +333,18 @@ if ( C4::Context->preference("ExportCircHistory") ) { > $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]); > } > >+my $messages = Koha::Patron::Messages->search( >+ { >+ 'me.borrowernumber' => $borrowernumber, >+ }, >+ { >+ join => 'manager', >+ '+select' => ['manager.surname', 'manager.firstname' ], >+ '+as' => ['manager_surname', 'manager_firstname'], >+ } >+); >+ >+ > # Display the language description instead of the code > # Note that this is certainly wrong > my ( $subtag, $region ) = split '-', $patron->lang; >@@ -360,6 +373,7 @@ $template->param( > PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, > relatives_issues_count => $relatives_issues_count, > relatives_borrowernumbers => \@relatives, >+ messages => $messages, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.7.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 19801
:
69758
|
69798
|
70239
|
70362
|
70363
|
70402
|
70403
|
71286
|
71287
|
71288
|
71365