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 1842-1847 CREATE TABLE `club_fields` ( Link Here
1842
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1842
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1843
/*!40101 SET character_set_client = @saved_cs_client */;
1843
/*!40101 SET character_set_client = @saved_cs_client */;
1844
1844
1845
--
1846
-- Table structure for table `item_groups`
1847
--
1848
1849
DROP TABLE IF EXISTS `item_groups`;
1850
CREATE TABLE `item_groups` (
1851
  `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group",
1852
  `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to",
1853
  `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups",
1854
  `description` MEDIUMTEXT default NULL COMMENT "A group description",
1855
  `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created",
1856
  `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group",
1857
  PRIMARY KEY  (`item_group_id`),
1858
  CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1859
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1860
1861
--
1862
-- Table structure for table `item_group_items`
1863
--
1864
1865
DROP TABLE IF EXISTS `item_group_items`;
1866
CREATE TABLE `item_group_items` (
1867
  `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link",
1868
  `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",
1869
  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
1870
  PRIMARY KEY  (`item_group_items_id`),
1871
  UNIQUE KEY (`item_id`),
1872
  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1873
  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1874
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1875
1845
--
1876
--
1846
-- Table structure for table `club_holds`
1877
-- Table structure for table `club_holds`
1847
--
1878
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 200-205 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
200
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
200
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
201
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
201
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
202
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
202
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
203
('EnableItemGroups','0','','Enable the item groups feature','YesNo'),
203
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
204
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
204
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
205
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
205
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
206
('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 335-340 Link Here
335
            Fast cataloging
335
            Fast cataloging
336
        </span>
336
        </span>
337
        <span class="permissioncode">([% name | html %])</span>
337
        <span class="permissioncode">([% name | html %])</span>
338
    [%- CASE 'manage_item_groups' -%]
339
        <span class="sub_permission manage_item_groups_subpermission">
340
            Create, update and delete item groups, add or remove items from an item group
341
        </span>
342
        <span class="permissioncode">([% name | html %])</span>
338
    [%- CASE 'remaining_permissions' -%]
343
    [%- CASE 'remaining_permissions' -%]
339
        <span class="sub_permission remaining_permissions_subpermission">
344
        <span class="sub_permission remaining_permissions_subpermission">
340
            Remaining permissions for managing fines and fees
345
            Remaining permissions for managing fines and fees
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +7 lines)
Lines 660-666 Circulation: Link Here
660
            - '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.'
660
            - '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.'
661
    Holds policy:
661
    Holds policy:
662
        -
662
        -
663
            - In the staff interface, split the holds queue into separate tables by
663
            - pref: EnableItemGroups
664
              choices:
665
                  yes: Enable
666
                  no: "Don't enable"
667
            - the item groups feature to allow collecting groups of items on a record together.
668
        -
669
            - In the staff client, split the holds queue into separate tables by
664
            - pref: HoldsSplitQueue
670
            - pref: HoldsSplitQueue
665
              choices:
671
              choices:
666
                  nothing: nothing
672
                  nothing: nothing
667
- 

Return to bug 24857