Bugzilla – Attachment 124612 Details for
Bug 24857
Add ability to group items for records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24857: Rename Volumes => Item groups (DB)
Bug-24857-Rename-Volumes--Item-groups-DB.patch (text/plain), 25.08 KB, created by
Martin Renvoize (ashimema)
on 2021-09-07 14:12:24 UTC
(
hide
)
Description:
Bug 24857: Rename Volumes => Item groups (DB)
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-07 14:12:24 UTC
Size:
25.08 KB
patch
obsolete
>From 925ca3fe744b63c8b704a0609feae6f106f549bc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 18 Aug 2021 10:35:14 -0300 >Subject: [PATCH] Bug 24857: Rename Volumes => Item groups (DB) > >This patch renames Volumes => Item groups in the DB structure, and also >on permissions and sysprefs. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Schema/Result/Biblio.pm | 23 ++- > Koha/Schema/Result/Item.pm | 23 ++- > .../Schema/Result/{Volume.pm => ItemGroup.pm} | 74 ++++++--- > Koha/Schema/Result/ItemGroupItem.pm | 155 ++++++++++++++++++ > Koha/Schema/Result/VolumeItem.pm | 131 --------------- > .../atomicupdate/bug_24857_item_groups.pl | 49 ++++++ > .../data/mysql/atomicupdate/volumes.perl | 45 ----- > installer/data/mysql/kohastructure.sql | 42 ++--- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../data/mysql/mandatory/userpermissions.sql | 2 +- > 10 files changed, 316 insertions(+), 230 deletions(-) > rename Koha/Schema/Result/{Volume.pm => ItemGroup.pm} (53%) > create mode 100644 Koha/Schema/Result/ItemGroupItem.pm > delete mode 100644 Koha/Schema/Result/VolumeItem.pm > create mode 100755 installer/data/mysql/atomicupdate/bug_24857_item_groups.pl > delete mode 100644 installer/data/mysql/atomicupdate/volumes.perl > >diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm >index 9e652d1028..1dfbdff777 100644 >--- a/Koha/Schema/Result/Biblio.pm >+++ b/Koha/Schema/Result/Biblio.pm >@@ -315,6 +315,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 item_groups >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::ItemGroup> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "item_groups", >+ "Koha::Schema::Result::ItemGroup", >+ { "foreign.biblio_id" => "self.biblionumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 items > > Type: has_many >@@ -511,8 +526,12 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-27 08:42:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fsBT6f/ma1fDlGQoauO7Uw >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+wyHrHxnufn5n/hF2mfB6Q >+======= >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BILvOleQqOV6/Apcx7kXVg >+>>>>>>> Bug 24857: Rename Volumes => Item groups (DB) > > __PACKAGE__->has_many( > "biblioitem", >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index a53e10e98a..6c421a329f 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -729,6 +729,21 @@ __PACKAGE__->might_have( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 item_group_items >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::ItemGroupItem> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "item_group_items", >+ "Koha::Schema::Result::ItemGroupItem", >+ { "foreign.item_id" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 items_last_borrower > > Type: might_have >@@ -865,8 +880,12 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-27 08:42:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SjZn3haOtUZWu1jrMigjNQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1mLs4vLD2LsJGkBKZCZbXg >+======= >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WG9AuZsBgTMEWjlfwFQdeA >+>>>>>>> Bug 24857: Rename Volumes => Item groups (DB) > > __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); > >diff --git a/Koha/Schema/Result/Volume.pm b/Koha/Schema/Result/ItemGroup.pm >similarity index 53% >rename from Koha/Schema/Result/Volume.pm >rename to Koha/Schema/Result/ItemGroup.pm >index ea5d446dba..ab34f0a15c 100644 >--- a/Koha/Schema/Result/Volume.pm >+++ b/Koha/Schema/Result/ItemGroup.pm >@@ -1,12 +1,12 @@ > use utf8; >-package Koha::Schema::Result::Volume; >+package Koha::Schema::Result::ItemGroup; > > # Created by DBIx::Class::Schema::Loader > # DO NOT MODIFY THE FIRST PART OF THIS FILE > > =head1 NAME > >-Koha::Schema::Result::Volume >+Koha::Schema::Result::ItemGroup > > =cut > >@@ -15,38 +15,53 @@ use warnings; > > use base 'DBIx::Class::Core'; > >-=head1 TABLE: C<volumes> >+=head1 TABLE: C<item_groups> > > =cut > >-__PACKAGE__->table("volumes"); >+__PACKAGE__->table("item_groups"); > > =head1 ACCESSORS > >-=head2 id >+=head2 item_group_id > > data_type: 'integer' > is_auto_increment: 1 > is_nullable: 0 > >-=head2 biblionumber >+id for the items group >+ >+=head2 biblio_id > > data_type: 'integer' > default_value: 0 > is_foreign_key: 1 > is_nullable: 0 > >+id for the bibliographic record the group belongs to >+ >+=head2 display_order >+ >+ data_type: 'integer' >+ default_value: 0 >+ is_nullable: 0 >+ >+The 'sort order' for item_groups >+ > =head2 description > > data_type: 'mediumtext' > is_nullable: 1 > >+A group description >+ > =head2 created_on > > data_type: 'timestamp' > datetime_undef_if_invalid: 1 >- default_value: '0000-00-00 00:00:00' >- is_nullable: 0 >+ is_nullable: 1 >+ >+Time and date the group was created > > =head2 updated_on > >@@ -55,26 +70,29 @@ __PACKAGE__->table("volumes"); > default_value: current_timestamp > is_nullable: 0 > >+Time and date of the latest change on the group >+ > =cut > > __PACKAGE__->add_columns( >- "id", >+ "item_group_id", > { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >- "biblionumber", >+ "biblio_id", > { > data_type => "integer", > default_value => 0, > is_foreign_key => 1, > is_nullable => 0, > }, >+ "display_order", >+ { data_type => "integer", default_value => 0, is_nullable => 0 }, > "description", > { data_type => "mediumtext", is_nullable => 1 }, > "created_on", > { > data_type => "timestamp", > datetime_undef_if_invalid => 1, >- default_value => "0000-00-00 00:00:00", >- is_nullable => 0, >+ is_nullable => 1, > }, > "updated_on", > { >@@ -89,17 +107,17 @@ __PACKAGE__->add_columns( > > =over 4 > >-=item * L</id> >+=item * L</item_group_id> > > =back > > =cut > >-__PACKAGE__->set_primary_key("id"); >+__PACKAGE__->set_primary_key("item_group_id"); > > =head1 RELATIONS > >-=head2 biblionumber >+=head2 biblio > > Type: belongs_to > >@@ -108,30 +126,30 @@ Related object: L<Koha::Schema::Result::Biblio> > =cut > > __PACKAGE__->belongs_to( >- "biblionumber", >+ "biblio", > "Koha::Schema::Result::Biblio", >- { biblionumber => "biblionumber" }, >+ { biblionumber => "biblio_id" }, > { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, > ); > >-=head2 volume_items >+=head2 item_group_items > > Type: has_many > >-Related object: L<Koha::Schema::Result::VolumeItem> >+Related object: L<Koha::Schema::Result::ItemGroupItem> > > =cut > > __PACKAGE__->has_many( >- "volume_items", >- "Koha::Schema::Result::VolumeItem", >- { "foreign.volume_id" => "self.id" }, >+ "item_group_items", >+ "Koha::Schema::Result::ItemGroupItem", >+ { "foreign.item_group_id" => "self.item_group_id" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-04 15:22:18 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cXvLM2TgY18pxE2ZJBMouw >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uB7PHJt6WQHMv/saTCpkOw > > =head2 koha_objects_class > >@@ -144,9 +162,11 @@ sub koha_objects_class { > =head2 koha_object_class > > =cut >+======= >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1WBTrtEB25MCOwR4nqPpVA >+>>>>>>> Bug 24857: Rename Volumes => Item groups (DB):Koha/Schema/Result/ItemGroup.pm > >-sub koha_object_class { >- 'Koha::Biblio::Volume'; >-} > >+# You can replace this text with custom code or comments, and it will be preserved on regeneration > 1; >diff --git a/Koha/Schema/Result/ItemGroupItem.pm b/Koha/Schema/Result/ItemGroupItem.pm >new file mode 100644 >index 0000000000..847f957ed4 >--- /dev/null >+++ b/Koha/Schema/Result/ItemGroupItem.pm >@@ -0,0 +1,155 @@ >+use utf8; >+package Koha::Schema::Result::ItemGroupItem; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::ItemGroupItem >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<item_group_items> >+ >+=cut >+ >+__PACKAGE__->table("item_group_items"); >+ >+=head1 ACCESSORS >+ >+=head2 item_group_items_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+id for the group/item link >+ >+=head2 item_group_id >+ >+ data_type: 'integer' >+ default_value: 0 >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+foreign key making this table a 1 to 1 join from items to item groups >+ >+=head2 item_id >+ >+ data_type: 'integer' >+ default_value: 0 >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+foreign key linking this table to the items table >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "item_group_items_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "item_group_id", >+ { >+ data_type => "integer", >+ default_value => 0, >+ is_foreign_key => 1, >+ is_nullable => 0, >+ }, >+ "item_id", >+ { >+ data_type => "integer", >+ default_value => 0, >+ is_foreign_key => 1, >+ is_nullable => 0, >+ }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</item_group_items_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("item_group_items_id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<item_group_id> >+ >+=over 4 >+ >+=item * L</item_group_id> >+ >+=item * L</item_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("item_group_id", ["item_group_id", "item_id"]); >+ >+=head1 RELATIONS >+ >+=head2 item >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Item> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "item", >+ "Koha::Schema::Result::Item", >+ { itemnumber => "item_id" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+=head2 item_group >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::ItemGroup> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "item_group", >+ "Koha::Schema::Result::ItemGroup", >+ { item_group_id => "item_group_id" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zfCA4diZgiexDnY1rD6xkQ >+ >+=head2 koha_object_class >+ >+=cut >+ >+sub koha_object_class { >+ 'Koha::Biblio::Volume::Item'; >+} >+ >+=head2 koha_objects_class >+ >+=cut >+======= >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UkFl9MLWlH8wy3T/AaVIdQ >+>>>>>>> Bug 24857: Rename Volumes => Item groups (DB):Koha/Schema/Result/ItemGroupItem.pm >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/VolumeItem.pm b/Koha/Schema/Result/VolumeItem.pm >deleted file mode 100644 >index c07fa97167..0000000000 >--- a/Koha/Schema/Result/VolumeItem.pm >+++ /dev/null >@@ -1,131 +0,0 @@ >-use utf8; >-package Koha::Schema::Result::VolumeItem; >- >-# Created by DBIx::Class::Schema::Loader >-# DO NOT MODIFY THE FIRST PART OF THIS FILE >- >-=head1 NAME >- >-Koha::Schema::Result::VolumeItem >- >-=cut >- >-use strict; >-use warnings; >- >-use base 'DBIx::Class::Core'; >- >-=head1 TABLE: C<volume_items> >- >-=cut >- >-__PACKAGE__->table("volume_items"); >- >-=head1 ACCESSORS >- >-=head2 id >- >- data_type: 'integer' >- is_auto_increment: 1 >- is_nullable: 0 >- >-=head2 volume_id >- >- data_type: 'integer' >- default_value: 0 >- is_foreign_key: 1 >- is_nullable: 0 >- >-=head2 itemnumber >- >- data_type: 'integer' >- default_value: 0 >- is_foreign_key: 1 >- is_nullable: 0 >- >-=cut >- >-__PACKAGE__->add_columns( >- "id", >- { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >- "volume_id", >- { >- data_type => "integer", >- default_value => 0, >- is_foreign_key => 1, >- is_nullable => 0, >- }, >- "itemnumber", >- { >- data_type => "integer", >- default_value => 0, >- is_foreign_key => 1, >- is_nullable => 0, >- }, >-); >- >-=head1 PRIMARY KEY >- >-=over 4 >- >-=item * L</id> >- >-=back >- >-=cut >- >-__PACKAGE__->set_primary_key("id"); >- >-=head1 RELATIONS >- >-=head2 itemnumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Item> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "itemnumber", >- "Koha::Schema::Result::Item", >- { itemnumber => "itemnumber" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >-); >- >-=head2 volume >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Volume> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "volume", >- "Koha::Schema::Result::Volume", >- { id => "volume_id" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >-); >- >- >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-03 18:25:20 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:i6YHB4Jq+79kVVYmuurzIQ >- >-=head2 koha_object_class >- >-=cut >- >-sub koha_object_class { >- 'Koha::Biblio::Volume::Item'; >-} >- >-=head2 koha_objects_class >- >-=cut >- >-sub koha_objects_class { >- 'Koha::Biblio::Volume::Items'; >-} >- >-1; >diff --git a/installer/data/mysql/atomicupdate/bug_24857_item_groups.pl b/installer/data/mysql/atomicupdate/bug_24857_item_groups.pl >new file mode 100755 >index 0000000000..07daba7bfa >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24857_item_groups.pl >@@ -0,0 +1,49 @@ >+use Modern::Perl; >+ >+{ >+ bug_number => "24857", >+ description => "Add ability to group items on a record", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('EnableItemGroups','0','','Enable the item groups feature','YesNo'); >+ }); >+ >+ $dbh->do(q{ >+ INSERT INTO permissions (module_bit, code, description) VALUES >+ ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'); >+ }); >+ >+ unless ( TableExists('item_groups') ) { >+ $dbh->do(q{ >+ CREATE TABLE `item_groups` ( >+ `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group", >+ `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to", >+ `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups", >+ `description` MEDIUMTEXT default NULL COMMENT "A group description", >+ `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created", >+ `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group", >+ PRIMARY KEY (`item_group_id`), >+ CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ } >+ >+ unless ( TableExists('item_group_items') ) { >+ $dbh->do(q{ >+ CREATE TABLE `item_group_items` ( >+ `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link", >+ `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", >+ `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table", >+ PRIMARY KEY (`item_group_items_id`), >+ UNIQUE KEY (item_group_id,item_id), >+ CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `item_group_items_vifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ } >+ }, >+} >diff --git a/installer/data/mysql/atomicupdate/volumes.perl b/installer/data/mysql/atomicupdate/volumes.perl >deleted file mode 100644 >index c1886b3087..0000000000 >--- a/installer/data/mysql/atomicupdate/volumes.perl >+++ /dev/null >@@ -1,45 +0,0 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if ( CheckVersion( $DBversion ) ) { >- $dbh->do(q{ >- INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >- ('EnableVolumes','0','','Enable volumes feature','YesNo'); >- }); >- >- $dbh->do(q{ >- INSERT INTO permissions (module_bit, code, description) VALUES >- ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'); >- }); >- >- unless ( TableExists('volumes') ) { >- $dbh->do(q{ >- CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha >- `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha >- `biblionumber` INT(11) NOT NULL default 0, -- foreign key linking this table to the biblio table >- `display_order` INT(4) NOT NULL default 0, -- specifies the 'sort order' for volumes >- `description` MEDIUMTEXT default NULL, -- equivilent to enumchron >- `created_on` TIMESTAMP NULL, -- Time and date the volume was created >- `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time and date of the latest change on the volume (description) >- PRIMARY KEY (`id`), >- CONSTRAINT `volumes_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE >- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >- }); >- } >- >- unless ( TableExists('volume_items') ) { >- $dbh->do(q{ >- CREATE TABLE `volume_items` ( -- information related to bibliographic records in Koha >- `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha >- `volume_id` int(11) NOT NULL default 0, -- foreign key making this table a 1 to 1 join from items to volumes >- `itemnumber` int(11) NOT NULL default 0, -- foreign key linking this table to the items table >- PRIMARY KEY (`id`), >- UNIQUE KEY (volume_id,itemnumber), >- CONSTRAINT `volume_items_iifk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, >- CONSTRAINT `volume_items_vifk_1` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >- }); >- } >- >- # Always end with this (adjust the bug info) >- SetVersion( $DBversion ); >- print "Upgrade to $DBversion done (Bug XXXXX - Add ability to define volumes for items on a record)\n"; >-} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 58c8546e1a..05fd10fef3 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1808,34 +1808,34 @@ CREATE TABLE `club_fields` ( > /*!40101 SET character_set_client = @saved_cs_client */; > > -- >--- Table structure for table `volumes` >+-- Table structure for table `item_groups` > -- > >-DROP TABLE IF EXISTS `volumes`; >-CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha >- `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha >- `biblionumber` INT(11) NOT NULL default 0, -- foreign key linking this table to the biblio table >- `display_order` INT(4) NOT NULL default 0, -- specifies the 'sort order' for volumes >- `description` MEDIUMTEXT default NULL, -- equivilent to enumchron >- `created_on` TIMESTAMP NULL, -- Time and date the volume was created >- `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time and date of the latest change on the volume (description) >- PRIMARY KEY (`id`), >- CONSTRAINT `volumes_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE >+DROP TABLE IF EXISTS `item_groups`; >+CREATE TABLE `item_groups` ( >+ `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group", >+ `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to", >+ `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups", >+ `description` MEDIUMTEXT default NULL COMMENT "A group description", >+ `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created", >+ `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group", >+ PRIMARY KEY (`item_group_id`), >+ CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >--- Table structure for table `volume_items` >+-- Table structure for table `item_group_items` > -- > >-DROP TABLE IF EXISTS `volume_items`; >-CREATE TABLE `volume_items` ( -- information related to bibliographic records in Koha >- `id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha >- `volume_id` int(11) NOT NULL default 0, -- foreign key making this table a 1 to 1 join from items to volumes >- `itemnumber` int(11) NOT NULL default 0, -- foreign key linking this table to the items table >- PRIMARY KEY (`id`), >- UNIQUE KEY (volume_id,itemnumber), >- CONSTRAINT `volume_items_iifk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, >- CONSTRAINT `volume_items_vifk_1` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+DROP TABLE IF EXISTS `item_group_items`; >+CREATE TABLE `item_group_items` ( >+ `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link", >+ `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", >+ `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table", >+ PRIMARY KEY (`item_group_items_id`), >+ UNIQUE KEY (item_group_id,item_id), >+ CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `item_group_items_vifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 69a935b0dc..07cc2e8f07 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -199,7 +199,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''), > ('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'), > ('EnableSearchHistory','0','','Enable or disable search history','YesNo'), >-('EnableVolumes','0','','Enable volumes feature','YesNo'), >+('EnableItemGroups','0','','Enable the item groups feature','YesNo'), > ('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'), > ('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'), > ('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'), >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index b82c4f48bc..fda6d2dd36 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -49,7 +49,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_items', 'Edit items'), > ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), > ( 9, 'delete_all_items', 'Delete all items at once'), >- ( 9, 'manage_volumes', 'Create, update and delete volumes, add or remove items from a volume'), >+ ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'), > (10, 'payout', 'Perform account payout action'), > (10, 'refund', 'Perform account refund action'), > (10, 'discount', 'Perform account discount action'), >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24857
:
100652
|
100653
|
100654
|
100655
|
100656
|
100657
|
100658
|
100659
|
100660
|
100661
|
100662
|
101637
|
101638
|
101639
|
101640
|
101641
|
101642
|
101643
|
101644
|
101645
|
101646
|
101647
|
101648
|
101650
|
101651
|
101652
|
101653
|
101654
|
101655
|
101656
|
101657
|
101658
|
101659
|
101660
|
101661
|
101670
|
101671
|
101672
|
101673
|
101674
|
101675
|
101676
|
101677
|
101678
|
101679
|
101680
|
101681
|
101730
|
101731
|
101732
|
101733
|
101734
|
101735
|
101736
|
101737
|
101738
|
101739
|
101740
|
101741
|
101752
|
101753
|
101754
|
101755
|
101756
|
101757
|
101758
|
101759
|
101760
|
101761
|
101762
|
101763
|
104952
|
104953
|
104954
|
104955
|
104956
|
104957
|
104958
|
104959
|
104960
|
104961
|
104962
|
104963
|
104964
|
104966
|
106728
|
106729
|
106730
|
106731
|
106732
|
106733
|
106734
|
106735
|
106736
|
106737
|
106738
|
106739
|
106740
|
106741
|
108443
|
108444
|
108445
|
108446
|
108447
|
108448
|
108449
|
108450
|
108451
|
108452
|
108453
|
108454
|
108455
|
108456
|
108666
|
108667
|
108668
|
108669
|
108670
|
108671
|
108672
|
108673
|
108674
|
108675
|
108676
|
108677
|
108678
|
108679
|
108680
|
108681
|
108682
|
108683
|
108684
|
108685
|
108686
|
109074
|
109075
|
109076
|
109077
|
109078
|
109079
|
109080
|
109081
|
109082
|
109083
|
109084
|
109085
|
109086
|
109087
|
109088
|
109089
|
109090
|
109091
|
109092
|
109093
|
109094
|
109795
|
109796
|
109797
|
109798
|
109799
|
109800
|
109801
|
109802
|
109803
|
109804
|
109805
|
109806
|
109807
|
109808
|
109809
|
109810
|
109811
|
109812
|
109813
|
109814
|
109815
|
109894
|
109901
|
109902
|
109903
|
109904
|
109905
|
109906
|
109907
|
109908
|
109909
|
109910
|
109911
|
109912
|
109913
|
109914
|
109915
|
109916
|
109917
|
109918
|
109919
|
109920
|
109921
|
109922
|
109923
|
113136
|
113137
|
113138
|
113139
|
113140
|
113141
|
113142
|
113143
|
113144
|
113145
|
113146
|
113147
|
113148
|
113149
|
113150
|
113151
|
113152
|
113153
|
113154
|
113155
|
113156
|
113157
|
113158
|
113159
|
113160
|
113168
|
113169
|
113170
|
113171
|
113172
|
113173
|
113174
|
113175
|
113176
|
113177
|
113178
|
113179
|
113180
|
113181
|
113182
|
113183
|
113184
|
113185
|
113186
|
113187
|
113188
|
113189
|
113190
|
113191
|
120495
|
120496
|
120497
|
120498
|
120499
|
120500
|
120501
|
120502
|
120503
|
120504
|
120505
|
120506
|
120507
|
120508
|
120509
|
120510
|
120511
|
120512
|
120513
|
120514
|
120515
|
120516
|
120517
|
120518
|
122808
|
122809
|
122810
|
122811
|
122812
|
122813
|
122814
|
122815
|
122816
|
122817
|
122818
|
122819
|
122820
|
122821
|
122822
|
122823
|
122824
|
122825
|
122826
|
122827
|
122828
|
122829
|
122830
|
122831
|
123882
|
123883
|
123884
|
123885
|
123886
|
123887
|
123888
|
123889
|
123890
|
123891
|
123892
|
123893
|
123894
|
123895
|
123896
|
123897
|
123898
|
123899
|
123900
|
123901
|
123902
|
123903
|
123904
|
123905
|
123906
|
123907
|
123908
|
123909
|
123910
|
123912
|
124021
|
124022
|
124023
|
124024
|
124025
|
124026
|
124027
|
124028
|
124029
|
124030
|
124031
|
124032
|
124033
|
124034
|
124035
|
124036
|
124037
|
124038
|
124039
|
124040
|
124041
|
124042
|
124043
|
124044
|
124045
|
124046
|
124047
|
124048
|
124049
|
124050
|
124051
|
124052
|
124053
|
124331
|
124332
|
124333
|
124334
|
124335
|
124336
|
124337
|
124338
|
124339
|
124340
|
124341
|
124342
|
124343
|
124344
|
124345
|
124346
|
124347
|
124348
|
124349
|
124351
|
124352
|
124353
|
124354
|
124355
|
124356
|
124357
|
124358
|
124359
|
124360
|
124361
|
124362
|
124363
|
124421
|
124463
|
124583
|
124584
|
124585
|
124586
|
124587
|
124588
|
124589
|
124590
|
124591
|
124592
|
124593
|
124594
|
124595
|
124596
|
124597
|
124598
|
124599
|
124600
|
124601
|
124602
|
124603
|
124604
|
124605
|
124606
|
124607
|
124608
|
124609
|
124610
|
124611
|
124612
|
124613
|
124614
|
124615
|
131449
|
131450
|
131451
|
131452
|
131453
|
131454
|
131455
|
131456
|
134288
|
134289
|
134290
|
134291
|
134292
|
134293
|
134294
|
134295
|
134296
|
135590
|
135591
|
135592
|
135593
|
135594
|
135595
|
135596
|
135597
|
135598
|
135599
|
135600
|
135601
|
135602
|
135603
|
135604
|
135605
|
135606
|
135607
|
135608
|
135609
|
135610
|
135614
|
135615
|
135616
|
135617
|
135618
|
135619
|
135620
|
135621
|
135622
|
135623
|
135624
|
135625
|
135626
|
135627
|
135628
|
135629
|
137259
|
137260
|
137261
|
137262
|
137263
|
137264
|
137265
|
137266
|
137267
|
137268
|
137311
|
137314
|
137315
|
137316
|
137317
|
137318
|
137319
|
137320
|
137321
|
137322
|
137323
|
137441
|
137442
|
137443
|
137608
|
138933