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

(-)a/circ/add_message.pl (+5 lines)
Lines 64-69 elsif( $op eq 'cud-add_message' ) { Link Here
64
    }
64
    }
65
65
66
    if ( $message_type eq 'E' ) {
66
    if ( $message_type eq 'E' ) {
67
        my $logged_in_patron = Koha::Patrons->find( $loggedinuser );
68
        if ( !$logged_in_patron->has_permission({ borrowers => 'send_messages_to_borrowers' }) ) {
69
            C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
70
        }
71
67
        my $letter = {
72
        my $letter = {
68
            title   => $borrower_subject,
73
            title   => $borrower_subject,
69
            content => $borrower_message
74
            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 46-51 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
46
   ( 4, 'delete_borrowers', 'Delete patrons'),
46
   ( 4, 'delete_borrowers', 'Delete patrons'),
47
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
47
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
48
   ( 4, 'list_borrowers', 'Search, list and view patrons'),
48
   ( 4, 'list_borrowers', 'Search, list and view patrons'),
49
   ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
49
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
50
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
50
   ( 6, 'place_holds', 'Place holds for patrons'),
51
   ( 6, 'place_holds', 'Place holds for patrons'),
51
   ( 6, 'modify_holds_priority', 'Modify holds priority'),
52
   ( 6, 'modify_holds_priority', 'Modify holds priority'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +3 lines)
Lines 137-143 Link Here
137
                        <select name="message_type" id="message_type">
137
                        <select name="message_type" id="message_type">
138
                            <option value="L">Staff - Internal note</option>
138
                            <option value="L">Staff - Internal note</option>
139
                            <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option>
139
                            <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option>
140
                            <option value="E">Email - email addresses of patron</option>
140
                            [% IF CAN_user_borrowers_send_messages_to_borrowers %]
141
                                <option value="E">Email - email addresses of patron</option>
142
                            [% END %]
141
                        </select>
143
                        </select>
142
                    </div>
144
                    </div>
143
                    [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
145
                    [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (-1 / +5 lines)
Lines 322-327 Link Here
322
            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.
322
            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.
323
        </span>
323
        </span>
324
        <span class="permissioncode">([% name | html %])</span>
324
        <span class="permissioncode">([% name | html %])</span>
325
    [%- CASE 'send_messages_to_borrowers' -%]
326
        <span class="sub_permission send_messages_to_borrowers_subpermission">
327
            Send messages to patrons
328
        </span>
329
        <span class="permissioncode">([% name | html %])</span>
325
    [%- CASE 'modify_holds_priority' -%]
330
    [%- CASE 'modify_holds_priority' -%]
326
        <span class="sub_permission modify_holds_priority_subpermission">
331
        <span class="sub_permission modify_holds_priority_subpermission">
327
            Modify holds priority
332
            Modify holds priority
328
- 

Return to bug 29393