Bug 33146: Unit tests
[koha-ffzg.git] / members / search.pl
index 630f509..c3d80a2 100755 (executable)
 use Modern::Perl;
 
 use CGI qw ( -utf8 );
+use C4::Context;
 use C4::Auth qw( get_template_and_user );
 use C4::Output qw( output_html_with_http_headers );
+use Koha::Patron::Attribute::Types;
 
 my $input = CGI->new;
 
@@ -34,11 +36,18 @@ my ( $template, $loggedinuser, $cookie, $staff_flags ) = get_template_and_user(
 my $referer = $input->referer();
 
 my @columns = split ',', $input->param('columns');
+my $callback = $input->param('callback');
+my $selection_type = $input->param('selection_type') || 'select';
+my $filter = $input->param('filter');
 
 $template->param(
-    view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results",
-    columns => \@columns,
-    selection_type => 'select',
-    alphabet        => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ),
+    view           => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results",
+    callback       => $callback,
+    columns        => \@columns,
+    filter         => $filter,
+    selection_type => $selection_type,
+    attribute_type_codes => ( C4::Context->preference('ExtendedPatronAttributes')
+        ? [ Koha::Patron::Attribute::Types->search( { staff_searchable => 1 } )->get_column('code') ]
+        : [] ),
 );
 output_html_with_http_headers( $input, $cookie, $template->output );