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 1855-1860 CREATE TABLE `club_fields` ( Link Here
1855
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1855
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1856
/*!40101 SET character_set_client = @saved_cs_client */;
1856
/*!40101 SET character_set_client = @saved_cs_client */;
1857
1857
1858
--
1859
-- Table structure for table `item_groups`
1860
--
1861
1862
DROP TABLE IF EXISTS `item_groups`;
1863
CREATE TABLE `item_groups` (
1864
  `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group",
1865
  `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to",
1866
  `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups",
1867
  `description` MEDIUMTEXT default NULL COMMENT "A group description",
1868
  `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created",
1869
  `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group",
1870
  PRIMARY KEY  (`item_group_id`),
1871
  CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1872
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1873
1874
--
1875
-- Table structure for table `item_group_items`
1876
--
1877
1878
DROP TABLE IF EXISTS `item_group_items`;
1879
CREATE TABLE `item_group_items` (
1880
  `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link",
1881
  `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",
1882
  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
1883
  PRIMARY KEY  (`item_group_items_id`),
1884
  UNIQUE KEY (`item_id`),
1885
  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1886
  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1887
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1888
1858
--
1889
--
1859
-- Table structure for table `club_holds`
1890
-- Table structure for table `club_holds`
1860
--
1891
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 205-210 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
205
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
205
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
206
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
206
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
207
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
207
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
208
('EnableItemGroups','0','','Enable the item groups feature','YesNo'),
208
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
209
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
209
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
210
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
210
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
211
('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 666-672 Circulation: Link Here
666
            - '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.'
666
            - '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
    Holds policy:
667
    Holds policy:
668
        -
668
        -
669
            - In the staff interface, split the holds queue into separate tables by
669
            - pref: EnableItemGroups
670
              choices:
671
                  yes: Enable
672
                  no: "Don't enable"
673
            - the item groups feature to allow collecting groups of items on a record together.
674
        -
675
            - In the staff client, split the holds queue into separate tables by
670
            - pref: HoldsSplitQueue
676
            - pref: HoldsSplitQueue
671
              choices:
677
              choices:
672
                  nothing: nothing
678
                  nothing: nothing
673
- 

Return to bug 24857