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

(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 558-564 my ($template, $loggedinuser, $cookie) Link Here
558
    = get_template_and_user({template_name => "authorities/authorities.tt",
558
    = get_template_and_user({template_name => "authorities/authorities.tt",
559
                            query => $input,
559
                            query => $input,
560
                            type => "intranet",
560
                            type => "intranet",
561
                            flagsrequired => {editauthorities => 1},
561
                            flagsrequired => { editauthorities => 'edit_authorities' },
562
                            });
562
                            });
563
$template->param(nonav   => $nonav,index=>$myindex,authtypecode=>$authtypecode,breedingid=>$breedingid, count=>$count);
563
$template->param(nonav   => $nonav,index=>$myindex,authtypecode=>$authtypecode,breedingid=>$breedingid, count=>$count);
564
564
(-)a/installer/data/mysql/atomicupdate/bug_35870_add_edit_authorities_subpermission (+22 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35870",
5
    description => "Adding an edit_authorities subpermission for editauthorities",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $DBversion = 'XXX';
12
        if( CheckVersion( $DBversion ) ) {
13
            $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ('14','edit_authorities','Edit authority records')});
14
15
            NewVersion( $DBversion, undef, "Bug 35870: Add edit_authorities user subpermission" );
16
        }
17
18
        # Print useful stuff here
19
        # permissions
20
        say $out "Added new permission 'edit_authorities'";
21
    },
22
};
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 119-124 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
119
   (13, 'access_files', 'Access to the files stored on the server'),
119
   (13, 'access_files', 'Access to the files stored on the server'),
120
   (13, 'upload_general_files', 'Upload any file'),
120
   (13, 'upload_general_files', 'Upload any file'),
121
   (13, 'upload_manage', 'Manage uploaded files'),
121
   (13, 'upload_manage', 'Manage uploaded files'),
122
   (14, 'edit_authorities', 'Edit authority records'),
122
   (15, 'check_expiration', 'Check the expiration of a serial'),
123
   (15, 'check_expiration', 'Check the expiration of a serial'),
123
   (15, 'claim_serials', 'Claim missing serials'),
124
   (15, 'claim_serials', 'Claim missing serials'),
124
   (15, 'create_subscription', 'Create a new subscription'),
125
   (15, 'create_subscription', 'Create a new subscription'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc (-3 / +3 lines)
Lines 1-8 Link Here
1
[% INCLUDE 'blocking_errors.inc' %]
1
[% INCLUDE 'blocking_errors.inc' %]
2
[% IF ( authid || CAN_user_editauthorities) %]
2
[% IF ( authid || CAN_user_editauthorities_edit_authorities ) %]
3
3
4
    <div id="toolbar" class="btn-toolbar">
4
    <div id="toolbar" class="btn-toolbar">
5
        [% IF ( CAN_user_editauthorities ) %]
5
        [% IF ( CAN_user_editauthorities_edit_authorities ) %]
6
            <div class="btn-group">
6
            <div class="btn-group">
7
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
7
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
8
                    <i class="fa fa-plus"></i> New authority
8
                    <i class="fa fa-plus"></i> New authority
Lines 24-30 Link Here
24
        [% END %]
24
        [% END %]
25
25
26
        [% IF ( authid ) %]
26
        [% IF ( authid ) %]
27
            [% IF ( CAN_user_editauthorities ) %]
27
            [% IF ( CAN_user_editauthorities_edit_authorities ) %]
28
                <div class="btn-group">
28
                <div class="btn-group">
29
                    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
29
                    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
30
                        <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit <span class="caret"></span>
30
                        <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit <span class="caret"></span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 617-622 Link Here
617
            Manage rotating collections
617
            Manage rotating collections
618
        </span>
618
        </span>
619
        <span class="permissioncode">([% name | html %])</span>
619
        <span class="permissioncode">([% name | html %])</span>
620
    [%- CASE 'edit_authorities' -%]
621
        <span class="sub_permission edit_authorities">
622
            Edit authority records
623
        </span>
624
        <span class="permissioncode">([% name | html %])</span>
620
    [%- CASE 'schedule_tasks' -%]
625
    [%- CASE 'schedule_tasks' -%]
621
        <span class="sub_permission schedule_tasks_subpermission">
626
        <span class="sub_permission schedule_tasks_subpermission">
622
            Schedule tasks to run
627
            Schedule tasks to run
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt (-1 / +3 lines)
Lines 95-101 Link Here
95
                                <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
95
                                <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
96
                          [% END %]
96
                          [% END %]
97
                        </td>
97
                        </td>
98
                        <td><a class="btn btn-xs btn-default" href="authorities.pl?authid=[% resul.authid | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit authority</a></td>
98
                        [% IF CAN_user_editauthorities_edit_authorities %]
99
                            <td><a class="btn btn-xs btn-default edit-authority" id="[% resul.authid | html %]" href="authorities.pl?authid=[% resul.authid | html %]"><i class="fa fa-pencil"></i> Edit authority</a></td>
100
                        [% END %]
99
                    </tr>
101
                    </tr>
100
                [% END %]
102
                [% END %]
101
            </table>
103
            </table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-3 / +2 lines)
Lines 70-76 Link Here
70
            [% IF Koha.Preference('ShowHeadingUse') %]
70
            [% IF Koha.Preference('ShowHeadingUse') %]
71
              <th class="heading_use">Heading use</th>
71
              <th class="heading_use">Heading use</th>
72
            [% END %]
72
            [% END %]
73
            [% IF ( CAN_user_editauthorities ) %]
73
            [% IF ( CAN_user_editauthorities_edit_authorities ) %]
74
              <th>&nbsp;</th>
74
              <th>&nbsp;</th>
75
            [% END %]
75
            [% END %]
76
          </tr>
76
          </tr>
Lines 100-106 Link Here
100
                <li>[% IF resul.series %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Series Title</li>
100
                <li>[% IF resul.series %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Series Title</li>
101
            </ul></td>
101
            </ul></td>
102
        [% END %]
102
        [% END %]
103
        [% IF ( CAN_user_editauthorities ) %]
103
        [% IF ( CAN_user_editauthorities_edit_authorities ) %]
104
          <td>
104
          <td>
105
          <div class="btn-group dropup">
105
          <div class="btn-group dropup">
106
            <a class="btn btn-default btn-xs dropdown-toggle" id="authactions[% resul.authid | html %]" role="button" data-toggle="dropdown" href="#">
106
            <a class="btn btn-default btn-xs dropdown-toggle" id="authactions[% resul.authid | html %]" role="button" data-toggle="dropdown" href="#">
107
- 

Return to bug 35870