@@ -, +, @@ patron search. --- .../prog/en/includes/patron-search.inc | 52 ++++++++++++++++++- .../prog/en/modules/members/search.tt | 45 +++++++++++++++- .../prog/en/modules/patroncards/edit-batch.tt | 2 +- members/search.pl | 16 ++++++ 4 files changed, 111 insertions(+), 4 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -56,6 +56,26 @@ [% END %] + [% CASE 'sort1' %] +
  • + + +
  • + [% CASE 'sort2' %] +
  • + + +
  • [% CASE 'search_field' %]
  • @@ -308,11 +328,31 @@ return { "like": start_with + "%" } }, "-and": function(){ + let filters = []; + let f_sort1 = $("#sort1_filter").val(); + if ( f_sort1 ) { + filters.push({ + "me.sort1": f_sort1 + }); + } + let f_sort2 = $("#sort2_filter").val(); + if ( f_sort2 ) { + filters.push({ + "me.sort2": f_sort2 + }); + } + let pattern = $("#search_patron_filter").val(); - if (!pattern) return ""; + if (!pattern) { + if ( filters.length == 0 ) { + return ""; + } + else { + return filters; + } + } let patterns = pattern.split(' ').filter(function(s){ return s.length }); - let filters = []; let search_type = $("#searchtype_filter").val() || "contain"; let search_fields = $("#searchfieldstype_filter").val(); if ( !search_fields ) { @@ -728,6 +768,12 @@ if ( $("#branchcode_filter").val() ) { searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text(); } + if ( $("#sort1_filter").val() ) { + searched += _(" with sort1 ") + $("#sort1_filter").find("option:selected").text(); + } + if ( $("#sort2_filter").val() ) { + searched += _(" with sort2 ") + $("#sort2_filter").find("option:selected").text(); + } $("#searchpattern").text(searched); $("#searchpattern").parent().show(); } @@ -785,6 +831,8 @@ $("#searchtype_filter option[value='contain']").prop("selected", true); $("#categorycode_filter option:first").prop("selected", true); $("#branchcode_filter option:first").prop("selected", true); + $("#sort1_filter option:first").prop("selected", true); + $("#sort2_filter option:first").prop("selected", true); $("#firstletter_filter").val(''); $("#search_patron_filter").val(''); /* remove any search string added by firstletter search */ --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt @@ -17,10 +17,24 @@