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 48-53 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
48
   ( 9, 'edit_items', 'Edit items'),
48
   ( 9, 'edit_items', 'Edit items'),
49
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
49
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
50
   ( 9, 'delete_all_items', 'Delete all items at once'),
50
   ( 9, 'delete_all_items', 'Delete all items at once'),
51
   ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'),
51
   (10, 'payout', 'Perform account payout action'),
52
   (10, 'payout', 'Perform account payout action'),
52
   (10, 'refund', 'Perform account refund action'),
53
   (10, 'refund', 'Perform account refund action'),
53
   (10, 'discount', 'Perform account discount action'),
54
   (10, 'discount', 'Perform account discount action'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 325-330 Link Here
325
            Fast cataloging
325
            Fast cataloging
326
        </span>
326
        </span>
327
        <span class="permissioncode">([% name | html %])</span>
327
        <span class="permissioncode">([% name | html %])</span>
328
    [%- CASE 'manage_volumes' -%]
329
        <span class="sub_permission manage_volumes_subpermission">
330
            Create, update and delete volumes, add or remove items from a volume
331
        </span>
332
        <span class="permissioncode">([% name | html %])</span>
328
    [%- CASE 'remaining_permissions' -%]
333
    [%- CASE 'remaining_permissions' -%]
329
        <span class="sub_permission remaining_permissions_subpermission">
334
        <span class="sub_permission remaining_permissions_subpermission">
330
            Remaining permissions for managing fines and fees
335
            Remaining permissions for managing fines and fees
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-11 / +17 lines)
Lines 278-284 Link Here
278
              [% IF CAN_user_tools_items_batchmod %]
278
              [% IF CAN_user_tools_items_batchmod %]
279
                <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
279
                <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
280
              [% END %]
280
              [% END %]
281
              [% IF biblio.volumes.count %]
281
              [% IF CAN_user_editcatalogue_manage_volumes && biblio.volumes.count %]
282
                <a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a>
282
                <a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a>
283
                <a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a>
283
                <a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a>
284
              [% END %]
284
              [% END %]
Lines 580-588 Note that permanent location is a code, and location may be an authval. Link Here
580
580
581
[% IF Koha.Preference('EnableVolumes') %]
581
[% IF Koha.Preference('EnableVolumes') %]
582
    <div id="volumes">
582
    <div id="volumes">
583
        <div class="volumes_table_table_controls">
583
        [% IF CAN_user_editcatalogue_manage_volumes %]
584
            <a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> Create new</a>
584
            <div class="volumes_table_table_controls">
585
        </div>
585
                <a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> Create new</a>
586
            </div>
587
        [% END %]
586
        <table class="volumes-table" id="volumes-table">
588
        <table class="volumes-table" id="volumes-table">
587
            <thead>
589
            <thead>
588
                <tr>
590
                <tr>
Lines 1481-1493 Note that permanent location is a code, and location may be an authval. Link Here
1481
                    },
1483
                    },
1482
                    {
1484
                    {
1483
                        "mDataProp": function( oObj ) {
1485
                        "mDataProp": function( oObj ) {
1484
                            return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1486
                            [% IF CAN_user_editcatalogue_manage_volumes %]
1485
                                <i class='fa fa-edit'></i> ${_('Edit')}
1487
                                return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1486
                            </button>`
1488
                                    <i class='fa fa-edit'></i> ${_('Edit')}
1487
                            + '&nbsp'
1489
                                </button>`
1488
                            + `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1490
                                + '&nbsp'
1489
                                <i class='fa fa-trash'></i> ${('Delete')}
1491
                                + `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1490
                            </button>`;
1492
                                    <i class='fa fa-trash'></i> ${('Delete')}
1493
                                </button>`;
1494
                            [% ELSE %]
1495
                                return "";
1496
                            [% END %]
1491
                        },
1497
                        },
1492
                    },
1498
                    },
1493
                ],
1499
                ],
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-2 / +1 lines)
Lines 233-239 Link Here
233
    <input type="hidden" name="indicator" value=" " />
233
    <input type="hidden" name="indicator" value=" " />
234
    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
234
    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
235
235
236
[% IF volumes.count && op != 'saveitem' %]
236
[% IF volumes.count && op != 'saveitem' && CAN_user_editcatalogue_manage_volumes %]
237
    <fieldset class="rows">
237
    <fieldset class="rows">
238
        <legend><i class="fa fa-plus"></i> Add to volume</legend>
238
        <legend><i class="fa fa-plus"></i> Add to volume</legend>
239
        [% FOREACH v IN volumes %]
239
        [% FOREACH v IN volumes %]
240
- 

Return to bug 24857