@@ -, +, @@ a dropdown in Guided Reports --------- -- all should pass, this confirms that both C4/Reports/Guided.pm and this test file work. -- no need to change Report group or Report is public or Notes or Type biblio.biblionumber,'\">',biblio.biblionumber,'') AS BiblioNumbers, title, author, frameworkcode -- The parameter entry page should have a drop down of framework codes. -- The displayed SQL should have a "frameworkcode=" portion matching the selected framework. --- C4/Reports/Guided.pm | 3 ++- reports/guided_reports.pl | 12 +++++++++++- t/db_dependent/ReportsGuided.t | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) --- a/C4/Reports/Guided.pm +++ a/C4/Reports/Guided.pm @@ -962,7 +962,8 @@ sub GetReservedAuthorisedValues { 'branches', 'itemtypes', 'cn_source', - 'categorycode' ); + 'categorycode', + 'biblio_framework' ); return \%reserved_authorised_values; } --- a/reports/guided_reports.pl +++ a/reports/guided_reports.pl @@ -29,7 +29,7 @@ use C4::Output; use C4::Dates qw/format_date/; use C4::Debug; use C4::Branch; # XXX subfield_is_koha_internal_p -use C4::Koha qw/IsAuthorisedValueCategory/; +use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/; =head1 NAME @@ -644,6 +644,16 @@ elsif ($phase eq 'Run this report'){ $authorised_lib{$itemtype} = $description; } } + elsif ( $authorised_value eq "biblio_framework" ) { + my $frameworks = GetFrameworksLoop(); + my $default_source = ''; + push @authorised_values,$default_source; + $authorised_lib{$default_source} = 'Default'; + foreach my $framework (@$frameworks) { + push @authorised_values, $framework->{value}; + $authorised_lib{$framework->{value}} = $framework->{description}; + } + } elsif ( $authorised_value eq "cn_source" ) { my $class_sources = GetClassSources(); my $default_source = C4::Context->preference("DefaultClassificationSource"); --- a/t/db_dependent/ReportsGuided.t +++ a/t/db_dependent/ReportsGuided.t @@ -44,7 +44,8 @@ $koha->mock( 'branches' => 1, 'itemtypes' => 1, 'cn_source' => 1, - 'categorycode' => 1 + 'categorycode' => 1, + 'biblio_framework' => 1, ); my $reserved_authorised_values = GetReservedAuthorisedValues(); --