- [% PROCESS patron_search_filters categories => categories, libraries => libraries, filters => ['branch', 'category'], search_filter => searchmember %]
+ [% PROCESS patron_search_filters categories => categories, libraries => libraries, sort1 => sort1, sort2 => sort2, filters => form_filters, search_filter => searchmember %]
+
+
[% PROCESS patron_search_table table_id => 'memberresultst' columns => columns %]
+
@@ -28,6 +42,35 @@
[% MACRO jsinclude BLOCK %]
+
+
[% PROCESS patron_search_js table_id => 'memberresultst', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, filter => filter, actions => [selection_type], preview_on_name_click => 1, callback => callback %]
[% END %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt
@@ -190,7 +190,7 @@
function Add() {
var bor_nums = document.getElementById("bor_num_list");
if (bor_nums.value == '') {
- window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,category,branch,dateexpiry,borrowernotes,action&selection_type=add",
+ window.open("/cgi-bin/koha/members/search.pl?columns=checkbox,cardnumber,name,category,branch,dateexpiry,borrowernotes,action&selection_type=add&filter_sort1=1&filter_sort2=1",
'PatronPopup',
'width=1024,height=768,location=yes,toolbar=no,'
+ 'scrollbars=yes,resize=yes');
--- a/members/search.pl
+++ a/members/search.pl
@@ -19,6 +19,7 @@ use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Context;
+use List::MoreUtils qw(uniq);
use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers );
use Koha::Patron::Attribute::Types;
@@ -39,6 +40,18 @@ my @columns = split ',', $input->param('columns');
my $callback = $input->param('callback');
my $selection_type = $input->param('selection_type') || 'select';
my $filter = $input->param('filter');
+my @form_filters = ('branch','category');
+
+my $sort_filter = { ( C4::Context->only_my_library ? (branchcode => C4::Context->userenv->{branch}) : () ) };
+my ( @sort1, @sort2 );
+if ( $input->param('filter_sort1') ) {
+ @sort1 = sort {$a cmp $b} uniq( Koha::Patrons->search($sort_filter)->get_column('sort1') );
+ push @form_filters, 'sort1';
+}
+if ( $input->param('filter_sort2') ) {
+ @sort2 = sort {$a cmp $b} uniq( Koha::Patrons->search($sort_filter)->get_column('sort2') );
+ push @form_filters, 'sort2';
+}
$template->param(
view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results",
@@ -49,5 +62,8 @@ $template->param(
attribute_type_codes => ( C4::Context->preference('ExtendedPatronAttributes')
? [ Koha::Patron::Attribute::Types->search( { staff_searchable => 1 } )->get_column('code') ]
: [] ),
+ form_filters => \@form_filters,
+ sort1 => \@sort1,
+ sort2 => \@sort2,
);
output_html_with_http_headers( $input, $cookie, $template->output );
--