Bugzilla – Attachment 128218 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 - Add send_messages_to_borrowers permission
Bug-29393---Add-sendmessagestoborrowers-permission.patch (text/plain), 4.82 KB, created by
Alex Arnaud
on 2021-12-03 14:01:20 UTC
(
hide
)
Description:
Bug 29393 - Add send_messages_to_borrowers permission
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2021-12-03 14:01:20 UTC
Size:
4.82 KB
patch
obsolete
>From 6f4a030d8fa9e361a9f93f3cc5d6b40ef87e3d80 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 10 Nov 2021 14:45:17 +0100 >Subject: [PATCH] Bug 29393 - Add send_messages_to_borrowers permission > >Sponsored-by: Aix-Marseille University >--- > circ/add_message.pl | 5 +++++ > .../atomicupdate/Bug_29393_add_send_message_permission.pl | 14 ++++++++++++++ > installer/data/mysql/mandatory/userpermissions.sql | 1 + > .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 4 +++- > koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ > 5 files changed, 28 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug_29393_add_send_message_permission.pl > >diff --git a/circ/add_message.pl b/circ/add_message.pl >index e9a95cf..abf4052 100755 >--- a/circ/add_message.pl >+++ b/circ/add_message.pl >@@ -57,6 +57,11 @@ if ( $message_type eq 'L' or $message_type eq 'B' ) { > } > > 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 $letter = { > title => $borrower_subject, > content => $borrower_message >diff --git a/installer/data/mysql/atomicupdate/Bug_29393_add_send_message_permission.pl b/installer/data/mysql/atomicupdate/Bug_29393_add_send_message_permission.pl >new file mode 100644 >index 0000000..12327f9 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug_29393_add_send_message_permission.pl >@@ -0,0 +1,14 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "29393", >+ description => "Add permission borrowers:send_messages_to_borrowers", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{INSERT INTO permissions (module_bit, code, description) >+ VALUES (4, 'send_messages_to_borrowers', 'Send messages to patrons')}); >+ say $out "Update is going well so far"; >+ }, >+} >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index f070e50..d682cde 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -39,6 +39,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 3, 'manage_background_jobs', 'Manage background jobs'), > ( 4, 'delete_borrowers', 'Delete patrons'), > ( 4, 'edit_borrowers', 'Add, modify and view patron information'), >+ ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'), > ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), > ( 6, 'place_holds', 'Place holds for patrons'), > ( 6, 'modify_holds_priority', 'Modify holds priority'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 37b0011..d32361e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -103,7 +103,9 @@ > <select name="message_type" id="message_type"> > <option value="L">Staff - Internal note</option> > <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option> >- <option value="E">Email - email addresses of patron</option> >+ [% IF CAN_user_borrowers_send_messages_to_borrowers %] >+ <option value="E">Email - email addresses of patron</option> >+ [% END %] > </select> > </div> > [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index cbbe30f..f740848 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -285,6 +285,11 @@ > View patron infos from any libraries. If not set the logged in user could only access patron infos from its own library or group of libraries. > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'send_messages_to_borrowers' -%] >+ <span class="sub_permission send_messages_to_borrowers_subpermission"> >+ Send messages to patrons >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'modify_holds_priority' -%] > <span class="sub_permission modify_holds_priority_subpermission"> > Modify holds priority >-- >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 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