X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=members%2Fguarantor_search.pl;h=9eb60de2cf9d0aadc0baf331c9bd173ad78b1518;hb=26965cf1dfe4a8a34a97280c0aba72a8b59d7e4a;hp=4e0d37a0a43c00220395a5738e2d0a7a9cab0549;hpb=0b6741ad9a9b0729ce79144026dbc1f657609def;p=koha_gimpoz diff --git a/members/guarantor_search.pl b/members/guarantor_search.pl index 4e0d37a0a4..9eb60de2cf 100755 --- a/members/guarantor_search.pl +++ b/members/guarantor_search.pl @@ -16,17 +16,16 @@ # 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; - -#op -use C4::Dates; +use C4::Dates qw/format_date/; use C4::Members; my $input = new CGI; @@ -47,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; @@ -56,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; @@ -63,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 @@ -81,8 +86,13 @@ if ($member ne ''){ 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 @@ -99,7 +109,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; \ No newline at end of file +output_html_with_http_headers $input, $cookie, $template->output;