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_add_merge_delete_authorities_subpermission (+22 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35871",
5
    description => "Adding a merge_delete_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','merge_delete_authorities','Merge and delete authority records')});
14
15
            NewVersion( $DBversion, undef, "Bug 35871: Add merge_delete_authorities user subpermission" );
16
        }
17
18
        # Print useful stuff here
19
        # permissions
20
        say $out "Added new permission 'merge_delete_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, 'merge_delete_authorities', 'Merge and delete 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 (-2 / +4 lines)
Lines 35-42 Link Here
35
                        [% IF servers.count > 0 %]
35
                        [% IF servers.count > 0 %]
36
                            <li><a id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
36
                            <li><a id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
37
                        [% END %]
37
                        [% END %]
38
                        [% UNLESS ( count ) %]
38
                        [% IF ( CAN_user_editauthorities_merge_delete_authorities ) %]
39
                            <li><a href="#" id="delAuth">Delete record</a></li>
39
                            [% UNLESS ( count ) %]
40
                                <li><a href="#" id="delAuth">Delete record</a></li>
41
                            [% END %]
40
                        [% END %]
42
                        [% END %]
41
                    </ul>
43
                    </ul>
42
                </div>
44
                </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 637-642 Link Here
637
            Browse the system logs
637
            Browse the system logs
638
        </span>
638
        </span>
639
        <span class="permissioncode">([% name | html %])</span>
639
        <span class="permissioncode">([% name | html %])</span>
640
    [%- CASE 'merge_delete_authorities' -%]
641
        <span class="sub_permission merge_delete_authorities">
642
            Merge and delete authority records
643
        </span>
644
        <span class="permissioncode">([% name | html %])</span>
640
    [%- CASE 'check_expiration' -%]
645
    [%- CASE 'check_expiration' -%]
641
        <span class="sub_permission check_expiration_subpermission">
646
        <span class="sub_permission check_expiration_subpermission">
642
            Check the expiration of a serial
647
            Check the expiration of a serial
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt (+8 lines)
Lines 40-45 div#result { margin-top: 1em; } Link Here
40
40
41
<h1>Merging records</h1>
41
<h1>Merging records</h1>
42
42
43
[% IF CAN_user_editauthorities_merge_delete_authorities %]
44
43
[% IF ( errors ) %]
45
[% IF ( errors ) %]
44
46
45
    [% FOREACH error IN errors %]
47
    [% FOREACH error IN errors %]
Lines 119-124 div#result { margin-top: 1em; } Link Here
119
<fieldset class="action"><input type="submit" name="merge" class="btn btn-primary" value="Merge" /></fieldset>
121
<fieldset class="action"><input type="submit" name="merge" class="btn btn-primary" value="Merge" /></fieldset>
120
</form>
122
</form>
121
123
124
[% END %]
125
126
[% ELSE %]
127
128
<div class="dialog alert">You do not have the required privileges to merge authorities.</div>
129
122
[% END %]
130
[% END %]
123
131
124
        </main>
132
        </main>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-4 / +5 lines)
Lines 107-115 Link Here
107
            Actions <b class="caret"></b></a>
107
            Actions <b class="caret"></b></a>
108
            <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authactions[% resul.authid | html %]">
108
            <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authactions[% resul.authid | html %]">
109
              <li><a href="/cgi-bin/koha/authorities/authorities.pl?authid=[% resul.authid | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li>
109
              <li><a 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
              <li><a class="merge_auth" href="#merge"><i class="fa fa-compress"></i> Merge</a></li>
110
              [% IF CAN_user_editauthorities_merge_delete_authorities %]
111
              [% UNLESS ( resul.used ) %]
111
                <li><a class="merge_auth" href="#merge"><i class="fa fa-compress"></i> Merge</a></li>
112
                <li><a onclick='return confirm_deletion("[% resul.authid | html %]")'><i class="fa fa-trash-can"></i> Delete</a></li>
112
                [% UNLESS ( resul.used ) %]
113
                  <li><a onclick='return confirm_deletion("[% resul.authid | html %]")'><i class="fa fa-trash"></i> Delete</a></li>
114
                [% END %]
113
              [% END %]
115
              [% END %]
114
              <li class="authority_preview">
116
              <li class="authority_preview">
115
                <a 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>
117
                <a 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>
116
- 

Return to bug 35871