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

(-)a/installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (9, 'delete_any_record', 'Delete any existing record')});
4
5
    NewVersion( $DBversion, undef, "Add delete_any_record user permission" );
6
}
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 65-70 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
65
   ( 9, 'delete_all_items', 'Delete all items at once'),
65
   ( 9, 'delete_all_items', 'Delete all items at once'),
66
   ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'),
66
   ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'),
67
   ( 9, 'manage_item_editor_templates', 'Update and delete item editor template owned by others'),
67
   ( 9, 'manage_item_editor_templates', 'Update and delete item editor template owned by others'),
68
   ( 9, 'delete_any_record', 'Delete any existing record'),
68
   ( 9, 'edit_any_item', 'Edit any item regardless of home library'),
69
   ( 9, 'edit_any_item', 'Edit any item regardless of home library'),
69
   ( 9, 'edit_locked_records', 'Edit locked records'),
70
   ( 9, 'edit_locked_records', 'Edit locked records'),
70
   ( 9, 'set_record_sources', 'Set record source'),
71
   ( 9, 'set_record_sources', 'Set record source'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-24 / +30 lines)
Lines 128-159 Link Here
128
128
129
                [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
129
                [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
130
                    [% IF ( count ) %]
130
                    [% IF ( count ) %]
131
                        <li
131
                        [% IF CAN_user_editcatalogue_delete_any_record %]
132
                            data-bs-toggle="tooltip"
132
                            <li
133
                            data-bs-placement="left"
133
                                data-bs-toggle="tooltip"
134
                            title="[%- I18N.tnx('There is an item attached to this record. You must delete all items before deleting this record', 'There are {count} items attached to this record. You must delete all items before deleting this record', count, { count => count }) -%]"
134
                                data-bs-placement="left"
135
                        >
135
                                title="[%- I18N.tnx('There is an item attached to this record. You must delete all items before deleting this record', 'There are {count} items attached to this record. You must delete all items before deleting this record', count, { count => count }) -%]"
136
                            <a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a>
136
                            >
137
                        </li>
137
                                <a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a>
138
                            </li>
139
                        [% END %]
138
                    [% ELSIF ( biblio.subscriptions.count ) %]
140
                    [% ELSIF ( biblio.subscriptions.count ) %]
139
                        [%- SET subscriptions_count = biblio.subscriptions.count -%]
141
                        [% IF CAN_user_editcatalogue_delete_any_record %]
140
                        <li
142
                            [%- SET subscriptions_count = biblio.subscriptions.count -%]
141
                            data-bs-toggle="tooltip"
143
                            <li
142
                            data-bs-placement="left"
144
                                data-bs-toggle="tooltip"
143
                            title="[%- I18N.tnx('There is a subscription attached to this record. You must delete all subscriptions before deleting this record', 'There are {subscriptions_count} subscriptions attached to this record. You must delete all subscriptions before deleting this record', subscriptions_count, { subscriptions_count => subscriptions_count }) -%]"
145
                                data-bs-placement="left"
144
                        >
146
                                title="[%- I18N.tnx('There is a subscription attached to this record. You must delete all subscriptions before deleting this record', 'There are {subscriptions_count} subscriptions attached to this record. You must delete all subscriptions before deleting this record', subscriptions_count, { subscriptions_count => subscriptions_count }) -%]"
145
                            <a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a>
147
                            >
146
                        </li>
148
                                <a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a>
149
                            </li>
150
                        [% END %]
147
                    [% ELSE %]
151
                    [% ELSE %]
148
                        <li>
152
                        [% IF CAN_user_editcatalogue_delete_any_record %]
149
                            <form action="/cgi-bin/koha/cataloguing/addbiblio.pl" method="post">
153
                            <li>
150
                                [% INCLUDE 'csrf-token.inc' %]
154
                                <form action="/cgi-bin/koha/cataloguing/addbiblio.pl" method="post">
151
                                <input type="hidden" name="op" value="cud-delete" />
155
                                    [% INCLUDE 'csrf-token.inc' %]
152
                                <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
156
                                    <input type="hidden" name="op" value="cud-delete" />
153
                                <input type="hidden" name="searchid" value="[% searchid | html %]" />
157
                                    <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
154
                            </form>
158
                                    <input type="hidden" name="searchid" value="[% searchid | html %]" />
155
                            <a class="dropdown-item" id="deletebiblio" data-order-manage="[% CAN_user_acquisition_order_manage | html %]" href="#">Delete record</a>
159
                                </form>
156
                        </li>
160
                                <a class="dropdown-item" id="deletebiblio" data-order-manage="[% CAN_user_acquisition_order_manage | html %]" href="#">Delete record</a>
161
                            </li>
162
                        [% END %]
157
                    [% END %]
163
                    [% END %]
158
                [% END %]
164
                [% END %]
159
165
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (-1 / +2 lines)
Lines 293-298 Link Here
293
    [%- CASE 'fast_cataloging' -%]
293
    [%- CASE 'fast_cataloging' -%]
294
        <span class="sub_permission fast_cataloging_subpermission"> Fast cataloging </span>
294
        <span class="sub_permission fast_cataloging_subpermission"> Fast cataloging </span>
295
        <span class="permissioncode">([% name | html %])</span>
295
        <span class="permissioncode">([% name | html %])</span>
296
    [%- CASE 'delete_any_record' -%]
297
        <span class="sub_permission delete_any_record_subpermission"> Delete any existing record </span>
296
    [%- CASE 'manage_item_groups' -%]
298
    [%- CASE 'manage_item_groups' -%]
297
        <span class="sub_permission manage_item_groups_subpermission"> Create, update and delete item groups, add or remove items from an item group </span>
299
        <span class="sub_permission manage_item_groups_subpermission"> Create, update and delete item groups, add or remove items from an item group </span>
298
        <span class="permissioncode">([% name | html %])</span>
300
        <span class="permissioncode">([% name | html %])</span>
299
- 

Return to bug 35953