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

(-)a/Koha/Schema/Result/Biblio.pm (-17 / +17 lines)
Lines 315-320 __PACKAGE__->has_many( Link Here
315
  { cascade_copy => 0, cascade_delete => 0 },
315
  { cascade_copy => 0, cascade_delete => 0 },
316
);
316
);
317
317
318
=head2 item_groups
319
320
Type: has_many
321
322
Related object: L<Koha::Schema::Result::ItemGroup>
323
324
=cut
325
326
__PACKAGE__->has_many(
327
  "item_groups",
328
  "Koha::Schema::Result::ItemGroup",
329
  { "foreign.biblio_id" => "self.biblionumber" },
330
  { cascade_copy => 0, cascade_delete => 0 },
331
);
332
318
=head2 items
333
=head2 items
319
334
320
Type: has_many
335
Type: has_many
Lines 495-518 __PACKAGE__->has_many( Link Here
495
  { cascade_copy => 0, cascade_delete => 0 },
510
  { cascade_copy => 0, cascade_delete => 0 },
496
);
511
);
497
512
498
=head2 volumes
499
500
Type: has_many
501
502
Related object: L<Koha::Schema::Result::Volume>
503
504
=cut
505
506
__PACKAGE__->has_many(
507
  "volumes",
508
  "Koha::Schema::Result::Volume",
509
  { "foreign.biblionumber" => "self.biblionumber" },
510
  { cascade_copy => 0, cascade_delete => 0 },
511
);
512
513
513
514
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-07-13 16:46:12
514
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35
515
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GCOMiAlgo6+QR5Z1uAKDrg
515
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BILvOleQqOV6/Apcx7kXVg
516
516
517
__PACKAGE__->has_many(
517
__PACKAGE__->has_many(
518
  "biblioitem",
518
  "biblioitem",
(-)a/Koha/Schema/Result/Item.pm (-17 / +17 lines)
Lines 729-734 __PACKAGE__->might_have( Link Here
729
  { cascade_copy => 0, cascade_delete => 0 },
729
  { cascade_copy => 0, cascade_delete => 0 },
730
);
730
);
731
731
732
=head2 item_group_items
733
734
Type: has_many
735
736
Related object: L<Koha::Schema::Result::ItemGroupItem>
737
738
=cut
739
740
__PACKAGE__->has_many(
741
  "item_group_items",
742
  "Koha::Schema::Result::ItemGroupItem",
743
  { "foreign.item_id" => "self.itemnumber" },
744
  { cascade_copy => 0, cascade_delete => 0 },
745
);
746
732
=head2 items_last_borrower
747
=head2 items_last_borrower
733
748
734
Type: might_have
749
Type: might_have
Lines 849-872 __PACKAGE__->has_many( Link Here
849
  { cascade_copy => 0, cascade_delete => 0 },
864
  { cascade_copy => 0, cascade_delete => 0 },
850
);
865
);
851
866
852
=head2 volume_items
853
854
Type: has_many
855
856
Related object: L<Koha::Schema::Result::VolumeItem>
857
858
=cut
859
860
__PACKAGE__->has_many(
861
  "volume_items",
862
  "Koha::Schema::Result::VolumeItem",
863
  { "foreign.itemnumber" => "self.itemnumber" },
864
  { cascade_copy => 0, cascade_delete => 0 },
865
);
866
867
867
868
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-07-13 16:46:12
868
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35
869
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wsfHfXvzRZqMMkC3CkVR0w
869
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WG9AuZsBgTMEWjlfwFQdeA
870
870
871
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
871
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
872
872
(-)a/Koha/Schema/Result/Volume.pm (-35 / +33 lines)
Lines 1-12 Link Here
1
use utf8;
1
use utf8;
2
package Koha::Schema::Result::Volume;
2
package Koha::Schema::Result::ItemGroup;
3
3
4
# Created by DBIx::Class::Schema::Loader
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
6
7
=head1 NAME
7
=head1 NAME
8
8
9
Koha::Schema::Result::Volume
9
Koha::Schema::Result::ItemGroup
10
10
11
=cut
11
=cut
12
12
Lines 15-58 use warnings; Link Here
15
15
16
use base 'DBIx::Class::Core';
16
use base 'DBIx::Class::Core';
17
17
18
=head1 TABLE: C<volumes>
18
=head1 TABLE: C<item_groups>
19
19
20
=cut
20
=cut
21
21
22
__PACKAGE__->table("volumes");
22
__PACKAGE__->table("item_groups");
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
26
=head2 id
26
=head2 item_group_id
27
27
28
  data_type: 'integer'
28
  data_type: 'integer'
29
  is_auto_increment: 1
29
  is_auto_increment: 1
30
  is_nullable: 0
30
  is_nullable: 0
31
31
32
=head2 biblionumber
32
id for the items group
33
34
=head2 biblio_id
33
35
34
  data_type: 'integer'
36
  data_type: 'integer'
35
  default_value: 0
37
  default_value: 0
36
  is_foreign_key: 1
38
  is_foreign_key: 1
37
  is_nullable: 0
39
  is_nullable: 0
38
40
41
id for the bibliographic record the group belongs to
42
39
=head2 display_order
43
=head2 display_order
40
44
41
  data_type: 'integer'
45
  data_type: 'integer'
42
  default_value: 0
46
  default_value: 0
43
  is_nullable: 0
47
  is_nullable: 0
44
48
49
The 'sort order' for item_groups
50
45
=head2 description
51
=head2 description
46
52
47
  data_type: 'mediumtext'
53
  data_type: 'mediumtext'
48
  is_nullable: 1
54
  is_nullable: 1
49
55
56
A group description
57
50
=head2 created_on
58
=head2 created_on
51
59
52
  data_type: 'timestamp'
60
  data_type: 'timestamp'
53
  datetime_undef_if_invalid: 1
61
  datetime_undef_if_invalid: 1
54
  is_nullable: 1
62
  is_nullable: 1
55
63
64
Time and date the group was created
65
56
=head2 updated_on
66
=head2 updated_on
57
67
58
  data_type: 'timestamp'
68
  data_type: 'timestamp'
Lines 60-71 __PACKAGE__->table("volumes"); Link Here
60
  default_value: current_timestamp
70
  default_value: current_timestamp
61
  is_nullable: 0
71
  is_nullable: 0
62
72
73
Time and date of the latest change on the group
74
63
=cut
75
=cut
64
76
65
__PACKAGE__->add_columns(
77
__PACKAGE__->add_columns(
66
  "id",
78
  "item_group_id",
67
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
79
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
68
  "biblionumber",
80
  "biblio_id",
69
  {
81
  {
70
    data_type      => "integer",
82
    data_type      => "integer",
71
    default_value  => 0,
83
    default_value  => 0,
Lines 95-111 __PACKAGE__->add_columns( Link Here
95
107
96
=over 4
108
=over 4
97
109
98
=item * L</id>
110
=item * L</item_group_id>
99
111
100
=back
112
=back
101
113
102
=cut
114
=cut
103
115
104
__PACKAGE__->set_primary_key("id");
116
__PACKAGE__->set_primary_key("item_group_id");
105
117
106
=head1 RELATIONS
118
=head1 RELATIONS
107
119
108
=head2 biblionumber
120
=head2 biblio
109
121
110
Type: belongs_to
122
Type: belongs_to
111
123
Lines 114-158 Related object: L<Koha::Schema::Result::Biblio> Link Here
114
=cut
126
=cut
115
127
116
__PACKAGE__->belongs_to(
128
__PACKAGE__->belongs_to(
117
  "biblionumber",
129
  "biblio",
118
  "Koha::Schema::Result::Biblio",
130
  "Koha::Schema::Result::Biblio",
119
  { biblionumber => "biblionumber" },
131
  { biblionumber => "biblio_id" },
120
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
132
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
121
);
133
);
122
134
123
=head2 volume_items
135
=head2 item_group_items
124
136
125
Type: has_many
137
Type: has_many
126
138
127
Related object: L<Koha::Schema::Result::VolumeItem>
139
Related object: L<Koha::Schema::Result::ItemGroupItem>
128
140
129
=cut
141
=cut
130
142
131
__PACKAGE__->has_many(
143
__PACKAGE__->has_many(
132
  "volume_items",
144
  "item_group_items",
133
  "Koha::Schema::Result::VolumeItem",
145
  "Koha::Schema::Result::ItemGroupItem",
134
  { "foreign.volume_id" => "self.id" },
146
  { "foreign.item_group_id" => "self.item_group_id" },
135
  { cascade_copy => 0, cascade_delete => 0 },
147
  { cascade_copy => 0, cascade_delete => 0 },
136
);
148
);
137
149
138
150
139
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-07-13 16:46:13
151
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35
140
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w4tPedBapvhpwYov9Cb/gQ
152
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1WBTrtEB25MCOwR4nqPpVA
141
142
=head2 koha_objects_class
143
144
=cut
145
146
sub koha_objects_class {
147
    'Koha::Biblio::Volumes';
148
}
149
150
=head2 koha_object_class
151
152
=cut
153
153
154
sub koha_object_class {
155
    'Koha::Biblio::Volume';
156
}
157
154
155
# You can replace this text with custom code or comments, and it will be preserved on regeneration
158
1;
156
1;
(-)a/Koha/Schema/Result/VolumeItem.pm (-41 / +33 lines)
Lines 1-12 Link Here
1
use utf8;
1
use utf8;
2
package Koha::Schema::Result::VolumeItem;
2
package Koha::Schema::Result::ItemGroupItem;
3
3
4
# Created by DBIx::Class::Schema::Loader
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
6
7
=head1 NAME
7
=head1 NAME
8
8
9
Koha::Schema::Result::VolumeItem
9
Koha::Schema::Result::ItemGroupItem
10
10
11
=cut
11
=cut
12
12
Lines 15-61 use warnings; Link Here
15
15
16
use base 'DBIx::Class::Core';
16
use base 'DBIx::Class::Core';
17
17
18
=head1 TABLE: C<volume_items>
18
=head1 TABLE: C<item_group_items>
19
19
20
=cut
20
=cut
21
21
22
__PACKAGE__->table("volume_items");
22
__PACKAGE__->table("item_group_items");
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
26
=head2 id
26
=head2 item_group_items_id
27
27
28
  data_type: 'integer'
28
  data_type: 'integer'
29
  is_auto_increment: 1
29
  is_auto_increment: 1
30
  is_nullable: 0
30
  is_nullable: 0
31
31
32
=head2 volume_id
32
id for the group/item link
33
34
=head2 item_group_id
33
35
34
  data_type: 'integer'
36
  data_type: 'integer'
35
  default_value: 0
37
  default_value: 0
36
  is_foreign_key: 1
38
  is_foreign_key: 1
37
  is_nullable: 0
39
  is_nullable: 0
38
40
39
=head2 itemnumber
41
foreign key making this table a 1 to 1 join from items to item groups
42
43
=head2 item_id
40
44
41
  data_type: 'integer'
45
  data_type: 'integer'
42
  default_value: 0
46
  default_value: 0
43
  is_foreign_key: 1
47
  is_foreign_key: 1
44
  is_nullable: 0
48
  is_nullable: 0
45
49
50
foreign key linking this table to the items table
51
46
=cut
52
=cut
47
53
48
__PACKAGE__->add_columns(
54
__PACKAGE__->add_columns(
49
  "id",
55
  "item_group_items_id",
50
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
56
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
51
  "volume_id",
57
  "item_group_id",
52
  {
58
  {
53
    data_type      => "integer",
59
    data_type      => "integer",
54
    default_value  => 0,
60
    default_value  => 0,
55
    is_foreign_key => 1,
61
    is_foreign_key => 1,
56
    is_nullable    => 0,
62
    is_nullable    => 0,
57
  },
63
  },
58
  "itemnumber",
64
  "item_id",
59
  {
65
  {
60
    data_type      => "integer",
66
    data_type      => "integer",
61
    default_value  => 0,
67
    default_value  => 0,
Lines 68-100 __PACKAGE__->add_columns( Link Here
68
74
69
=over 4
75
=over 4
70
76
71
=item * L</id>
77
=item * L</item_group_items_id>
72
78
73
=back
79
=back
74
80
75
=cut
81
=cut
76
82
77
__PACKAGE__->set_primary_key("id");
83
__PACKAGE__->set_primary_key("item_group_items_id");
78
84
79
=head1 UNIQUE CONSTRAINTS
85
=head1 UNIQUE CONSTRAINTS
80
86
81
=head2 C<volume_id>
87
=head2 C<item_group_id>
82
88
83
=over 4
89
=over 4
84
90
85
=item * L</volume_id>
91
=item * L</item_group_id>
86
92
87
=item * L</itemnumber>
93
=item * L</item_id>
88
94
89
=back
95
=back
90
96
91
=cut
97
=cut
92
98
93
__PACKAGE__->add_unique_constraint("volume_id", ["volume_id", "itemnumber"]);
99
__PACKAGE__->add_unique_constraint("item_group_id", ["item_group_id", "item_id"]);
94
100
95
=head1 RELATIONS
101
=head1 RELATIONS
96
102
97
=head2 itemnumber
103
=head2 item
98
104
99
Type: belongs_to
105
Type: belongs_to
100
106
Lines 103-147 Related object: L<Koha::Schema::Result::Item> Link Here
103
=cut
109
=cut
104
110
105
__PACKAGE__->belongs_to(
111
__PACKAGE__->belongs_to(
106
  "itemnumber",
112
  "item",
107
  "Koha::Schema::Result::Item",
113
  "Koha::Schema::Result::Item",
108
  { itemnumber => "itemnumber" },
114
  { itemnumber => "item_id" },
109
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
115
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
110
);
116
);
111
117
112
=head2 volume
118
=head2 item_group
113
119
114
Type: belongs_to
120
Type: belongs_to
115
121
116
Related object: L<Koha::Schema::Result::Volume>
122
Related object: L<Koha::Schema::Result::ItemGroup>
117
123
118
=cut
124
=cut
119
125
120
__PACKAGE__->belongs_to(
126
__PACKAGE__->belongs_to(
121
  "volume",
127
  "item_group",
122
  "Koha::Schema::Result::Volume",
128
  "Koha::Schema::Result::ItemGroup",
123
  { id => "volume_id" },
129
  { item_group_id => "item_group_id" },
124
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
130
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
125
);
131
);
126
132
127
133
128
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-07-13 16:46:13
134
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35
129
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ALKnoA3HMZ2J4AsXes5nuA
135
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UkFl9MLWlH8wy3T/AaVIdQ
130
131
=head2 koha_object_class
132
133
=cut
134
135
sub koha_object_class {
136
    'Koha::Biblio::Volume::Item';
137
}
138
139
=head2 koha_objects_class
140
141
=cut
142
136
143
sub koha_objects_class {
144
    'Koha::Biblio::Volume::Items';
145
}
146
137
138
# You can replace this text with custom code or comments, and it will be preserved on regeneration
147
1;
139
1;
(-)a/installer/data/mysql/atomicupdate/bug_24857_item_groups.pl (+49 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
{
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_group_id,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_vifk_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/atomicupdate/volumes.perl (-45 lines)
Lines 1-45 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if ( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
        ('EnableVolumes','0','','Enable volumes feature','YesNo');
6
    });
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
13
    unless ( TableExists('volumes') ) {
14
        $dbh->do(q{
15
            CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha
16
            `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha
17
            `biblionumber` INT(11) NOT NULL default 0, -- foreign key linking this table to the biblio table
18
            `display_order` INT(4) NOT NULL default 0, -- specifies the 'sort order' for volumes
19
            `description` MEDIUMTEXT default NULL, -- equivilent to enumchron
20
            `created_on` TIMESTAMP NULL, -- Time and date the volume was created
21
            `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time and date of the latest change on the volume (description)
22
            PRIMARY KEY  (`id`),
23
            CONSTRAINT `volumes_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
24
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
25
        });
26
    }
27
28
    unless ( TableExists('volume_items') ) {
29
        $dbh->do(q{
30
            CREATE TABLE `volume_items` ( -- information related to bibliographic records in Koha
31
            `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha
32
            `volume_id` int(11) NOT NULL default 0, -- foreign key making this table a 1 to 1 join from items to volumes
33
            `itemnumber` int(11) NOT NULL default 0, -- foreign key linking this table to the items table
34
            PRIMARY KEY  (`id`),
35
            UNIQUE KEY (volume_id,itemnumber),
36
            CONSTRAINT `volume_items_iifk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
37
            CONSTRAINT `volume_items_vifk_1` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
38
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
39
        });
40
    }
41
42
    # Always end with this (adjust the bug info)
43
    SetVersion( $DBversion );
44
    print "Upgrade to $DBversion done (Bug XXXXX - Add ability to define volumes for items on a record)\n";
45
}
(-)a/installer/data/mysql/kohastructure.sql (-21 / +21 lines)
Lines 1808-1841 CREATE TABLE `club_fields` ( Link Here
1808
/*!40101 SET character_set_client = @saved_cs_client */;
1808
/*!40101 SET character_set_client = @saved_cs_client */;
1809
1809
1810
--
1810
--
1811
-- Table structure for table `volumes`
1811
-- Table structure for table `item_groups`
1812
--
1812
--
1813
1813
1814
DROP TABLE IF EXISTS `volumes`;
1814
DROP TABLE IF EXISTS `item_groups`;
1815
CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha
1815
CREATE TABLE `item_groups` (
1816
  `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha
1816
  `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group",
1817
  `biblionumber` INT(11) NOT NULL default 0, -- foreign key linking this table to the biblio table
1817
  `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to",
1818
  `display_order` INT(4) NOT NULL default 0, -- specifies the 'sort order' for volumes
1818
  `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups",
1819
  `description` MEDIUMTEXT default NULL, -- equivilent to enumchron
1819
  `description` MEDIUMTEXT default NULL COMMENT "A group description",
1820
  `created_on` TIMESTAMP NULL, -- Time and date the volume was created
1820
  `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created",
1821
  `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time and date of the latest change on the volume (description)
1821
  `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group",
1822
  PRIMARY KEY  (`id`),
1822
  PRIMARY KEY  (`item_group_id`),
1823
  CONSTRAINT `volumes_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1823
  CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1824
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1824
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1825
1825
1826
--
1826
--
1827
-- Table structure for table `volume_items`
1827
-- Table structure for table `item_group_items`
1828
--
1828
--
1829
1829
1830
DROP TABLE IF EXISTS `volume_items`;
1830
DROP TABLE IF EXISTS `item_group_items`;
1831
CREATE TABLE `volume_items` ( -- information related to bibliographic records in Koha
1831
CREATE TABLE `item_group_items` (
1832
  `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha
1832
  `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link",
1833
  `volume_id` int(11) NOT NULL default 0, -- foreign key making this table a 1 to 1 join from items to volumes
1833
  `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",
1834
  `itemnumber` int(11) NOT NULL default 0, -- foreign key linking this table to the items table
1834
  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
1835
  PRIMARY KEY  (`id`),
1835
  PRIMARY KEY  (`item_group_items_id`),
1836
  UNIQUE KEY (volume_id,itemnumber),
1836
  UNIQUE KEY (item_group_id,item_id),
1837
  CONSTRAINT `volume_items_iifk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1837
  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1838
  CONSTRAINT `volume_items_vifk_1` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1838
  CONSTRAINT `item_group_items_vifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1839
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1839
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1840
1840
1841
--
1841
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 199-205 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
199
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
199
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
200
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
200
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
201
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
201
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
202
('EnableVolumes','0','','Enable volumes feature','YesNo'),
202
('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'),
203
('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'),
204
('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'),
205
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
(-)a/installer/data/mysql/mandatory/userpermissions.sql (-2 / +1 lines)
Lines 49-55 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
49
   ( 9, 'edit_items', 'Edit items'),
49
   ( 9, 'edit_items', 'Edit items'),
50
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
50
   ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'),
51
   ( 9, 'delete_all_items', 'Delete all items at once'),
51
   ( 9, 'delete_all_items', 'Delete all items at once'),
52
   ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'),
52
   ( 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'),
53
   (10, 'payout', 'Perform account payout action'),
54
   (10, 'refund', 'Perform account refund action'),
54
   (10, 'refund', 'Perform account refund action'),
55
   (10, 'discount', 'Perform account discount action'),
55
   (10, 'discount', 'Perform account discount action'),
56
- 

Return to bug 24857