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 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 33-40 Link Here
33
                        [% IF servers.count > 0 %]
33
                        [% IF servers.count > 0 %]
34
                            <li><a class="dropdown-item" id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
34
                            <li><a class="dropdown-item" id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
35
                        [% END %]
35
                        [% END %]
36
                        [% UNLESS ( count ) %]
36
                        [% IF ( CAN_user_editauthorities_merge_delete_authorities ) %]
37
                            <li><a class="dropdown-item" href="#" id="delAuth">Delete record</a></li>
37
                            [% UNLESS ( count ) %]
38
                                <li><a class="dropdown-item" href="#" id="delAuth">Delete record</a></li>
39
                            [% END %]
38
                        [% END %]
40
                        [% END %]
39
                    </ul>
41
                    </ul>
40
                </div>
42
                </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 672-677 Link Here
672
            Browse the system logs
672
            Browse the system logs
673
        </span>
673
        </span>
674
        <span class="permissioncode">([% name | html %])</span>
674
        <span class="permissioncode">([% name | html %])</span>
675
    [%- CASE 'merge_delete_authorities' -%]
676
        <span class="sub_permission merge_delete_authorities">
677
            Merge and delete authority records
678
        </span>
679
        <span class="permissioncode">([% name | html %])</span>
675
    [%- CASE 'check_expiration' -%]
680
    [%- CASE 'check_expiration' -%]
676
        <span class="sub_permission check_expiration_subpermission">
681
        <span class="sub_permission check_expiration_subpermission">
677
            Check the expiration of a serial
682
            Check the expiration of a serial
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt (+8 lines)
Lines 42-47 div#result { margin-top: 1em; } Link Here
42
42
43
<h1>Merging records</h1>
43
<h1>Merging records</h1>
44
44
45
[% IF CAN_user_editauthorities_merge_delete_authorities %]
46
45
[% IF ( errors ) %]
47
[% IF ( errors ) %]
46
48
47
    [% FOREACH error IN errors %]
49
    [% FOREACH error IN errors %]
Lines 129-134 div#result { margin-top: 1em; } Link Here
129
</fieldset>
131
</fieldset>
130
</form>
132
</form>
131
133
134
[% END %]
135
136
[% ELSE %]
137
138
<div class="dialog alert">You do not have the required privileges to merge authorities.</div>
139
132
[% END %]
140
[% END %]
133
141
134
        </main>
142
        </main>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-19 / +20 lines)
Lines 108-131 Link Here
108
            Actions</a>
108
            Actions</a>
109
            <ul class="dropdown-menu dropdown-menu-end" role="menu" aria-labelledby="authactions[% resul.authid | html %]">
109
            <ul class="dropdown-menu dropdown-menu-end" role="menu" aria-labelledby="authactions[% resul.authid | html %]">
110
              <li><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
              <li><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
              <li><a class="merge_auth dropdown-item" href="#merge"><i class="fa fa-compress"></i> Merge</a></li>
111
              [% IF CAN_user_editauthorities_merge_delete_authorities %]
112
              [% UNLESS ( resul.used ) %]
112
                  <li><a class="merge_auth dropdown-item" href="#merge"><i class="fa fa-compress"></i> Merge</a></li>
113
                  <li><form class="form_delete" method="post" action="/cgi-bin/koha/authorities/authorities-home.pl">
113
                  [% UNLESS ( resul.used ) %]
114
                      [% INCLUDE 'csrf-token.inc' %]
114
                      <li><form class="form_delete" method="post" action="/cgi-bin/koha/authorities/authorities-home.pl">
115
                      <input type="hidden" name="op" value="cud-delete" />
115
                          [% INCLUDE 'csrf-token.inc' %]
116
                      <input type="hidden" name="authid" value="[% resul.authid | html %]" />
116
                          <input type="hidden" name="op" value="cud-delete" />
117
                      <input type="hidden" name="type" value="intranet" />
117
                          <input type="hidden" name="authid" value="[% resul.authid | html %]" />
118
                      <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
118
                          <input type="hidden" name="type" value="intranet" />
119
                      <input type="hidden" name="marclist" value="[% marclist | html %]" />
119
                          <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
120
                      <input type="hidden" name="and_or" value="[% and_or | html %]" />
120
                          <input type="hidden" name="marclist" value="[% marclist | html %]" />
121
                      <input type="hidden" name="excluding" value="[% excluding | html %]" />
121
                          <input type="hidden" name="and_or" value="[% and_or | html %]" />
122
                      <input type="hidden" name="operator" value="[% operator | html %]" />
122
                          <input type="hidden" name="excluding" value="[% excluding | html %]" />
123
                      <input type="hidden" name="orderby" value="[% orderby | html %]" />
123
                          <input type="hidden" name="operator" value="[% operator | html %]" />
124
                      <input type="hidden" name="value" value="[% value | html %]" />
124
                          <input type="hidden" name="orderby" value="[% orderby | html %]" />
125
                      <input type="hidden" name="startfrom" value="[% startfrom | html %]" />
125
                          <input type="hidden" name="value" value="[% value | html %]" />
126
                      <input type="hidden" name="resultsperpage" value="[% resultsperpage | html %]" />
126
                          <input type="hidden" name="startfrom" value="[% startfrom | html %]" />
127
                      <button type="submit" class="dropdown-item"><i class="fa fa-trash"></i> Delete</button>
127
                          <input type="hidden" name="resultsperpage" value="[% resultsperpage | html %]" />
128
                  </form></li>
128
                          <button type="submit" class="dropdown-item"><i class="fa fa-trash"></i> Delete</button>
129
                      </form></li>
130
              [% END %]
129
              [% END %]
131
              [% END %]
130
              <li class="authority_preview">
132
              <li class="authority_preview">
131
                <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>
133
                <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>
132
- 

Return to bug 35871