From 99e8b01e9a38901566440300ed15b54a55a348cc Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Wed, 10 Nov 2010 08:45:33 -0500 Subject: [PATCH] Bug 5003: Can not search for organisation by name Rebased to current HEAD, small error fixed. Should also apply to 3.2 Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack (cherry picked from commit 863830f3f91110bdbd930755139f844870234ccc) Signed-off-by: Chris Nighswonger --- .../prog/en/modules/members/guarantor_search.tmpl | 1 + .../prog/en/modules/members/memberentrygen.tmpl | 4 ++-- members/guarantor_search.pl | 12 +++++++++--- members/memberentry.pl | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tmpl index 7fa5099891..13fb052c24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tmpl @@ -48,6 +48,7 @@

Search for guarantor

+ " /> " class="focus" /> Ordered by + ');" /> - + ');" /> diff --git a/members/guarantor_search.pl b/members/guarantor_search.pl index d25d71f59e..cbd958d1dc 100755 --- a/members/guarantor_search.pl +++ b/members/guarantor_search.pl @@ -46,6 +46,7 @@ my $theme = $input->param('theme') || "default"; 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; @@ -55,6 +56,11 @@ if ($member eq ''){ $template->param(results=>1); } +my $search_category = 'A'; +if ($category_type eq 'P'){ + $search_category = 'I'; +} + my ($count,$results); my @resultsdata; my $background = 0; @@ -62,11 +68,11 @@ my $background = 0; if ($member ne ''){ if(length($member) == 1) { - ($count,$results)=SearchMember($member,$orderby,"simple",'A'); + ($count,$results)=SearchMember($member,$orderby,"simple",$search_category); } else { - ($count,$results)=SearchMember($member,$orderby,"advanced",'A'); + ($count,$results)=SearchMember($member,$orderby,"advanced",$search_category); } for (my $i=0; $i < $count; $i++){ #find out stats @@ -101,7 +107,7 @@ if ($member ne ''){ $template->param( member => $member, numresults => $count, - + category_type => $category_type, resultsloop => \@resultsdata ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/memberentry.pl b/members/memberentry.pl index eacb2fff09..c25f7c90de 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -648,6 +648,7 @@ $template->param( dateformat => C4::Dates->new()->visual(), C4::Context->preference('dateformat') => 1, check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function + category_type =>$category_type, modify => $modify, nok => $nok,#flag to konw if an error CGIbranch => $CGIbranch, -- 2.39.5