@@ -, +, @@ --- admin/marc-overlay-rules.pl | 13 +++++++++---- .../prog/en/modules/admin/marc-overlay-rules.tt | 10 ++++------ 2 files changed, 13 insertions(+), 10 deletions(-) --- a/admin/marc-overlay-rules.pl +++ a/admin/marc-overlay-rules.pl @@ -132,11 +132,16 @@ elsif ($op eq 'doedit' || $op eq 'add') { } } -my $categorycodes = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']}); +my $categories = { + map { $_->categorycode => $_->description } + Koha::Patron::Categories->search_with_library_limits( {}, + { order_by => ['description'] } )->as_list +}; + $template->param( - rules => $rules, - categorycodes => $categorycodes, - messages => $errors + rules => $rules, + categories => $categories, + messages => $errors ); output_html_with_http_headers $input, $cookie, $template->output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt @@ -1,4 +1,6 @@ [% USE raw %] +[% USE To %] +[% USE Categories %] [% USE Asset %] [% SET footerjs = 1 %] [% USE Koha %] @@ -454,11 +456,7 @@ } }); - var $category = {}; - - [% FOR categorycode IN categorycodes %] - $category["[% categorycode.categorycode %]"] = "[% categorycode.description | html %]"; - [% END %] + var categories = [% To.json( categories ) | $raw %]; var module_filter_options = { source: { @@ -471,7 +469,7 @@ import_lexile: _("import_lexile.pl") }, - categorycode: $category + categorycode: categories, }; //Kind of hack: Replace filter value with label when one exist --