Bugzilla – Attachment 184517 Details for
Bug 16631
Show groups/categories of reports to authorized staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug 16631: 0010-Refactor-getting-selected-lirbaries
0010-Refactor-getting-selected-lirbaries.patch (text/plain), 5.68 KB, created by
Casey Conlin
on 2025-07-22 22:03:34 UTC
(
hide
)
Description:
Bug 16631: 0010-Refactor-getting-selected-lirbaries
Filename:
MIME Type:
Creator:
Casey Conlin
Created:
2025-07-22 22:03:34 UTC
Size:
5.68 KB
patch
obsolete
>From d263ee286339ab770d94bc835c9222f1961deacb Mon Sep 17 00:00:00 2001 >From: Casey Conlin <101153261+CaseyConlin@users.noreply.github.com> >Date: Sat, 12 Jul 2025 13:18:20 -0400 >Subject: [PATCH 10/16] Refactor getting selected lirbaries. > >--- > .../modules/reports/guided_reports_start.tt | 8 +-- > reports/guided_reports.pl | 68 +++---------------- > 2 files changed, 10 insertions(+), 66 deletions(-) > >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 07fe927347..8e6a4fd042 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 >@@ -1556,13 +1556,7 @@ > <div > ><label for="library_limitation">Library limitation: </label> > <select id="library_limitation" name="branches" multiple size="10"> >- [% FOREACH branch IN branches_loop %] >- [% IF ( branch.selected ) %] >- <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> >- [% ELSE %] >- <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => report.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %] > </select> > <div class="hint">Limits the use of this report to the selected libraries.</div> > </div> >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index d5834bfb76..e3c34532e6 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -88,23 +88,6 @@ my $session = $session_id ? get_session($session_id) : undef; > > $template->param( templates => Koha::Notice::Templates->search( { module => 'report' } ) ); > >-#my $report_module = Koha::Reports->new(); >-#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 = {}; >@@ -151,44 +134,11 @@ if ( !$op ) { > ); > > } elsif ( $op eq 'edit_form' ) { >- my $id = $input->param('id'); >- my $report = Koha::Reports->find($id); >- my $group = $report->report_group; >- my $subgroup = $report->report_subgroup; >- my $tables = get_tables(); >- my $selected_branches = $report ? $report->get_library_limits : undef; >- my $branches = >- Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; >- my @branches_loop; >- >- foreach my $branch (@$branches) { >- my $selected = >- ( $selected_branches && grep { $_->branchcode eq $branch->{branchcode} } @{ $selected_branches->as_list } ) >- ? 1 >- : 0; >- push @branches_loop, >- { >- branchcode => $branch->{branchcode}, >- branchname => $branch->{branchname}, >- selected => $selected, >- }; >- } >- >- # my $selected_branches = $report ? $report->get_library_limits : undef; >- # my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; >- # my @branches_loop; >- # foreach my $branch (@$branches) { >- # my $selected = >- # ( $selected_branches && grep { $_->branchcode eq $branch->{branchcode} } @{ $selected_branches->as_list } ) >- # ? 1 >- # : 0; >- # push @branches_loop, >- # { >- # branchcode => $branch->{branchcode}, >- # branchname => $branch->{branchname}, >- # selected => $selected, >- # }; >- # } >+ my $id = $input->param('id'); >+ my $report = Koha::Reports->find($id); >+ my $group = $report->report_group; >+ my $subgroup = $report->report_subgroup; >+ my $tables = get_tables(); > > $template->param( > 'sql' => $report->savedsql, >@@ -203,9 +153,7 @@ if ( !$op ) { > 'mana_id' => $report->{mana_id}, > 'mana_comments' => $report->{comments}, > 'tables' => $tables, >- >- # 'branches' => $report->get_library_limits ? $report->get_library_limits->as_list : [], >- 'branches_loop' => \@branches_loop >+ 'report' => $report, > ); > > } elsif ( $op eq 'cud-update_sql' || $op eq 'cud-update_and_run_sql' ) { >@@ -280,7 +228,9 @@ if ( !$op ) { > 'problematic_authvals' => $problematic_authvals, > 'warn_authval_problem' => 1, > 'phase_update' => 1, >- 'branches' => @branches, >+ >+ # 'branches' => @branches, >+ 'report' => $report, > ); > > } else { >-- >2.39.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 16631
:
184422
|
184508
|
184509
|
184510
|
184511
|
184512
|
184513
|
184514
|
184515
|
184516
|
184517
|
184518
|
184519
|
184520
|
184521
|
184522
|
184525
|
184526
|
184657
|
184674
|
184686
|
184687
|
184688
|
184689
|
184690
|
184691
|
184692
|
184693
|
184694
|
184695
|
184845
|
184846
|
184847
|
184848
|
184859
|
184861