From 02a94ccd8c792889d5eaaa48c77aaeb4a96daad5 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 18 Aug 2021 11:15:41 -0300 Subject: [PATCH] Bug 24857: Adapt code to the volumes => item_groups change This patch updates the code so all references to 'volumes' are translated into 'item groups'. Relevant changes: - API routes and specs - Permission name is changed - Syspref name changed Note: I removed a behavior that felt unnatural (at least in the place it was put): deleting the item group if the linked item is deleted. It feels like a controller thing, and also something that could be offered to the staff on the UI on item deletion. To avoid blocking the feature, I suggest this removal, and discuss it in its own context. To test: 1. Run: $ reset_all 2. Apply this patchset 3. Run: $ updatedatabase => SUCCESS: Update works 4. Repeat 1 (with the patches applied) => SUCCESS: Install works with this DB structure 5. Run all the tests: $ kshell k$ git diff origin/master --name-only | grep -e '\.t$' | xargs prove => SUCCESS: Tests pass! 6. Follow the original plan (with the Volume=>ItemGRoup change in mind) => SUCCESS: All good! 7. Sign off :-D --- Koha/Biblio.pm | 14 +- Koha/Biblio/{Volume.pm => ItemGroup.pm} | 40 ++- Koha/Biblio/{Volume => ItemGroup}/Item.pm | 8 +- Koha/Biblio/{Volume => ItemGroup}/Items.pm | 10 +- Koha/Biblio/{Volumes.pm => ItemGroups.pm} | 10 +- Koha/Item.pm | 27 +- .../V1/Biblios/{Volumes.pm => ItemGroups.pm} | 87 +++--- .../Biblios/{Volumes => ItemGroups}/Items.pm | 44 +-- Koha/Schema/Result/ItemGroup.pm | 7 +- Koha/Schema/Result/ItemGroupItem.pm | 7 +- api/v1/swagger/definitions.json | 6 +- .../{volume.json => item_group.json} | 16 +- api/v1/swagger/paths.json | 16 +- ..._volumes.json => biblios_item_groups.json} | 138 +++++----- catalogue/detail.pl | 37 ++- cataloguing/additem.pl | 66 ++--- .../prog/en/includes/permissions.inc | 6 +- .../admin/preferences/circulation.pref | 4 +- .../prog/en/modules/catalogue/detail.tt | 256 +++++++++--------- .../prog/en/modules/cataloguing/additem.tt | 30 +- .../prog/js/cataloging_additem.js | 24 +- t/db_dependent/Koha/Biblio.t | 29 +- t/db_dependent/Koha/Biblio/ItemGroups.t | 70 +++++ t/db_dependent/Koha/Item.t | 27 +- t/db_dependent/Koha/Volumes.t | 156 ----------- .../api/v1/{volumes.t => item_groups.t} | 87 +++--- 26 files changed, 594 insertions(+), 628 deletions(-) rename Koha/Biblio/{Volume.pm => ItemGroup.pm} (70%) rename Koha/Biblio/{Volume => ItemGroup}/Item.pm (82%) rename Koha/Biblio/{Volume => ItemGroup}/Items.pm (79%) rename Koha/Biblio/{Volumes.pm => ItemGroups.pm} (81%) rename Koha/REST/V1/Biblios/{Volumes.pm => ItemGroups.pm} (53%) rename Koha/REST/V1/Biblios/{Volumes => ItemGroups}/Items.pm (70%) rename api/v1/swagger/definitions/{volume.json => item_group.json} (67%) rename api/v1/swagger/paths/{biblios_volumes.json => biblios_item_groups.json} (83%) create mode 100755 t/db_dependent/Koha/Biblio/ItemGroups.t delete mode 100755 t/db_dependent/Koha/Volumes.t rename t/db_dependent/api/v1/{volumes.t => item_groups.t} (73%) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index eb0ce09d32..29a32142c6 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -33,8 +33,8 @@ use base qw(Koha::Object); use Koha::Acquisition::Orders; use Koha::ArticleRequest::Status; use Koha::ArticleRequests; +use Koha::Biblio::ItemGroups; use Koha::Biblio::Metadatas; -use Koha::Biblio::Volumes; use Koha::Biblioitems; use Koha::CirculationRules; use Koha::Item::Transfer::Limits; @@ -113,19 +113,19 @@ sub active_orders { return $self->orders->search({ datecancellationprinted => undef }); } -=head3 volumes +=head3 item_groups -my $volumes = $biblio->volumes(); +my $item_groups = $biblio->item_groups(); -Returns a Koha::Biblio::Volumes object +Returns a Koha::Biblio::ItemGroups object =cut -sub volumes { +sub item_groups { my ( $self ) = @_; - my $volumes = $self->_result->volumes; - return Koha::Biblio::Volumes->_new_from_dbic($volumes); + my $item_groups = $self->_result->item_groups; + return Koha::Biblio::ItemGroups->_new_from_dbic($item_groups); } =head3 can_article_request diff --git a/Koha/Biblio/Volume.pm b/Koha/Biblio/ItemGroup.pm similarity index 70% rename from Koha/Biblio/Volume.pm rename to Koha/Biblio/ItemGroup.pm index a5eda853dc..8c4ba66db1 100644 --- a/Koha/Biblio/Volume.pm +++ b/Koha/Biblio/ItemGroup.pm @@ -1,4 +1,4 @@ -package Koha::Biblio::Volume; +package Koha::Biblio::ItemGroup; # This file is part of Koha. # @@ -19,13 +19,13 @@ use Modern::Perl; use base qw(Koha::Object); -use Koha::Biblio::Volume::Items; +use Koha::Biblio::ItemGroup::Items; use Koha::Exceptions::Object; use Koha::Items; =head1 NAME -Koha::Volume - Koha Volume Object class +Koha::Biblio::ItemGroup - Koha ItemGroup Object class =head1 API @@ -33,7 +33,7 @@ Koha::Volume - Koha Volume Object class =head3 store - $volume->store; + $item_group->store; Overloaded I method that takes care of creation date handling. @@ -56,24 +56,24 @@ sub store { =head3 items - my $items = $volume->items; + my $items = $item_group->items; -Returns all the items linked to the volume. +Returns all the items linked to the item group. =cut sub items { my ($self) = @_; - my $items_rs = $self->_result->volume_items; - my @item_numbers = $items_rs->get_column('itemnumber')->all; + my $items_rs = $self->_result->item_group_items; + my @item_ids = $items_rs->get_column('item_id')->all; - return Koha::Items->new->empty unless @item_numbers; + return Koha::Items->new->empty unless @item_ids; return Koha::Items->search( { itemnumber => { - -in => \@item_numbers + -in => \@item_ids } } ); @@ -81,7 +81,7 @@ sub items { =head3 add_item - $volume->add_item({ item_id => $item_id }); + $item_group->add_item({ item_id => $item_id }); =cut @@ -91,16 +91,16 @@ sub add_item { my $item_id = $params->{item_id}; my $item = Koha::Items->find( $item_id ); - unless ( $item->biblionumber == $self->biblionumber ) { + unless ( $item->biblionumber == $self->biblio_id ) { Koha::Exceptions::Object::FKConstraint->throw( - broken_fk => 'biblionumber' + broken_fk => 'biblio_id' ); } - Koha::Biblio::Volume::Item->new( + Koha::Biblio::ItemGroup::Item->new( { - itemnumber => $item_id, - volume_id => $self->id + item_group_id => $self->id, + item_id => $item_id, } )->store; @@ -109,15 +109,13 @@ sub add_item { =head3 to_api_mapping -This method returns the mapping for representing a Koha::Biblio::Volume object +This method returns the mapping for representing a Koha::Biblio::ItemGroup object on the API. =cut sub to_api_mapping { return { - id => 'volume_id', - biblionumber => 'biblio_id', created_on => 'creation_date', updated_on => 'modification_date' }; @@ -130,7 +128,7 @@ sub to_api_mapping { =cut sub _type { - return 'Volume'; + return 'ItemGroup'; } =head3 object_class @@ -138,7 +136,7 @@ sub _type { =cut sub object_class { - return 'Koha::Biblio::Volume'; + return 'Koha::Biblio::ItemGroup'; } 1; diff --git a/Koha/Biblio/Volume/Item.pm b/Koha/Biblio/ItemGroup/Item.pm similarity index 82% rename from Koha/Biblio/Volume/Item.pm rename to Koha/Biblio/ItemGroup/Item.pm index 9698f8fa65..17a175f302 100644 --- a/Koha/Biblio/Volume/Item.pm +++ b/Koha/Biblio/ItemGroup/Item.pm @@ -1,4 +1,4 @@ -package Koha::Biblio::Volume::Item; +package Koha::Biblio::ItemGroup::Item; # This file is part of Koha. # @@ -21,7 +21,7 @@ use base qw(Koha::Object); =head1 NAME -Koha::Volume::Item - Koha Volume Item Object class +Koha::Biblio::ItemGroup::Item - Koha ItemGroup Item Object class =head1 API @@ -32,7 +32,7 @@ Koha::Volume::Item - Koha Volume Item Object class =cut sub _type { - return 'VolumeItem'; + return 'ItemGroupItem'; } =head3 object_class @@ -40,7 +40,7 @@ sub _type { =cut sub object_class { - return 'Koha::Biblio::Volume::Item'; + return 'Koha::Biblio::ItemGroup::Item'; } 1; diff --git a/Koha/Biblio/Volume/Items.pm b/Koha/Biblio/ItemGroup/Items.pm similarity index 79% rename from Koha/Biblio/Volume/Items.pm rename to Koha/Biblio/ItemGroup/Items.pm index dc0ecf814d..9018c5e5fa 100644 --- a/Koha/Biblio/Volume/Items.pm +++ b/Koha/Biblio/ItemGroup/Items.pm @@ -1,4 +1,4 @@ -package Koha::Biblio::Volume::Items; +package Koha::Biblio::ItemGroup::Items; # This file is part of Koha. # @@ -17,13 +17,13 @@ package Koha::Biblio::Volume::Items; use Modern::Perl; -use Koha::Biblio::Volume::Item; +use Koha::Biblio::ItemGroup::Item; use base qw(Koha::Objects); =head1 NAME -Koha::Biblio::Volume::Items - Koha Volume Items Object set class +Koha::Biblio::ItemGroup::Items - Koha ItemGroup Items Object set class =head1 API @@ -34,7 +34,7 @@ Koha::Biblio::Volume::Items - Koha Volume Items Object set class =cut sub _type { - return 'VolumeItem'; + return 'ItemGroupItem'; } =head3 object_class @@ -42,7 +42,7 @@ sub _type { =cut sub object_class { - return 'Koha::Biblio::Volume::Item'; + return 'Koha::Biblio::ItemGroup::Item'; } 1; diff --git a/Koha/Biblio/Volumes.pm b/Koha/Biblio/ItemGroups.pm similarity index 81% rename from Koha/Biblio/Volumes.pm rename to Koha/Biblio/ItemGroups.pm index 0729930fc5..78a6b337c6 100644 --- a/Koha/Biblio/Volumes.pm +++ b/Koha/Biblio/ItemGroups.pm @@ -1,4 +1,4 @@ -package Koha::Biblio::Volumes; +package Koha::Biblio::ItemGroups; # This file is part of Koha. # @@ -17,13 +17,13 @@ package Koha::Biblio::Volumes; use Modern::Perl; -use Koha::Biblio::Volume; +use Koha::Biblio::ItemGroup; use base qw(Koha::Objects); =head1 NAME -Koha::Biblio::Volumes - Koha Volume Object set class +Koha::Biblio::ItemGroups - Koha ItemGroup Object set class =head1 API @@ -34,7 +34,7 @@ Koha::Biblio::Volumes - Koha Volume Object set class =cut sub _type { - return 'Volume'; + return 'ItemGroup'; } =head3 object_class @@ -42,7 +42,7 @@ sub _type { =cut sub object_class { - return 'Koha::Biblio::Volume'; + return 'Koha::Biblio::ItemGroup'; } 1; diff --git a/Koha/Item.pm b/Koha/Item.pm index c360df4b24..21fb21f4d3 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -32,6 +32,7 @@ use C4::ClassSource qw( GetClassSort ); use C4::Log qw( logaction ); use C4::Reserves; +use Koha::Biblio::ItemGroups; use Koha::Checkouts; use Koha::CirculationRules; use Koha::CoverImages; @@ -223,14 +224,8 @@ sub delete { # FIXME check the item has no current issues # i.e. raise the appropriate exception - # Get the volume so we can delete it later if it has no items left - my $volume = C4::Context->preference('EnableVolumes') ? $self->volume : undef; - my $result = $self->SUPER::delete; - # Delete the volume if it has no items left - $volume->delete if ( $volume && $volume->items->count == 0 ); - my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) unless $params->{skip_record_index}; @@ -400,25 +395,25 @@ sub checkout { return Koha::Checkout->_new_from_dbic( $checkout_rs ); } -=head3 volume +=head3 item_group -my $volume = $item->volume; +my $item_group = $item->item_group; -Return the volume for this item +Return the item group for this item =cut -sub volume { +sub item_group { my ( $self ) = @_; - my $volume_item = $self->_result->volume_items->first; - return unless $volume_item; + my $item_group_item = $self->_result->item_group_item; + return unless $item_group_item; - my $volume_rs = $volume_item->volume; - return unless $volume_rs; + my $item_group_rs = $item_group_item->item_group; + return unless $item_group_rs; - my $volume = Koha::Biblio::Volume->_new_from_dbic( $volume_rs ); - return $volume; + my $item_group = Koha::Biblio::ItemGroup->_new_from_dbic( $item_group_rs ); + return $item_group; } =head3 holds diff --git a/Koha/REST/V1/Biblios/Volumes.pm b/Koha/REST/V1/Biblios/ItemGroups.pm similarity index 53% rename from Koha/REST/V1/Biblios/Volumes.pm rename to Koha/REST/V1/Biblios/ItemGroups.pm index dedf26bdf4..f7784f4ba0 100644 --- a/Koha/REST/V1/Biblios/Volumes.pm +++ b/Koha/REST/V1/Biblios/ItemGroups.pm @@ -1,4 +1,4 @@ -package Koha::REST::V1::Biblios::Volumes; +package Koha::REST::V1::Biblios::ItemGroups; # This file is part of Koha. # @@ -19,14 +19,14 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Koha::Biblio::Volumes; +use Koha::Biblio::ItemGroups; use Scalar::Util qw(blessed); use Try::Tiny; =head1 NAME -Koha::REST::V1::Biblios::Volumes - Koha REST API for handling volumes (V1) +Koha::REST::V1::Biblios::ItemGroups - Koha REST API for handling item groups (V1) =head1 API @@ -36,7 +36,7 @@ Koha::REST::V1::Biblios::Volumes - Koha REST API for handling volumes (V1) =head3 list -Controller function that handles listing Koha::Biblio::Volume objects +Controller function that handles listing Koha::Biblio::ItemGroup objects =cut @@ -44,11 +44,11 @@ sub list { my $c = shift->openapi->valid_input or return; return try { - my $volumes_set = Koha::Biblio::Volumes->new; - my $volumes = $c->objects->search( $volumes_set ); + my $item_groups_set = Koha::Biblio::ItemGroups->new; + my $item_groups = $c->objects->search( $item_groups_set ); return $c->render( status => 200, - openapi => $volumes + openapi => $item_groups ); } catch { @@ -58,7 +58,7 @@ sub list { =head3 get -Controller function that handles retrieving a single Koha::Biblio::Volume +Controller function that handles retrieving a single Koha::Biblio::ItemGroup =cut @@ -66,22 +66,22 @@ sub get { my $c = shift->openapi->valid_input or return; try { - my $volume_id = $c->validation->param('volume_id'); + my $item_group_id = $c->validation->param('item_group_id'); my $biblio_id = $c->validation->param('biblio_id'); - my $volume = $c->objects->find( Koha::Biblio::Volumes->new, $volume_id ); + my $item_group = $c->objects->find( Koha::Biblio::ItemGroups->new, $item_group_id ); - if ( $volume && $volume->{biblio_id} eq $biblio_id ) { + if ( $item_group && $item_group->{biblio_id} eq $biblio_id ) { return $c->render( status => 200, - openapi => $volume + openapi => $item_group ); } else { return $c->render( status => 404, openapi => { - error => 'Volume not found' + error => 'Item group not found' } ); } @@ -93,7 +93,7 @@ sub get { =head3 add -Controller function to handle adding a Koha::Biblio::Volume object +Controller function to handle adding a Koha::Biblio::ItemGroup object =cut @@ -101,26 +101,27 @@ sub add { my $c = shift->openapi->valid_input or return; return try { - my $volume_data = $c->validation->param('body'); + my $item_group_data = $c->validation->param('body'); # biblio_id comes from the path - $volume_data->{biblio_id} = $c->validation->param('biblio_id'); + $item_group_data->{biblio_id} = $c->validation->param('biblio_id'); - my $volume = Koha::Biblio::Volume->new_from_api($volume_data); - $volume->store->discard_changes(); + my $item_group = Koha::Biblio::ItemGroup->new_from_api($item_group_data); + $item_group->store->discard_changes(); - $c->res->headers->location( $c->req->url->to_string . '/' . $volume->id ); + $c->res->headers->location( $c->req->url->to_string . '/' . $item_group->id ); return $c->render( status => 201, - openapi => $volume->to_api + openapi => $item_group->to_api ); } catch { if ( blessed($_) ) { - my $to_api_mapping = Koha::Biblio::Volume->new->to_api_mapping; + my $to_api_mapping = Koha::Biblio::ItemGroup->new->to_api_mapping; - if ( $_->isa('Koha::Exceptions::Object::FKConstraint') and - $to_api_mapping->{ $_->broken_fk } eq 'biblio_id') { + if ( $_->isa('Koha::Exceptions::Object::FKConstraint') + and $_->broken_fk eq 'biblio_id' ) + { return $c->render( status => 404, openapi => { error => "Biblio not found" } @@ -134,7 +135,7 @@ sub add { =head3 update -Controller function to handle updating a Koha::Biblio::Volume object +Controller function to handle updating a Koha::Biblio::ItemGroup object =cut @@ -142,31 +143,31 @@ sub update { my $c = shift->openapi->valid_input or return; return try { - my $volume_id = $c->validation->param('volume_id'); - my $biblio_id = $c->validation->param('biblio_id'); + my $item_group_id = $c->validation->param('item_group_id'); + my $biblio_id = $c->validation->param('biblio_id'); - my $volume = Koha::Biblio::Volumes->find( $volume_id ); + my $item_group = Koha::Biblio::ItemGroups->find( $item_group_id ); - unless ( $volume && $volume->biblionumber eq $biblio_id ) { + unless ( $item_group && $item_group->biblio_id eq $biblio_id ) { return $c->render( status => 404, openapi => { - error => 'Volume not found' + error => 'Item group not found' } ); } - my $volume_data = $c->validation->param('body'); - $volume->set_from_api( $volume_data )->store->discard_changes(); + my $item_group_data = $c->validation->param('body'); + $item_group->set_from_api( $item_group_data )->store->discard_changes(); return $c->render( status => 200, - openapi => $volume->to_api + openapi => $item_group->to_api ); } catch { if ( blessed($_) ) { - my $to_api_mapping = Koha::Biblio::Volume->new->to_api_mapping; + my $to_api_mapping = Koha::Biblio::ItemGroup->new->to_api_mapping; if ( $_->isa('Koha::Exceptions::Object::FKConstraint') ) { return $c->render( @@ -184,7 +185,7 @@ sub update { =head3 delete -Controller function that handles deleting a Koha::Biblio::Volume object +Controller function that handles deleting a Koha::Biblio::ItemGroup object =cut @@ -192,18 +193,22 @@ sub delete { my $c = shift->openapi->valid_input or return; - my $volume_id = $c->validation->param( 'volume_id' ); - my $biblio_id = $c->validation->param( 'biblio_id' ); + my $item_group_id = $c->validation->param('item_group_id'); + my $biblio_id = $c->validation->param('biblio_id'); - my $volume = Koha::Biblio::Volumes->find({ id => $volume_id, biblionumber => $biblio_id }); + my $item_group = Koha::Biblio::ItemGroups->find( + { item_group_id => $item_group_id, biblio_id => $biblio_id } ); - if ( not defined $volume ) { - return $c->render( status => 404, openapi => { error => "Volume not found" } ); + if ( not defined $item_group ) { + return $c->render( + status => 404, + openapi => { error => "Item group not found" } + ); } return try { - $volume->delete; - return $c->render( status => 204, openapi => ''); + $item_group->delete; + return $c->render( status => 204, openapi => '' ); } catch { $c->unhandled_exception($_); diff --git a/Koha/REST/V1/Biblios/Volumes/Items.pm b/Koha/REST/V1/Biblios/ItemGroups/Items.pm similarity index 70% rename from Koha/REST/V1/Biblios/Volumes/Items.pm rename to Koha/REST/V1/Biblios/ItemGroups/Items.pm index fd6ad08882..a946e5fefc 100644 --- a/Koha/REST/V1/Biblios/Volumes/Items.pm +++ b/Koha/REST/V1/Biblios/ItemGroups/Items.pm @@ -1,4 +1,4 @@ -package Koha::REST::V1::Biblios::Volumes::Items; +package Koha::REST::V1::Biblios::ItemGroups::Items; # This file is part of Koha. # @@ -19,14 +19,14 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Koha::Biblio::Volume::Items; +use Koha::Biblio::ItemGroup::Items; use Scalar::Util qw(blessed); use Try::Tiny; =head1 NAME -Koha::REST::V1::Biblios::Volumes::Items - Koha REST API for handling volume items (V1) +Koha::REST::V1::Biblios::ItemGroups::Items - Koha REST API for handling item group items (V1) =head1 API @@ -34,7 +34,7 @@ Koha::REST::V1::Biblios::Volumes::Items - Koha REST API for handling volume item =head3 add -Controller function to handle adding a Koha::Biblio::Volume object +Controller function to handle linking an item to a Koha::Biblio::ItemGroup object =cut @@ -43,24 +43,24 @@ sub add { return try { - my $volume = Koha::Biblio::Volumes->find( - $c->validation->param('volume_id') + my $item_group = Koha::Biblio::ItemGroups->find( + $c->validation->param('item_group_id') ); - unless ( $volume ) { + unless ( $item_group ) { return $c->render( status => 404, openapi => { - error => 'Volume not found' + error => 'Item group not found' } ); } - unless ( $volume->biblionumber eq $c->validation->param('biblio_id') ) { + unless ( $item_group->biblio_id eq $c->validation->param('biblio_id') ) { return $c->render( status => 409, openapi => { - error => 'Volume does not belong to passed biblio_id' + error => 'Item group does not belong to passed biblio_id' } ); } @@ -69,7 +69,7 @@ sub add { my $body = $c->validation->param('body'); my $item_id = $body->{item_id}; - $volume->add_item({ item_id => $item_id }); + $item_group->add_item({ item_id => $item_id }); $c->res->headers->location( $c->req->url->to_string . '/' . $item_id ); @@ -77,7 +77,7 @@ sub add { return $c->render( status => 201, - openapi => $volume->to_api({ embed => $embed }) + openapi => $item_group->to_api({ embed => $embed }) ); } catch { @@ -92,11 +92,11 @@ sub add { } ); } - elsif ( $_->broken_fk eq 'biblionumber' ) { + elsif ( $_->broken_fk eq 'biblio_id' ) { return $c->render( status => 409, openapi => { - error => "Given item_id does not belong to the volume's biblio" + error => "Given item_id does not belong to the item group's biblio" } ); } @@ -106,7 +106,7 @@ sub add { return $c->render( status => 409, openapi => { - error => "The given item_id is already linked to the volume" + error => "The given item_id is already linked to the item group" } ); } @@ -118,20 +118,20 @@ sub add { =head3 delete -Controller function that handles deleting a Koha::Biblio::Volume object +Controller function that handles unlinking an item from a Koha::Biblio::ItemGroup object =cut sub delete { my $c = shift->openapi->valid_input or return; - my $volume_id = $c->validation->param('volume_id'); - my $item_id = $c->validation->param('item_id'); + my $item_group_id = $c->validation->param('item_group_id'); + my $item_id = $c->validation->param('item_id'); - my $item_link = Koha::Biblio::Volume::Items->find( + my $item_link = Koha::Biblio::ItemGroup::Items->find( { - itemnumber => $item_id, - volume_id => $volume_id + item_id => $item_id, + item_group_id => $item_group_id } ); @@ -139,7 +139,7 @@ sub delete { return $c->render( status => 404, openapi => { - error => 'No such volume <-> item relationship' + error => 'No such item group <-> item relationship' } ); } diff --git a/Koha/Schema/Result/ItemGroup.pm b/Koha/Schema/Result/ItemGroup.pm index 3688cb809a..385a4f6cb6 100644 --- a/Koha/Schema/Result/ItemGroup.pm +++ b/Koha/Schema/Result/ItemGroup.pm @@ -151,6 +151,11 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1WBTrtEB25MCOwR4nqPpVA +sub koha_object_class { + 'Koha::Biblio::ItemGroup'; +} +sub koha_objects_class { + 'Koha::Biblio::ItemGroups'; +} -# 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 index db90ce7a9c..21699b5c44 100644 --- a/Koha/Schema/Result/ItemGroupItem.pm +++ b/Koha/Schema/Result/ItemGroupItem.pm @@ -134,6 +134,11 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UkFl9MLWlH8wy3T/AaVIdQ +sub koha_object_class { + 'Koha::Biblio::ItemGroup::Item'; +} +sub koha_objects_class { + 'Koha::Biblio::ItemGroup::Items'; +} -# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/api/v1/swagger/definitions.json b/api/v1/swagger/definitions.json index 4bf37f177e..4a22a2d0fc 100644 --- a/api/v1/swagger/definitions.json +++ b/api/v1/swagger/definitions.json @@ -26,6 +26,9 @@ "invoice": { "$ref": "definitions/invoice.json" }, + "item_group": { + "$ref": "definitions/item_group.json" + }, "checkouts": { "$ref": "definitions/checkouts.json" }, @@ -83,9 +86,6 @@ "vendor": { "$ref": "definitions/vendor.json" }, - "volume": { - "$ref": "definitions/volume.json" - }, "return_claim": { "$ref": "definitions/return_claim.json" }, diff --git a/api/v1/swagger/definitions/volume.json b/api/v1/swagger/definitions/item_group.json similarity index 67% rename from api/v1/swagger/definitions/volume.json rename to api/v1/swagger/definitions/item_group.json index 884e3e5499..2357a7f818 100644 --- a/api/v1/swagger/definitions/volume.json +++ b/api/v1/swagger/definitions/item_group.json @@ -1,10 +1,10 @@ { "type": "object", "properties": { - "volume_id": { + "item_group_id": { "type": "integer", "readOnly": true, - "description": "Internal identifier for the volume" + "description": "Internal identifier for the item group" }, "biblio_id": { "type": "integer", @@ -13,23 +13,23 @@ }, "description": { "type": "string", - "description": "Volume description" + "description": "Item group description" }, "display_order": { "type": "integer", - "description": "Volume description" + "description": "Display order" }, "creation_date": { "type": "string", "format": "date-time", "readOnly": true, - "description": "Date and time the volume was created" + "description": "Date and time the item group was created" }, "modification_date": { "type": "string", "format": "date-time", "readOnly": true, - "description": "Date and time the volume was last modified" + "description": "Date and time the item group was last modified" }, "items": { "type": [ @@ -37,12 +37,12 @@ "null" ], "readOnly": true, - "description": "A list of items that belong to the volume (x-koha-embed)" + "description": "A list of items that belong to the item group (x-koha-embed)" } }, "additionalProperties": false, "required": [ - "volume_id", + "item_group_id", "biblio_id" ] } diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json index d986a4414c..ced1747c06 100644 --- a/api/v1/swagger/paths.json +++ b/api/v1/swagger/paths.json @@ -26,17 +26,17 @@ "/biblios/{biblio_id}/pickup_locations": { "$ref": "paths/biblios.json#/~1biblios~1{biblio_id}~1pickup_locations" }, - "/biblios/{biblio_id}/volumes": { - "$ref": "paths/biblios_volumes.json#/~1biblios~1{biblio_id}~1volumes" + "/biblios/{biblio_id}/item_groups": { + "$ref": "paths/biblios_item_groups.json#/~1biblios~1{biblio_id}~1item_groups" }, - "/biblios/{biblio_id}/volumes/{volume_id}": { - "$ref": "paths/biblios_volumes.json#/~1biblios~1{biblio_id}~1volumes~1{volume_id}" + "/biblios/{biblio_id}/item_groups/{item_group_id}": { + "$ref": "paths/biblios_item_groups.json#/~1biblios~1{biblio_id}~1item_groups~1{item_group_id}" }, - "/biblios/{biblio_id}/volumes/{volume_id}/items": { - "$ref": "paths/biblios_volumes.json#/~1biblios~1{biblio_id}~1volumes~1{volume_id}~1items" + "/biblios/{biblio_id}/item_groups/{item_group_id}/items": { + "$ref": "paths/biblios_item_groups.json#/~1biblios~1{biblio_id}~1item_groups~1{item_group_id}~1items" }, - "/biblios/{biblio_id}/volumes/{volume_id}/items/{item_id}": { - "$ref": "paths/biblios_volumes.json#/~1biblios~1{biblio_id}~1volumes~1{volume_id}~1items~1{item_id}" + "/biblios/{biblio_id}/item_groups/{item_group_id}/items/{item_id}": { + "$ref": "paths/biblios_item_groups.json#/~1biblios~1{biblio_id}~1item_groups~1{item_group_id}~1items~1{item_id}" }, "/cash_registers/{cash_register_id}/cashups": { "$ref": "paths/cash_registers.json#/~1cash_registers~1{cash_register_id}~1cashups" diff --git a/api/v1/swagger/paths/biblios_volumes.json b/api/v1/swagger/paths/biblios_item_groups.json similarity index 83% rename from api/v1/swagger/paths/biblios_volumes.json rename to api/v1/swagger/paths/biblios_item_groups.json index f547f30bcf..b3ca9868bb 100644 --- a/api/v1/swagger/paths/biblios_volumes.json +++ b/api/v1/swagger/paths/biblios_item_groups.json @@ -1,10 +1,10 @@ { - "/biblios/{biblio_id}/volumes": { + "/biblios/{biblio_id}/item_groups": { "get": { - "x-mojo-to": "Biblios::Volumes#list", - "operationId": "listVolumes", - "tags": [ "volumes" ], - "summary": "List volumes", + "x-mojo-to": "Biblios::ItemGroups#list", + "operationId": "listItemGroups", + "tags": [ "item_groups" ], + "summary": "List item groups", "parameters": [ { "name": "biblio_id", @@ -43,11 +43,11 @@ ], "responses": { "200": { - "description": "A list of volumes", + "description": "A list of item groups", "schema": { "type": "array", "items": { - "$ref": "../definitions.json#/volume" + "$ref": "../definitions.json#/item_group" } } }, @@ -78,7 +78,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } }, "x-koha-embed": [ @@ -86,10 +86,10 @@ ] }, "post": { - "x-mojo-to": "Biblios::Volumes#add", - "operationId": "addVolume", - "tags": [ "volumes" ], - "summary": "Add volume", + "x-mojo-to": "Biblios::ItemGroups#add", + "operationId": "addItemGroup", + "tags": [ "item_groups" ], + "summary": "Add item group", "parameters": [ { "name": "biblio_id", @@ -101,18 +101,18 @@ { "name": "body", "in": "body", - "description": "A JSON object representing a volume", + "description": "A JSON object representing an item group", "required": true, "schema": { "type": "object", "properties": { "description": { "type": "string", - "description": "Volume description" + "description": "Item group description" }, "display_order": { "type": "integer", - "description": "Position in waiting queue" + "description": "Display order" } } } @@ -126,9 +126,9 @@ ], "responses": { "201": { - "description": "A successfully created volume", + "description": "A successfully created item group", "schema": { - "$ref": "../definitions.json#/volume" + "$ref": "../definitions.json#/item_group" } }, "400": { @@ -176,17 +176,17 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } } } }, - "/biblios/{biblio_id}/volumes/{volume_id}": { + "/biblios/{biblio_id}/item_groups/{item_group_id}": { "get": { - "x-mojo-to": "Biblios::Volumes#get", - "operationId": "getVolume", - "tags": [ "volumes" ], - "summary": "Get volume", + "x-mojo-to": "Biblios::ItemGroups#get", + "operationId": "getItemGroup", + "tags": [ "item_groups" ], + "summary": "Get item group", "parameters": [ { "name": "biblio_id", @@ -196,9 +196,9 @@ "type": "string" }, { - "name": "volume_id", + "name": "item_group_id", "in": "path", - "description": "Internal identifier for the volume", + "description": "Internal identifier for the item group", "required": true, "type": "string" } @@ -211,9 +211,9 @@ ], "responses": { "200": { - "description": "A volume", + "description": "An item group", "schema": { - "$ref": "../definitions.json#/volume" + "$ref": "../definitions.json#/item_group" } }, "400": { @@ -223,7 +223,7 @@ } }, "404": { - "description": "Volume not found", + "description": "Item group not found", "schema": { "$ref": "../definitions.json#/error" } @@ -246,15 +246,15 @@ ], "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } } }, "put": { - "x-mojo-to": "Biblios::Volumes#update", - "operationId": "updateVolume", - "tags": [ "volumes" ], - "summary": "Update volume", + "x-mojo-to": "Biblios::ItemGroups#update", + "operationId": "updateItemGroup", + "tags": [ "item_groups" ], + "summary": "Update item group", "parameters": [ { "name": "biblio_id", @@ -264,23 +264,23 @@ "type": "string" }, { - "name": "volume_id", + "name": "item_group_id", "in": "path", - "description": "Internal identifier for the volume", + "description": "Internal identifier for the item group", "required": true, "type": "string" }, { "name": "body", "in": "body", - "description": "A JSON object with the new values for the volume", + "description": "A JSON object with the new values for the item group", "required": true, "schema": { "type": "object", "properties": { "description": { "type": "string", - "description": "Volume description" + "description": "Item group description" }, "display_order": { "type": "integer", @@ -298,9 +298,9 @@ ], "responses": { "200": { - "description": "The updated volume", + "description": "The updated item group", "schema": { - "$ref": "../definitions.json#/volume" + "$ref": "../definitions.json#/item_group" } }, "400": { @@ -322,7 +322,7 @@ } }, "404": { - "description": "Volume not found", + "description": "Item group not found", "schema": { "$ref": "../definitions.json#/error" } @@ -342,7 +342,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } }, "x-koha-embed": [ @@ -350,10 +350,10 @@ ] }, "delete": { - "x-mojo-to": "Biblios::Volumes#delete", - "operationId": "deleteVolume", - "tags": ["volumes"], - "summary": "Delete volume", + "x-mojo-to": "Biblios::ItemGroups#delete", + "operationId": "deleteItemGroup", + "tags": ["item_groups"], + "summary": "Delete item group", "parameters": [ { "name": "biblio_id", @@ -363,9 +363,9 @@ "type": "string" }, { - "name": "volume_id", + "name": "item_group_id", "in": "path", - "description": "Internal identifier for the volume", + "description": "Internal identifier for the item group", "required": true, "type": "string" } @@ -375,7 +375,7 @@ ], "responses": { "204": { - "description": "Volume deleted", + "description": "Item group deleted", "schema": { "type": "string" } @@ -393,7 +393,7 @@ } }, "404": { - "description": "Volume not found", + "description": "Item group not found", "schema": { "$ref": "../definitions.json#/error" } @@ -413,17 +413,17 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } } } }, - "/biblios/{biblio_id}/volumes/{volume_id}/items": { + "/biblios/{biblio_id}/item_groups/{item_group_id}/items": { "post": { - "x-mojo-to": "Biblios::Volumes::Items#add", - "operationId": "addVolumeItem", - "tags": [ "volumes" ], - "summary": "Add item to volume", + "x-mojo-to": "Biblios::ItemGroups::Items#add", + "operationId": "addItemGroupItem", + "tags": [ "item_groups" ], + "summary": "Add item to item group", "parameters": [ { "name": "biblio_id", @@ -433,9 +433,9 @@ "type": "string" }, { - "name": "volume_id", + "name": "item_group_id", "in": "path", - "description": "Internal identifier for the volume", + "description": "Internal identifier for the item group", "required": true, "type": "string" }, @@ -463,7 +463,7 @@ ], "responses": { "201": { - "description": "Item linked to volume" + "description": "Item linked to item group" }, "400": { "description": "Bad request", @@ -504,7 +504,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } }, "x-koha-embed": [ @@ -512,12 +512,12 @@ ] } }, - "/biblios/{biblio_id}/volumes/{volume_id}/items/{item_id}": { + "/biblios/{biblio_id}/item_groups/{item_group_id}/items/{item_id}": { "delete": { - "x-mojo-to": "Biblios::Volumes::Items#delete", - "operationId": "deleteVolumeItems", - "tags": ["volumes"], - "summary": "Delete item from volume", + "x-mojo-to": "Biblios::ItemGroups::Items#delete", + "operationId": "deleteItemGroupItems", + "tags": ["item_groups"], + "summary": "Delete item from item group", "parameters": [ { "name": "biblio_id", @@ -527,9 +527,9 @@ "type": "string" }, { - "name": "volume_id", + "name": "item_group_id", "in": "path", - "description": "Internal identifier for the volume", + "description": "Internal identifier for the item group", "required": true, "type": "string" }, @@ -549,7 +549,7 @@ ], "responses": { "204": { - "description": "Item unlinked from volume", + "description": "Item unlinked from item group", "schema": { "type": "string" } @@ -567,7 +567,7 @@ } }, "404": { - "description": "Item not linked to volume", + "description": "Item not linked to item group", "schema": { "$ref": "../definitions.json#/error" } @@ -587,7 +587,7 @@ }, "x-koha-authorization": { "permissions": { - "catalogue": "manage_volumes" + "catalogue": "manage_item_groups" } } } diff --git a/catalogue/detail.pl b/catalogue/detail.pl index c5c9792a24..2167d1de5c 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -46,8 +46,9 @@ use Koha::DateUtils qw( format_sqldatetime ); use C4::HTML5Media; use C4::CourseReserves qw( GetItemCourseReservesInfo ); use Koha::AuthorisedValues; -use Koha::Biblio::Volume::Items; use Koha::Biblios; +use Koha::Biblio::ItemGroup::Items; +use Koha::Biblio::ItemGroups; use Koha::CoverImages; use Koha::DateUtils; use Koha::Illrequests; @@ -100,37 +101,35 @@ eval { $biblio->metadata->record }; $template->param( decoding_error => $@ ); my $op = $query->param('op') || q{}; -if ( $op eq 'set_volume' ) { - my $volume_id = $query->param('volume_id'); - my @itemnumbers = $query->multi_param('itemnumber'); +if ( $op eq 'set_item_group' ) { + my $item_group_id = $query->param('item_group_id'); + my @itemnumbers = $query->multi_param('itemnumber'); - foreach my $itemnumber (@itemnumbers) { - my $volume_item = - Koha::Biblio::Volume::Items->find( { itemnumber => $itemnumber } ); + foreach my $item_id (@itemnumbers) { + my $item_group_item = Koha::Biblio::ItemGroup::Items->find( { item_id => $item_id } ); - if ($volume_item) { - $volume_item->volume_id($volume_id); + if ($item_group_item) { + $item_group_item->item_group_id($item_group_id); } else { - $volume_item = Koha::Biblio::Volume::Item->new( + $item_group_item = Koha::Biblio::ItemGroup::Item->new( { - itemnumber => $itemnumber, - volume_id => $volume_id, + item_id => $item_id, + item_group_id => $item_group_id, } ); } - $volume_item->store(); + $item_group_item->store(); } } -elsif ( $op eq 'unset_volume' ) { - my $volume_id = $query->param('volume_id'); +elsif ( $op eq 'unset_item_group' ) { + my $item_group_id = $query->param('item_group_id'); my @itemnumbers = $query->multi_param('itemnumber'); - foreach my $itemnumber (@itemnumbers) { - my $volume_item = - Koha::Biblio::Volume::Items->find( { itemnumber => $itemnumber } ); - $volume_item->delete() if $volume_item; + foreach my $item_id (@itemnumbers) { + my $item_group_item = Koha::Biblio::ItemGroup::Items->find( { item_id => $item_id } ); + $item_group_item->delete() if $item_group_item; } } diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index ede8ecb752..c0fc311d21 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -40,6 +40,7 @@ use C4::Context; use C4::Circulation qw( LostItem ); use C4::Koha qw( GetAuthorisedValues ); use C4::ClassSource qw( GetClassSources GetClassSource ); +use Koha::Biblio::ItemGroups; use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::ItemTypes; @@ -85,32 +86,25 @@ sub get_item_from_barcode { return($result); } -sub add_item_to_volume { - my ( $biblionumber, $itemnumber, $volume, $volume_description ) = @_; - - return unless $volume; - - my $volume_id; - if ( $volume eq 'create' ) { - my $volume = Koha::Biblio::Volume->new( - { - biblionumber => $biblionumber, - description => $volume_description, - } - )->store(); - - $volume_id = $volume->id; - } - else { - $volume_id = $volume; - } - - my $volume_item = Koha::Biblio::Volume::Item->new( - { - itemnumber => $itemnumber, - volume_id => $volume_id, +sub add_item_to_item_group { + my ( $biblio_id, $item_id, $item_group_param, $description ) = @_; + + if ( $item_group_param ) { + # item group passed, deal with it + my $item_group; + if ( $item_group_param eq 'create' ) { + $item_group = Koha::Biblio::ItemGroup->new( + { + biblio_id => $biblio_id, + description => $description, + } + ); + } + else { + $item_group = Koha::Biblio::ItemGroups->find( $item_group_param ); } - )->store(); + $item_group->add_item({ item_id => $item_id }); + } } # NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code @@ -449,13 +443,13 @@ my $hostitemnumber = $input->param('hostitemnumber'); my $marcflavour = C4::Context->preference("marcflavour"); my $searchid = $input->param('searchid'); # fast cataloguing datas -my $fa_circborrowernumber = $input->param('circborrowernumber'); -my $fa_barcode = $input->param('barcode'); -my $fa_branch = $input->param('branch'); -my $fa_stickyduedate = $input->param('stickyduedate'); -my $fa_duedatespec = $input->param('duedatespec'); -my $volume = $input->param('volume'); -my $volume_description = $input->param('volume_description'); +my $fa_circborrowernumber = $input->param('circborrowernumber'); +my $fa_barcode = $input->param('barcode'); +my $fa_branch = $input->param('branch'); +my $fa_stickyduedate = $input->param('stickyduedate'); +my $fa_duedatespec = $input->param('duedatespec'); +my $item_group_param = $input->param('item_group_id'); +my $item_group_description = $input->param('item_group_description'); my $frameworkcode = &GetFrameworkCode($biblionumber); @@ -562,8 +556,7 @@ if ($op eq "additem") { # if barcode exists, don't create, but report The problem. unless ($exist_itemnumber) { my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber ); - add_item_to_volume( $oldbiblionumber, $oldbibitemnum, $volume, $volume_description ); - + add_item_to_item_group( $oldbiblionumber, $oldbibitemnum, $item_group_param, $item_group_description ); # Pushing the last created item cookie back if ($prefillitem && defined $record) { my $itemcookie = $input->cookie( @@ -662,8 +655,7 @@ if ($op eq "additem") { if (!$exist_itemnumber) { my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber, { skip_record_index => 1 } ); - add_item_to_volume( $oldbiblionumber, $oldbibitemnum, $volume, $volume_description ); - + add_item_to_item_group( $oldbiblionumber, $oldbibitemnum, $item_group_param, $item_group_description ); # We count the item only if it was really added # That way, all items are added, even if there was some already existing barcodes # FIXME : Please note that there is a risk of infinite loop here if we never find a suitable barcode @@ -1033,7 +1025,7 @@ foreach my $tag ( keys %{$tagslib}){ # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. $template->param( - volumes => scalar Koha::Biblio::Volumes->search({ biblionumber => $biblionumber }), + item_groups => scalar Koha::Biblio::ItemGroups->search({ biblio_id => $biblionumber }), biblionumber => $biblionumber, title => $oldrecord->{title}, author => $oldrecord->{author}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 8e0b18383c..a62f89c225 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -330,9 +330,9 @@ Fast cataloging ([% name | html %]) - [%- CASE 'manage_volumes' -%] - - Create, update and delete volumes, add or remove items from a volume + [%- CASE 'manage_item_groups' -%] + + Create, update and delete item groups, add or remove items from an item group ([% name | html %]) [%- CASE 'remaining_permissions' -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 78752c3311..8875fc4d65 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -660,11 +660,11 @@ Circulation: - 'the last patron to return an item. This setting is independent of the opacreadinghistory and AnonymousPatron system preferences.' Holds policy: - - - pref: EnableVolumes + - pref: EnableItemGroups choices: yes: Enable no: "Don't enable" - - volumes feature to allow collecting groups of items on a record into volumes. + - the item groups feature to allow collecting groups of items on a record together. - - In the staff client, split the holds queue into separate tables by - pref: HoldsSplitQueue diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 7ee02ca7e8..0f7e6b628d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -273,7 +273,7 @@ Holdings ([% itemloop.size() || 0 | html %]) [% END %] -[% IF Koha.Preference('EnableVolumes') %]
  • Volumes
  • [% END %] +[% IF Koha.Preference('EnableItemGroups') %]
  • Item groups
  • [% END %] [% IF ( MARCNOTES || notes ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] @@ -310,9 +310,9 @@ [% IF CAN_user_tools_items_batchmod %] Modify selected items [% END %] - [% IF CAN_user_editcatalogue_manage_volumes && biblio.volumes.count %] - Add/move to volume - Remove from volume + [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] + Add/move to item group + Remove from item group [% END %]
    [% END %] @@ -328,8 +328,8 @@ Current library Home library [% IF ( itemdata_ccode ) %]Collection[% END %] - [% IF Koha.Preference('EnableVolumes') %] - Volume + [% IF Koha.Preference('EnableItemGroups') %] + Item group [% END %] Call number [% IF volinfo %] @@ -405,7 +405,7 @@ Note that permanent location is a code, and location may be an authval. [% IF ( itemdata_ccode ) %][% item.ccode | html %][% END %] - [% IF Koha.Preference('EnableVolumes') %][% item.object.volume.description | html %][% END %] + [% IF Koha.Preference('EnableItemGroups') %][% item.object.item_group.description | html %][% END %] [% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %] [% IF ( volinfo ) %] [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %] @@ -611,14 +611,14 @@ Note that permanent location is a code, and location may be an authval. [% END %][%# end of block items_table %] -[% IF Koha.Preference('EnableVolumes') %] -
    - [% IF CAN_user_editcatalogue_manage_volumes %] -
    - New volume +[% IF Koha.Preference('EnableItemGroups') %] +
    + [% IF CAN_user_editcatalogue_manage_item_groups %] + [% END %] - +
    @@ -1048,32 +1048,32 @@ Note that permanent location is a code, and location may be an authval. [% END %] -
    Display Order