# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
+#use warnings; FIXME - Bug 2505
use C4::Auth;
use C4::Output;
use CGI;
my $member=$input->param('member');
my $orderby=$input->param('orderby');
+my $category_type=$input->param('category_type');
$orderby = "surname,firstname" unless $orderby;
$member =~ s/,//g; #remove any commas from search string
$member =~ s/\*/%/g;
$template->param(results=>1);
}
+my $search_category = 'A';
+if ($category_type eq 'P'){
+ $search_category = 'I';
+}
+
my ($count,$results);
my @resultsdata;
my $background = 0;
if ($member ne ''){
- if(length($member) == 1)
- {
- ($count,$results)=SearchMember($member,$orderby,"simple",'A');
- }
- else
- {
- ($count,$results)=SearchMember($member,$orderby,"advanced",'A');
- }
+ $results = Search({''=>$member, category_type=>$search_category},$orderby);
+ $count = $results ? @$results : 0;
+
for (my $i=0; $i < $count; $i++){
#find out stats
my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowerid'});
surname => $results->[$i]{'surname'},
firstname => $results->[$i]{'firstname'},
categorycode => $results->[$i]{'categorycode'},
+ streetnumber => $results->[$i]{'streetnumber'},
address => $results->[$i]{'address'},
+ address2 => $results->[$i]{'address2'},
city => $results->[$i]{'city'},
+ state => $results->[$i]{'state'},
zipcode => $results->[$i]{'zipcode'},
+ country => $results->[$i]{'country'},
branchcode => $results->[$i]{'branchcode'},
guarantorinfo =>$guarantorinfo,
#op
$template->param(
member => $member,
numresults => $count,
-
+ category_type => $category_type,
resultsloop => \@resultsdata );
output_html_with_http_headers $input, $cookie, $template->output;