Bugzilla – Attachment 184513 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: 0006-The-reports-list-can-be-limited-by-library-via-the-q
0006-The-reports-list-can-be-limited-by-library-via-the-q.patch (text/plain), 3.21 KB, created by
Casey Conlin
on 2025-07-22 22:01:59 UTC
(
hide
)
Description:
Bug 16631: 0006-The-reports-list-can-be-limited-by-library-via-the-q
Filename:
MIME Type:
Creator:
Casey Conlin
Created:
2025-07-22 22:01:59 UTC
Size:
3.21 KB
patch
obsolete
>From bd4d36e102825fb3debfc095b99452d5abb28141 Mon Sep 17 00:00:00 2001 >From: "Cameron E. Tidd" <ctidd@citlink.net> >Date: Wed, 9 Jul 2025 00:43:58 +0000 >Subject: [PATCH 06/16] The reports list can be limited by library via the > query. > >--- > C4/Reports/Guided.pm | 7 +++++++ > reports/guided_reports.pl | 10 ++++++++-- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 94e271cef7..9781d45e2f 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -819,6 +819,7 @@ sub get_saved_reports_base_query { > SELECT s.*, $area_name_sql_snippet, av_g.lib AS groupname, av_sg.lib AS subgroupname, > b.firstname AS borrowerfirstname, b.surname AS borrowersurname > FROM saved_sql s >+INNER JOIN reports_branches rb ON s.id = rb.report_id > LEFT JOIN saved_reports r ON r.report_id = s.id > LEFT OUTER JOIN authorised_values av_g ON (av_g.category = 'REPORT_GROUP' AND av_g.authorised_value = s.report_group) > LEFT OUTER JOIN authorised_values av_sg ON (av_sg.category = 'REPORT_SUBGROUP' AND av_sg.lib_opac = s.report_group AND av_sg.authorised_value = s.report_subgroup) >@@ -873,12 +874,18 @@ sub get_saved_reports { > push @cond, "report_subgroup = ?"; > push @args, $filter->{subgroup}; > } >+ if ( $filter->{branchcode} ) { >+ push @cond, "rb.branchcode = ?"; >+ push @args, $filter->{branchcode}; >+ } > } > $query .= " WHERE " . join( " AND ", map "($_)", @cond ) if @cond; > $query .= > " GROUP BY s.id, s.borrowernumber, s.date_created, s.last_modified, s.savedsql, s.last_run, s.report_name, s.type, s.notes, s.cache_expiry, s.public, s.report_area, s.report_group, s.report_subgroup, s.mana_id, av_g.lib, av_sg.lib, b.firstname, b.surname"; > $query .= " ORDER by date_created"; > >+ say STDERR $query; >+ > my $result = $dbh->selectall_arrayref( $query, { Slice => {} }, @args ); > > return $result; >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index fe47501ee7..c670d39274 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -85,6 +85,10 @@ 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 $filter; > if ( $input->param("filter_set") or $input->param('clear_filters') ) { > $filter = {}; >@@ -1079,10 +1083,12 @@ if ( $op eq 'list' || $op eq 'convert' ) { > # get list of reports and display them > my $group = $input->param('group'); > my $subgroup = $input->param('subgroup'); >- $filter->{group} = $group; >- $filter->{subgroup} = $subgroup; >+ $filter->{group} = $group; >+ $filter->{subgroup} = $subgroup; >+ $filter->{branchcode} = 'FFL'; > my $reports = get_saved_reports($filter); > my $has_obsolete_reports; >+ > for my $report (@$reports) { > $report->{results} = C4::Reports::Guided::get_results( $report->{id} ); > if ( $report->{savedsql} =~ m|biblioitems| and $report->{savedsql} =~ m|marcxml| ) { >-- >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