diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 05f394e053..8a341b6e11 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -196,13 +196,7 @@ if ( $op eq 'add_form' ) { } if ( $op eq 'list' ) { - my @itypes = Koha::ItemTypes->search->as_list; - my @itemtypes; - foreach my $itype (@itypes) { - my $itemtype = $itype->unblessed; - $itemtype->{branches} = $itype->library_limits ? $itype->library_limits->as_list : []; - push @itemtypes, $itemtype; - } + my @itemtypes = Koha::ItemTypes->search->as_list; $template->param( itemtypes => \@itemtypes, messages => \@messages, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index 2330e84779..2f8c8986aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -414,20 +414,20 @@ Item types administration [% itemtype.processfee | $Price %] [% itemtype.checkinmsg | html_line_break | $raw %] - [% IF itemtype.branches.size > 0 %] - [% branches_str = "" %] - [% FOREACH branch IN itemtype.branches %] + [% IF itemtype.library_limits %] + [% libraries_str = "" %] + [% FOREACH library IN itemtype.library_limits %] [%- IF loop.first -%] - [% branches_str = branch.branchname _ " (" _ branch.branchcode _ ")" %] + [% libraries_str = library.branchname _ " (" _ library.branchcode _ ")" %] [% ELSE %] - [% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %] + [% libraries_str = libraries_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] [% END %] [% END %] - - [% IF itemtype.branches.size > 1 %] - [% itemtype.branches.size | html %] library limitations + + [% IF itemtype.library_limits.count > 1 %] + [% itemtype.library_limits.count | html %] library limitations [% ELSE %] - [% itemtype.branches.size | html %] library limitation + [% itemtype.library_limits.count | html %] library limitation [% END %] [% ELSE %] No limitation