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/userpermissions.sql (+1 lines)
Lines 46-51 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
46
   ( 9, 'edit_items', 'Edit items'),
46
   ( 9, 'edit_items', 'Edit items'),
47
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
47
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
48
   ( 9, 'delete_all_items', 'Delete all items at once'),
48
   ( 9, 'delete_all_items', 'Delete all items at once'),
49
   ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'),
49
   (10, 'payout', 'Perform account payout action'),
50
   (10, 'payout', 'Perform account payout action'),
50
   (10, 'refund', 'Perform account refund action'),
51
   (10, 'refund', 'Perform account refund action'),
51
   (10, 'discount', 'Perform account discount action'),
52
   (10, 'discount', 'Perform account discount action'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 315-320 Link Here
315
            Fast cataloging
315
            Fast cataloging
316
        </span>
316
        </span>
317
        <span class="permissioncode">([% name | html %])</span>
317
        <span class="permissioncode">([% name | html %])</span>
318
    [%- CASE 'manage_volumes' -%]
319
        <span class="sub_permission manage_volumes_subpermission">
320
            Create, update and delete volumes, add or remove items from a volume
321
        </span>
322
        <span class="permissioncode">([% name | html %])</span>
318
    [%- CASE 'remaining_permissions' -%]
323
    [%- CASE 'remaining_permissions' -%]
319
        <span class="sub_permission remaining_permissions_subpermission">
324
        <span class="sub_permission remaining_permissions_subpermission">
320
            Remaining permissions for managing fines and fees
325
            Remaining permissions for managing fines and fees
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-11 / +17 lines)
Lines 279-285 Link Here
279
              [% IF CAN_user_tools_items_batchmod %]
279
              [% IF CAN_user_tools_items_batchmod %]
280
                <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
280
                <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
281
              [% END %]
281
              [% END %]
282
              [% IF biblio.volumes.count %]
282
              [% IF CAN_user_editcatalogue_manage_volumes && biblio.volumes.count %]
283
                <a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a>
283
                <a class="itemselection_action_volume_set" href="#"><i class="fa fa-book"></i> Add/move to volume</a>
284
                <a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a>
284
                <a class="itemselection_action_volume_unset" href="#"><i class="fa fa-unlink"></i> Remove from volume</a>
285
              [% END %]
285
              [% END %]
Lines 552-560 Note that permanent location is a code, and location may be an authval. Link Here
552
552
553
[% IF Koha.Preference('EnableVolumes') %]
553
[% IF Koha.Preference('EnableVolumes') %]
554
    <div id="volumes">
554
    <div id="volumes">
555
        <div class="volumes_table_table_controls">
555
        [% IF CAN_user_editcatalogue_manage_volumes %]
556
            <a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> Create new</a>
556
            <div class="volumes_table_table_controls">
557
        </div>
557
                <a href="#" class="volume-create btn btn-default btn-xs"><i class="fa fa-plus"></i> Create new</a>
558
            </div>
559
        [% END %]
558
        <table class="volumes-table" id="volumes-table">
560
        <table class="volumes-table" id="volumes-table">
559
            <thead>
561
            <thead>
560
                <tr>
562
                <tr>
Lines 1443-1455 Note that permanent location is a code, and location may be an authval. Link Here
1443
                    },
1445
                    },
1444
                    {
1446
                    {
1445
                        "mDataProp": function( oObj ) {
1447
                        "mDataProp": function( oObj ) {
1446
                            return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1448
                            [% IF CAN_user_editcatalogue_manage_volumes %]
1447
                                <i class='fa fa-edit'></i> ${_('Edit')}
1449
                                return `<button class='volume-edit btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1448
                            </button>`
1450
                                    <i class='fa fa-edit'></i> ${_('Edit')}
1449
                            + '&nbsp'
1451
                                </button>`
1450
                            + `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1452
                                + '&nbsp'
1451
                                <i class='fa fa-trash'></i> ${('Delete')}
1453
                                + `<button class='volume-delete btn btn-default btn-xs' data-volume-id='${oObj.volume_id}'>
1452
                            </button>`;
1454
                                    <i class='fa fa-trash'></i> ${('Delete')}
1455
                                </button>`;
1456
                            [% ELSE %]
1457
                                return "";
1458
                            [% END %]
1453
                        },
1459
                        },
1454
                    },
1460
                    },
1455
                ],
1461
                ],
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-2 / +1 lines)
Lines 234-240 Link Here
234
    <input type="hidden" name="indicator" value=" " />
234
    <input type="hidden" name="indicator" value=" " />
235
    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
235
    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
236
236
237
[% IF volumes.count && op != 'saveitem' %]
237
[% IF volumes.count && op != 'saveitem' && CAN_user_editcatalogue_manage_volumes %]
238
    <fieldset class="rows">
238
    <fieldset class="rows">
239
        <legend><i class="fa fa-plus"></i> Add to volume</legend>
239
        <legend><i class="fa fa-plus"></i> Add to volume</legend>
240
        [% FOREACH v IN volumes %]
240
        [% FOREACH v IN volumes %]
241
- 

Return to bug 24857