Bugzilla – Attachment 165520 Details for
Bug 29393
Ability to send emails from patron details page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29393: (QA follow-up) Tidy add_message.pl
Bug-29393-QA-follow-up-Tidy-addmessagepl.patch (text/plain), 3.99 KB, created by
Martin Renvoize (ashimema)
on 2024-04-25 11:01:31 UTC
(
hide
)
Description:
Bug 29393: (QA follow-up) Tidy add_message.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-25 11:01:31 UTC
Size:
3.99 KB
patch
obsolete
>From 9f11d04dd954f5cd292af792ff412c7e159c9777 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Apr 2024 09:59:50 +0100 >Subject: [PATCH] Bug 29393: (QA follow-up) Tidy add_message.pl > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > circ/add_message.pl | 39 +++++++++++++++++++-------------------- > 1 file changed, 19 insertions(+), 20 deletions(-) > >diff --git a/circ/add_message.pl b/circ/add_message.pl >index d5c1ad06400..08cf1e4d9f6 100755 >--- a/circ/add_message.pl >+++ b/circ/add_message.pl >@@ -21,8 +21,8 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > >-use C4::Auth qw( get_template_and_user ); >-use C4::Output qw( output_and_exit ); >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_and_exit ); > use C4::Letters qw( GetPreparedLetter EnqueueLetter ); > use Koha::Patron::Message; > use Koha::Patrons; >@@ -30,10 +30,11 @@ use Koha::Patrons; > my $input = CGI->new; > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { template_name => "circ/circulation.tt", >- query => $input, >- type => "intranet", >- flagsrequired => { borrowers => 'edit_borrowers' }, >+ { >+ template_name => "circ/circulation.tt", >+ query => $input, >+ type => "intranet", >+ flagsrequired => { borrowers => 'edit_borrowers' }, > } > ); > >@@ -47,11 +48,10 @@ my $borrower_subject = $input->param('borrower_subject'); > my $letter_code = $input->param('select_patron_notice'); > my $batch = $input->param('batch'); > >-if ( $op eq 'cud-edit_message' && $message_id) { >+if ( $op eq 'cud-edit_message' && $message_id ) { > my $message = Koha::Patron::Messages->find($message_id); > $message->update( { message => $borrower_message } ) if $message; >-} >-elsif( $op eq 'cud-add_message' ) { >+} elsif ( $op eq 'cud-add_message' ) { > if ( $message_type eq 'L' or $message_type eq 'B' ) { > Koha::Patron::Message->new( > { >@@ -64,9 +64,9 @@ elsif( $op eq 'cud-add_message' ) { > } > > if ( $message_type eq 'E' ) { >- my $logged_in_patron = Koha::Patrons->find( $loggedinuser ); >- if ( !$logged_in_patron->has_permission({ borrowers => 'send_messages_to_borrowers' }) ) { >- C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' ) >+ my $logged_in_patron = Koha::Patrons->find($loggedinuser); >+ if ( !$logged_in_patron->has_permission( { borrowers => 'send_messages_to_borrowers' } ) ) { >+ C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' ); > } > > my $letter = { >@@ -74,23 +74,21 @@ elsif( $op eq 'cud-add_message' ) { > content => $borrower_message > }; > >- my $patron = Koha::Patrons->find( $borrowernumber ); >+ my $patron = Koha::Patrons->find($borrowernumber); > >- if ( $letter_code ) { >+ if ($letter_code) { > $letter = C4::Letters::GetPreparedLetter( > module => 'add_message', > letter_code => $letter_code, > lang => $patron->lang, >- tables => { >- 'borrowers' => $borrowernumber >- }, >+ tables => { 'borrowers' => $borrowernumber }, > ); > } > > C4::Letters::EnqueueLetter( > { >- letter => $letter, >- borrowernumber => $borrowernumber, >+ letter => $letter, >+ borrowernumber => $borrowernumber, > message_transport_type => 'email', > } > ) or warn "can't enqueue letter"; >@@ -98,8 +96,9 @@ elsif( $op eq 'cud-add_message' ) { > } > > my $url = $input->referer; >-if ( $url ) { >+if ($url) { > if ( $url =~ m|circulation\.pl$| ) { >+ > # Trick for POST form from batch checkouts > $url .= "?borrowernumber=$borrowernumber"; > $url .= "&batch=1" if $batch; >-- >2.44.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 29393
:
127237
|
127238
|
127452
|
127506
|
127511
|
127847
|
128215
|
128216
|
128217
|
128218
|
128219
|
128363
|
148187
|
148188
|
148189
|
148190
|
148191
|
148192
|
148193
|
148194
|
149812
|
160107
|
160108
|
160109
|
160110
|
160111
|
160112
|
160113
|
160114
|
160633
|
160638
|
160639
|
165498
|
165499
|
165500
|
165501
|
165502
|
165503
|
165504
|
165505
|
165511
|
165512
|
165513
|
165514
|
165515
|
165516
|
165517
|
165518
|
165519
| 165520 |
165521
|
165522
|
165942