@@ -, +, @@ --- Koha/ItemType.pm | 13 +++++ admin/itemtypes.pl | 2 +- .../prog/en/modules/admin/itemtypes.tt | 57 +++++++++++++++------- 3 files changed, 54 insertions(+), 18 deletions(-) --- a/Koha/ItemType.pm +++ a/Koha/ItemType.pm @@ -125,6 +125,19 @@ sub may_article_request { return ( $guess->{ $itemtype // q{} } || $guess->{ '*' } ) ? 1 : q{}; } +=head3 parent + + Returns the ItemType object of the parent_type or undef. + +=cut + +sub parent { + my ( $self ) = @_; + my $parent_rs = $self->_result->parent_type; + return unless $parent_rs; + return Koha::ItemType->_new_from_dbic( $parent_rs ); + +} =head3 type =cut --- a/admin/itemtypes.pl +++ a/admin/itemtypes.pl @@ -75,7 +75,7 @@ if ( $op eq 'add_form' ) { } elsif ( $op eq 'add_validate' ) { my $is_a_modif = $input->param('is_a_modif'); my $itemtype = Koha::ItemTypes->find($itemtype_code); - my $parent_type = $input->param('parent_type'); + my $parent_type = $input->param('parent_type') || undef; my $description = $input->param('description'); my $rentalcharge = $input->param('rentalcharge'); my $rentalcharge_daily = $input->param('rentalcharge_daily'); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -118,6 +118,7 @@ Item types administration [% IF !is_a_parent && parent_types %]