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

(-)a/installer/data/mysql/atomicupdate/bug_24857_item_groups.pl (+49 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "24857",
5
    description => "Add ability to group items on a record",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
12
            ('EnableItemGroups','0','','Enable the item groups feature','YesNo');
13
        });
14
15
        $dbh->do(q{
16
            INSERT INTO permissions (module_bit, code, description) VALUES
17
            ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups');
18
        });
19
20
        unless ( TableExists('item_groups') ) {
21
            $dbh->do(q{
22
                CREATE TABLE `item_groups` (
23
                    `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group",
24
                    `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to",
25
                    `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups",
26
                    `description` MEDIUMTEXT default NULL COMMENT "A group description",
27
                    `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created",
28
                    `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group",
29
                    PRIMARY KEY  (`item_group_id`),
30
                    CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
31
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
32
            });
33
        }
34
35
        unless ( TableExists('item_group_items') ) {
36
            $dbh->do(q{
37
                CREATE TABLE `item_group_items` (
38
                    `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link",
39
                    `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
40
                    `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
41
                    PRIMARY KEY  (`item_group_items_id`),
42
                    UNIQUE KEY (`item_id`),
43
                    CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
44
                    CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
45
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
46
            });
47
        }
48
    },
49
}
(-)a/installer/data/mysql/kohastructure.sql (+31 lines)
Lines 1879-1884 CREATE TABLE `club_fields` ( Link Here
1879
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1879
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1880
/*!40101 SET character_set_client = @saved_cs_client */;
1880
/*!40101 SET character_set_client = @saved_cs_client */;
1881
1881
1882
--
1883
-- Table structure for table `item_groups`
1884
--
1885
1886
DROP TABLE IF EXISTS `item_groups`;
1887
CREATE TABLE `item_groups` (
1888
  `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group",
1889
  `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to",
1890
  `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups",
1891
  `description` MEDIUMTEXT default NULL COMMENT "A group description",
1892
  `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created",
1893
  `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group",
1894
  PRIMARY KEY  (`item_group_id`),
1895
  CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1896
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1897
1898
--
1899
-- Table structure for table `item_group_items`
1900
--
1901
1902
DROP TABLE IF EXISTS `item_group_items`;
1903
CREATE TABLE `item_group_items` (
1904
  `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link",
1905
  `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
1906
  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
1907
  PRIMARY KEY  (`item_group_items_id`),
1908
  UNIQUE KEY (`item_id`),
1909
  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1910
  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1911
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1912
1882
--
1913
--
1883
-- Table structure for table `club_holds`
1914
-- Table structure for table `club_holds`
1884
--
1915
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 208-213 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
208
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
208
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
209
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
209
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
210
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
210
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
211
('EnableItemGroups','0','','Enable the item groups feature','YesNo'),
211
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
212
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
212
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
213
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
213
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
214
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 50-55 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
50
   ( 9, 'edit_items', 'Edit items'),
50
   ( 9, 'edit_items', 'Edit items'),
51
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
51
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
52
   ( 9, 'delete_all_items', 'Delete all items at once'),
52
   ( 9, 'delete_all_items', 'Delete all items at once'),
53
   ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'),
53
   (10, 'payout', 'Perform account payout action'),
54
   (10, 'payout', 'Perform account payout action'),
54
   (10, 'refund', 'Perform account refund action'),
55
   (10, 'refund', 'Perform account refund action'),
55
   (10, 'discount', 'Perform account discount action'),
56
   (10, 'discount', 'Perform account discount action'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 338-343 Link Here
338
            Fast cataloging
338
            Fast cataloging
339
        </span>
339
        </span>
340
        <span class="permissioncode">([% name | html %])</span>
340
        <span class="permissioncode">([% name | html %])</span>
341
    [%- CASE 'manage_item_groups' -%]
342
        <span class="sub_permission manage_item_groups_subpermission">
343
            Create, update and delete item groups, add or remove items from an item group
344
        </span>
345
        <span class="permissioncode">([% name | html %])</span>
341
    [%- CASE 'remaining_permissions' -%]
346
    [%- CASE 'remaining_permissions' -%]
342
        <span class="sub_permission remaining_permissions_subpermission">
347
        <span class="sub_permission remaining_permissions_subpermission">
343
            Remaining permissions for managing fines and fees
348
            Remaining permissions for managing fines and fees
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +7 lines)
Lines 667-673 Circulation: Link Here
667
            - 'the last patron to return an item. This setting is independent of the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=opacreadinghistory">opacreadinghistory</a> and <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AnonymousPatron">AnonymousPatron</a> system preferences.'
667
            - 'the last patron to return an item. This setting is independent of the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=opacreadinghistory">opacreadinghistory</a> and <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AnonymousPatron">AnonymousPatron</a> system preferences.'
668
    Holds policy:
668
    Holds policy:
669
        -
669
        -
670
            - In the staff interface, split the holds queue into separate tables by
670
            - pref: EnableItemGroups
671
              choices:
672
                  yes: Enable
673
                  no: "Don't enable"
674
            - the item groups feature to allow collecting groups of items on a record together.
675
        -
676
            - In the staff client, split the holds queue into separate tables by
671
            - pref: HoldsSplitQueue
677
            - pref: HoldsSplitQueue
672
              choices:
678
              choices:
673
                  nothing: nothing
679
                  nothing: nothing
674
- 

Return to bug 24857