From 93b82e5c629c7a2eee4bdaf5fc18070390cb2300 Mon Sep 17 00:00:00 2001 From: "Cameron E. Tidd" Date: Sat, 12 Jul 2025 16:11:45 +0000 Subject: [PATCH 08/16] Populate Library limitations selection with libraries --- .../en/modules/reports/guided_reports_start.tt | 17 ++++++++++++++++- reports/guided_reports.pl | 13 +++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index b6aa9bc032..56989e0106 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1553,7 +1553,22 @@ Library limitation:
- + + [% FOREACH branch IN branches_loop %] + [% IF ( basketbranchcode == branch.branchcode ) %] + + [% ELSE %] + + [% END %] + [% END %] + +
+ + [% END # /IF branches_loop.size %] [% PROCESS options_for_libraries libraries => Branches.all( selected => savedreport.savedsql.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %]
Limits the use of this report to the selected libraries.
diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 71a5eaf6f5..fbd2d105df 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -90,6 +90,19 @@ $template->param( templates => Koha::Notice::Templates->search( { module => 'rep #my $cool_filtered_reports = $report_module->search_with_library_limits({}, {}, 'FFL'); #$template->param( templates => $cool_filtered_reports); +my $branches = + Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; +my @branches_loop; +foreach my $branch (@$branches) { + push @branches_loop, + { + branchcode => $branch->{branchcode}, + branchname => $branch->{branchname} + }; +} + +$template->param( 'branches_loop', \@branches_loop ); + my $filter; if ( $input->param("filter_set") or $input->param('clear_filters') ) { $filter = {}; -- 2.39.5