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

(-)a/authorities/merge.pl (-1 / +1 lines)
Lines 39-45 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
39
        template_name => "authorities/merge.tt",
39
        template_name => "authorities/merge.tt",
40
        query         => $input,
40
        query         => $input,
41
        type          => "intranet",
41
        type          => "intranet",
42
        flagsrequired => { editauthorities => 1 },
42
        flagsrequired => { editauthorities => 'merge_delete_authorities' },
43
    }
43
    }
44
);
44
);
45
45
(-)a/installer/data/mysql/atomicupdate/bug_35871.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "35871",
6
    description => "Add a merge_delete_authorities subpermission for editauthorities",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(
12
            q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ('14','merge_delete_authorities','Merge and delete authority records')}
13
        );
14
15
        say_success( $out, "Added new permission 'merge_delete_authorities'" );
16
    },
17
};
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 128-133 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
128
   (13, 'upload_general_files', 'Upload any file'),
128
   (13, 'upload_general_files', 'Upload any file'),
129
   (13, 'upload_manage', 'Manage uploaded files'),
129
   (13, 'upload_manage', 'Manage uploaded files'),
130
   (14, 'edit_authorities', 'Edit authority records'),
130
   (14, 'edit_authorities', 'Edit authority records'),
131
   (14, 'merge_delete_authorities', 'Merge and delete authority records'),
131
   (15, 'check_expiration', 'Check the expiration of a serial'),
132
   (15, 'check_expiration', 'Check the expiration of a serial'),
132
   (15, 'claim_serials', 'Claim missing serials'),
133
   (15, 'claim_serials', 'Claim missing serials'),
133
   (15, 'create_subscription', 'Create a new subscription'),
134
   (15, 'create_subscription', 'Create a new subscription'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc (-2 / +4 lines)
Lines 26-33 Link Here
26
                        [% IF servers.count > 0 %]
26
                        [% IF servers.count > 0 %]
27
                            <li><a class="dropdown-item" id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
27
                            <li><a class="dropdown-item" id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
28
                        [% END %]
28
                        [% END %]
29
                        [% UNLESS ( count ) %]
29
                        [% IF ( CAN_user_editauthorities_merge_delete_authorities ) %]
30
                            <li><a class="dropdown-item" href="#" id="delAuth">Delete record</a></li>
30
                            [% UNLESS ( count ) %]
31
                                <li><a class="dropdown-item" href="#" id="delAuth">Delete record</a></li>
32
                            [% END %]
31
                        [% END %]
33
                        [% END %]
32
                    </ul>
34
                    </ul>
33
                </div>
35
                </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 450-455 Link Here
450
    [%- CASE 'view_system_logs' -%]
450
    [%- CASE 'view_system_logs' -%]
451
        <span class="sub_permission view_system_logs_subpermission"> Browse the system logs </span>
451
        <span class="sub_permission view_system_logs_subpermission"> Browse the system logs </span>
452
        <span class="permissioncode">([% name | html %])</span>
452
        <span class="permissioncode">([% name | html %])</span>
453
    [%- CASE 'merge_delete_authorities' -%]
454
        <span class="sub_permission merge_delete_authorities">
455
            Merge and delete authority records
456
        </span>
457
        <span class="permissioncode">([% name | html %])</span>
453
    [%- CASE 'check_expiration' -%]
458
    [%- CASE 'check_expiration' -%]
454
        <span class="sub_permission check_expiration_subpermission"> Check the expiration of a serial </span>
459
        <span class="sub_permission check_expiration_subpermission"> Check the expiration of a serial </span>
455
        <span class="permissioncode">([% name | html %])</span>
460
        <span class="permissioncode">([% name | html %])</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt (+5 lines)
Lines 44-49 Link Here
44
[% WRAPPER 'main-container.inc' wide_full => 1 %]
44
[% WRAPPER 'main-container.inc' wide_full => 1 %]
45
    <h1>Merging records</h1>
45
    <h1>Merging records</h1>
46
46
47
  [% IF CAN_user_editauthorities_merge_delete_authorities %]
48
47
    [% IF ( errors ) %]
49
    [% IF ( errors ) %]
48
50
49
        [% FOREACH error IN errors %]
51
        [% FOREACH error IN errors %]
Lines 137-142 Link Here
137
            </fieldset>
139
            </fieldset>
138
        </form>
140
        </form>
139
    [% END %]
141
    [% END %]
142
  [% ELSE %]
143
    <div class="dialog alert">You do not have the required privileges to merge authorities.</div>
144
  [% END %]
140
[% END %]
145
[% END %]
141
146
142
[% MACRO jsinclude BLOCK %]
147
[% MACRO jsinclude BLOCK %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-1 / +2 lines)
Lines 109-114 Link Here
109
                                            <li
109
                                            <li
110
                                                ><a class="dropdown-item" href="/cgi-bin/koha/authorities/authorities.pl?authid=[% resul.authid | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li
110
                                                ><a class="dropdown-item" href="/cgi-bin/koha/authorities/authorities.pl?authid=[% resul.authid | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li
111
                                            >
111
                                            >
112
                                            [% IF CAN_user_editauthorities_merge_delete_authorities %]
112
                                            <li
113
                                            <li
113
                                                ><a class="merge_auth dropdown-item" href="#merge"><i class="fa fa-compress"></i> Merge</a></li
114
                                                ><a class="merge_auth dropdown-item" href="#merge"><i class="fa fa-compress"></i> Merge</a></li
114
                                            >
115
                                            >
Lines 132-137 Link Here
132
                                                    </form></li
133
                                                    </form></li
133
                                                >
134
                                                >
134
                                            [% END %]
135
                                            [% END %]
136
                                            [% END %]
135
                                            <li class="authority_preview">
137
                                            <li class="authority_preview">
136
                                                <a class="dropdown-item" data-authid="[% resul.authid | html %]" href="/cgi-bin/koha/authorities/detail.pl?authid=[% resul.authid | uri %]"><i class="fa-solid fa-eye"></i> MARC preview</a>
138
                                                <a class="dropdown-item" data-authid="[% resul.authid | html %]" href="/cgi-bin/koha/authorities/detail.pl?authid=[% resul.authid | uri %]"><i class="fa-solid fa-eye"></i> MARC preview</a>
137
                                            </li>
139
                                            </li>
138
- 

Return to bug 35871