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

(-)a/api/v1/swagger/paths/biblios_volumes.json (-7 / +7 lines)
Lines 70-76 Link Here
70
            },
70
            },
71
            "x-koha-authorization": {
71
            "x-koha-authorization": {
72
                "permissions": {
72
                "permissions": {
73
                    "catalogue": "1"
73
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
74
                }
74
                }
75
            },
75
            },
76
            "x-koha-embed": [
76
            "x-koha-embed": [
Lines 169-175 Link Here
169
            },
169
            },
170
            "x-koha-authorization": {
170
            "x-koha-authorization": {
171
                "permissions": {
171
                "permissions": {
172
                    "catalogue": "1"
172
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
173
                }
173
                }
174
            }
174
            }
175
        }
175
        }
Lines 240-246 Link Here
240
            ],
240
            ],
241
            "x-koha-authorization": {
241
            "x-koha-authorization": {
242
                "permissions": {
242
                "permissions": {
243
                    "catalogue": "1"
243
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
244
                }
244
                }
245
            }
245
            }
246
        },
246
        },
Lines 337-343 Link Here
337
            },
337
            },
338
            "x-koha-authorization": {
338
            "x-koha-authorization": {
339
                "permissions": {
339
                "permissions": {
340
                    "catalogue": "1"
340
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
341
                }
341
                }
342
            },
342
            },
343
            "x-koha-embed": [
343
            "x-koha-embed": [
Lines 409-415 Link Here
409
            },
409
            },
410
            "x-koha-authorization": {
410
            "x-koha-authorization": {
411
                "permissions": {
411
                "permissions": {
412
                    "catalogue": "1"
412
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
413
                }
413
                }
414
            }
414
            }
415
        }
415
        }
Lines 501-507 Link Here
501
            },
501
            },
502
            "x-koha-authorization": {
502
            "x-koha-authorization": {
503
                "permissions": {
503
                "permissions": {
504
                    "catalogue": "1"
504
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
505
                }
505
                }
506
            },
506
            },
507
            "x-koha-embed": [
507
            "x-koha-embed": [
Lines 585-591 Link Here
585
            },
585
            },
586
            "x-koha-authorization": {
586
            "x-koha-authorization": {
587
                "permissions": {
587
                "permissions": {
588
                    "catalogue": "1"
588
                    "catalogue": "CAN_user_editcatalogue_manage_volumes"
589
                }
589
                }
590
            }
590
            }
591
        }
591
        }
(-)a/installer/data/mysql/atomicupdate/volumes.perl (+5 lines)
Lines 5-10 if ( CheckVersion( $DBversion ) ) { Link Here
5
        ('EnableVolumes','0','','Enable volumes feature','YesNo');
5
        ('EnableVolumes','0','','Enable volumes feature','YesNo');
6
    });
6
    });
7
7
8
    $dbh->do(q{
9
        INSERT INTO permissions (module_bit, code, description) VALUES
10
        ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume');
11
    });
12
8
    unless ( TableExists('volumes') ) {
13
    unless ( TableExists('volumes') ) {
9
        $dbh->do(q{
14
        $dbh->do(q{
10
            CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha
15
            CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 49-54 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
49
   ( 9, 'edit_items', 'Edit items'),
49
   ( 9, 'edit_items', 'Edit items'),
50
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
50
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
51
   ( 9, 'delete_all_items', 'Delete all items at once'),
51
   ( 9, 'delete_all_items', 'Delete all items at once'),
52
   ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'),
52
   (10, 'payout', 'Perform account payout action'),
53
   (10, 'payout', 'Perform account payout action'),
53
   (10, 'refund', 'Perform account refund action'),
54
   (10, 'refund', 'Perform account refund action'),
54
   (10, 'discount', 'Perform account discount action'),
55
   (10, 'discount', 'Perform account discount action'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 330-335 Link Here
330
            Fast cataloging
330
            Fast cataloging
331
        </span>
331
        </span>
332
        <span class="permissioncode">([% name | html %])</span>
332
        <span class="permissioncode">([% name | html %])</span>
333
    [%- CASE 'manage_volumes' -%]
334
        <span class="sub_permission manage_volumes_subpermission">
335
            Create, update and delete volumes, add or remove items from a volume
336
        </span>
337
        <span class="permissioncode">([% name | html %])</span>
333
    [%- CASE 'remaining_permissions' -%]
338
    [%- CASE 'remaining_permissions' -%]
334
        <span class="sub_permission remaining_permissions_subpermission">
339
        <span class="sub_permission remaining_permissions_subpermission">
335
            Remaining permissions for managing fines and fees
340
            Remaining permissions for managing fines and fees
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-11 / +17 lines)
Lines 310-316 Link Here
310
              [% IF CAN_user_tools_items_batchmod %]
310
              [% IF CAN_user_tools_items_batchmod %]
311
                <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
311
                <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
312
              [% END %]
312
              [% END %]
313
              [% IF biblio.volumes.count %]
313
              [% IF CAN_user_editcatalogue_manage_volumes && biblio.volumes.count %]
314
                <a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a>
314
                <a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a>
315
                <a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a>
315
                <a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a>
316
              [% END %]
316
              [% END %]
Lines 611-619 Note that permanent location is a code, and location may be an authval. Link Here
611
611
612
[% IF Koha.Preference('EnableVolumes') %]
612
[% IF Koha.Preference('EnableVolumes') %]
613
    <div id="volumes">
613
    <div id="volumes">
614
        <div class="volumes_table_table_controls">
614
        [% IF CAN_user_editcatalogue_manage_volumes %]
615
            <a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> Create new</a>
615
            <div class="volumes_table_table_controls">
616
        </div>
616
                <a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> Create new</a>
617
            </div>
618
        [% END %]
617
        <table class="volumes-table" id="volumes-table">
619
        <table class="volumes-table" id="volumes-table">
618
            <thead>
620
            <thead>
619
                <tr>
621
                <tr>
Lines 1541-1553 Note that permanent location is a code, and location may be an authval. Link Here
1541
                    },
1543
                    },
1542
                    {
1544
                    {
1543
                        "mDataProp": function( oObj ) {
1545
                        "mDataProp": function( oObj ) {
1544
                            return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1546
                            [% IF CAN_user_editcatalogue_manage_volumes %]
1545
                                <i class='fa fa-edit'></i> ${_('Edit')}
1547
                                return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1546
                            </button>`
1548
                                    <i class='fa fa-edit'></i> ${_('Edit')}
1547
                            + '&nbsp'
1549
                                </button>`
1548
                            + `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1550
                                + '&nbsp'
1549
                                <i class='fa fa-trash'></i> ${('Delete')}
1551
                                + `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1550
                            </button>`;
1552
                                    <i class='fa fa-trash'></i> ${('Delete')}
1553
                                </button>`;
1554
                            [% ELSE %]
1555
                                return "";
1556
                            [% END %]
1551
                        },
1557
                        },
1552
                    },
1558
                    },
1553
                ],
1559
                ],
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-2 / +1 lines)
Lines 241-247 Link Here
241
    <input type="hidden" name="indicator" value=" " />
241
    <input type="hidden" name="indicator" value=" " />
242
    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
242
    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
243
243
244
[% IF volumes.count && op != 'saveitem' %]
244
[% IF volumes.count && op != 'saveitem' && CAN_user_editcatalogue_manage_volumes %]
245
    <fieldset class="rows">
245
    <fieldset class="rows">
246
        <legend><i class="fa fa-plus"></i> Add to volume</legend>
246
        <legend><i class="fa fa-plus"></i> Add to volume</legend>
247
        [% FOREACH v IN volumes %]
247
        [% FOREACH v IN volumes %]
248
- 

Return to bug 24857