View | Details | Raw Unified | Return to bug 29393
Collapse All | Expand All

(-)a/circ/add_message.pl (+5 lines)
Lines 57-62 if ( $message_type eq 'L' or $message_type eq 'B' ) { Link Here
57
}
57
}
58
58
59
if ( $message_type eq 'E' ) {
59
if ( $message_type eq 'E' ) {
60
    my $logged_in_patron = Koha::Patrons->find( $loggedinuser );
61
    if ( !$logged_in_patron->has_permission({ borrowers => 'send_messages_to_borrowers' }) ) {
62
        C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
63
    }
64
60
    my $letter = {
65
    my $letter = {
61
        title   => $borrower_subject,
66
        title   => $borrower_subject,
62
        content => $borrower_message
67
        content => $borrower_message
(-)a/installer/data/mysql/atomicupdate/Bug_29393_add_send_message_permission.pl (+14 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "29393",
5
    description => "Add permission borrowers:send_messages_to_borrowers",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT INTO permissions (module_bit, code, description)
11
            VALUES (4, 'send_messages_to_borrowers', 'Send messages to patrons')});
12
        say $out "Update is going well so far";
13
    },
14
}
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 39-44 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
39
   ( 3, 'manage_background_jobs', 'Manage background jobs'),
39
   ( 3, 'manage_background_jobs', 'Manage background jobs'),
40
   ( 4, 'delete_borrowers', 'Delete patrons'),
40
   ( 4, 'delete_borrowers', 'Delete patrons'),
41
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
41
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
42
   ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
42
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
43
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
43
   ( 6, 'place_holds', 'Place holds for patrons'),
44
   ( 6, 'place_holds', 'Place holds for patrons'),
44
   ( 6, 'modify_holds_priority', 'Modify holds priority'),
45
   ( 6, 'modify_holds_priority', 'Modify holds priority'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +3 lines)
Lines 103-109 Link Here
103
                        <select name="message_type" id="message_type">
103
                        <select name="message_type" id="message_type">
104
                            <option value="L">Staff - Internal note</option>
104
                            <option value="L">Staff - Internal note</option>
105
                            <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option>
105
                            <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option>
106
                            <option value="E">Email - email addresses of patron</option>
106
                            [% IF CAN_user_borrowers_send_messages_to_borrowers %]
107
                                <option value="E">Email - email addresses of patron</option>
108
                            [% END %]
107
                        </select>
109
                        </select>
108
                    </div>
110
                    </div>
109
                    [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
111
                    [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (-1 / +5 lines)
Lines 285-290 Link Here
285
            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.
285
            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.
286
        </span>
286
        </span>
287
        <span class="permissioncode">([% name | html %])</span>
287
        <span class="permissioncode">([% name | html %])</span>
288
    [%- CASE 'send_messages_to_borrowers' -%]
289
        <span class="sub_permission send_messages_to_borrowers_subpermission">
290
            Send messages to patrons
291
        </span>
292
        <span class="permissioncode">([% name | html %])</span>
288
    [%- CASE 'modify_holds_priority' -%]
293
    [%- CASE 'modify_holds_priority' -%]
289
        <span class="sub_permission modify_holds_priority_subpermission">
294
        <span class="sub_permission modify_holds_priority_subpermission">
290
            Modify holds priority
295
            Modify holds priority
291
- 

Return to bug 29393