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

(-)a/installer/data/mysql/atomicupdate/bug_17268_add_macros_table.perl (+27 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    unless ( TableExists('advanced_editor_macros') ) {
4
        $dbh->do(q|
5
            CREATE TABLE advanced_editor_macros (
6
            id INT(11) NOT NULL AUTO_INCREMENT,        
7
            name varchar(80) NOT NULL,
8
            macro longtext NULL,
9
            borrowernumber INT(11) default NULL,
10
            public BIT default 0,
11
            PRIMARY KEY (id),
12
            CONSTRAINT borrower_macro_fk FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
13
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;|
14
        );
15
    }
16
    $dbh->do(q|
17
        INSERT IGNORE INTO permissions (module_bit, code, description)
18
        VALUES (9, 'create_public_macros', 'Create public macros')
19
    |);
20
    $dbh->do(q|
21
        INSERT IGNORE INTO permissions (module_bit, code, description)
22
        VALUES (9, 'delete_public_macros', 'Delete public macros')
23
    |);
24
25
    SetVersion( $DBversion );
26
    print "Upgrade to $DBversion done (Bug 17682 - Add macros db table and permissions)\n";
27
}
(-)a/installer/data/mysql/userpermissions.sql (+2 lines)
Lines 39-44 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
39
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
39
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
40
   ( 9, 'fast_cataloging', 'Fast cataloging'),
40
   ( 9, 'fast_cataloging', 'Fast cataloging'),
41
   ( 9, 'advanced_editor', 'Use the advanced cataloging editor (requires edit_catalogue)'),
41
   ( 9, 'advanced_editor', 'Use the advanced cataloging editor (requires edit_catalogue)'),
42
   ( 9, 'create_public_macros', 'Create public macros'),
43
   ( 9, 'delete_public_macros', 'Delete public macros'),
42
   ( 9, 'edit_items', 'Edit items'),
44
   ( 9, 'edit_items', 'Edit items'),
43
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
45
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
44
   ( 9, 'delete_all_items', 'Delete all items at once'),
46
   ( 9, 'delete_all_items', 'Delete all items at once'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (-1 / +10 lines)
Lines 279-284 Link Here
279
            Use the advanced cataloging editor (requires edit_catalogue)
279
            Use the advanced cataloging editor (requires edit_catalogue)
280
        </span>
280
        </span>
281
        <span class="permissioncode">([% name | html %])</span>
281
        <span class="permissioncode">([% name | html %])</span>
282
    [%- CASE 'create_public_macros' -%]
283
        <span class="sub_permission create_public_macros_subpermission">
284
            Create public macros (requires advanced_editor)
285
        </span>
286
        <span class="permissioncode">([% name | html %])</span>
287
    [%- CASE 'delete_public_macros' -%]
288
        <span class="sub_permission delete_public_macros_subpermission">
289
            Delete public macros (requires advanced_editor)
290
        </span>
291
        <span class="permissioncode">([% name | html %])</span>
282
    [%- CASE 'edit_items' -%]
292
    [%- CASE 'edit_items' -%]
283
        <span class="sub_permission edit_items_subpermission">
293
        <span class="sub_permission edit_items_subpermission">
284
            Edit items
294
            Edit items
285
- 

Return to bug 17268