Bug 36673: Filter used categories and item types to current branch
To test: 1 - Define some circulation rules for default and specific branches 2 - Apply patch 3 - Confirm rules display as before PA amended: - bug->Bug in commit title - squashed tidy Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
675c8263b7
commit
f9effbfdb4
|
|
@ -739,13 +739,15 @@ my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['des
|
|||
|
||||
my $itemtypes = Koha::ItemTypes->search_with_localization;
|
||||
|
||||
my @used_categorycodes =
|
||||
Koha::CirculationRules->search( {}, { columns => ['categorycode'], distinct => 1, } )->get_column('categorycode');
|
||||
my @used_itemtypes =
|
||||
Koha::CirculationRules->search( {}, { columns => ['itemtype'], distinct => 1, } )->get_column('itemtype');
|
||||
|
||||
my $humanbranch = ( $branch ne '*' ? $branch : undef );
|
||||
|
||||
my @used_categorycodes =
|
||||
Koha::CirculationRules->search( { branchcode => $humanbranch }, { columns => ['categorycode'], distinct => 1, } )
|
||||
->get_column('categorycode');
|
||||
my @used_itemtypes =
|
||||
Koha::CirculationRules->search( { branchcode => $humanbranch }, { columns => ['itemtype'], distinct => 1, } )
|
||||
->get_column('itemtype');
|
||||
|
||||
my $all_rules = Koha::CirculationRules->search({ branchcode => $humanbranch });
|
||||
my $definedbranch = $all_rules->count ? 1 : 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue