View | Details | Raw Unified | Return to bug 36447
Collapse All | Expand All

(-)a/admin/smart-rules.pl (-6 / +13 lines)
Lines 739-744 my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['des Link Here
739
739
740
my $itemtypes = Koha::ItemTypes->search_with_localization;
740
my $itemtypes = Koha::ItemTypes->search_with_localization;
741
741
742
my @used_categorycodes =
743
    Koha::CirculationRules->search( {}, { columns => ['categorycode'], distinct => 1, } )->get_column('categorycode');
744
my @used_itemtypes =
745
    Koha::CirculationRules->search( {}, { columns => ['itemtype'], distinct => 1, } )->get_column('itemtype');
746
742
my $humanbranch = ( $branch ne '*' ? $branch : undef );
747
my $humanbranch = ( $branch ne '*' ? $branch : undef );
743
748
744
my $all_rules = Koha::CirculationRules->search({ branchcode => $humanbranch });
749
my $all_rules = Koha::CirculationRules->search({ branchcode => $humanbranch });
Lines 753-764 while ( my $r = $all_rules->next ) { Link Here
753
$template->param(show_branch_cat_rule_form => 1);
758
$template->param(show_branch_cat_rule_form => 1);
754
759
755
$template->param(
760
$template->param(
756
    patron_categories => $patron_categories,
761
    used_categorycodes => \@used_categorycodes,
757
    itemtypeloop      => $itemtypes,
762
    used_itemtypes     => \@used_itemtypes,
758
    humanbranch       => $humanbranch,
763
    patron_categories  => $patron_categories,
759
    current_branch    => $branch,
764
    itemtypeloop       => $itemtypes,
760
    definedbranch     => $definedbranch,
765
    humanbranch        => $humanbranch,
761
    all_rules         => $rules,
766
    current_branch     => $branch,
767
    definedbranch      => $definedbranch,
768
    all_rules          => $rules,
762
);
769
);
763
output_html_with_http_headers $input, $cookie, $template->output;
770
output_html_with_http_headers $input, $cookie, $template->output;
764
771
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-12 / +2 lines)
Lines 12-28 Link Here
12
12
13
[% SET branchcode = humanbranch || undef %]
13
[% SET branchcode = humanbranch || undef %]
14
14
15
[% SET categorycodes = [] %]
15
[% SET categorycodes = used_categorycodes %]
16
[% FOREACH pc IN patron_categories %]
16
[% SET itemtypes = used_itemtypes %]
17
    [% categorycodes.push( pc.id ) %]
18
[% END %]
19
[% categorycodes.push(undef) %]
20
21
[% SET itemtypes = [] %]
22
[% FOREACH i IN itemtypeloop %]
23
    [% itemtypes.push( i.itemtype ) %]
24
[% END %]
25
[% itemtypes.push(undef) %]
26
17
27
[% INCLUDE 'doc-head-open.inc' %]
18
[% INCLUDE 'doc-head-open.inc' %]
28
<title>[% FILTER collapse %]
19
<title>[% FILTER collapse %]
29
- 

Return to bug 36447