Fix errors on Korean translation files
[koha.git] / patroncards / members-search.pl
index 6c27095..8d46417 100755 (executable)
@@ -38,6 +38,7 @@ my $orderby = $cgi->param('orderby') || undef;
 
 my @categories=C4::Category->all;
 my %categories_display;
+my $no_categories;
 
 foreach my $category (@categories) {
     my $hash={
@@ -47,14 +48,25 @@ foreach my $category (@categories) {
     $categories_display{$$category{categorycode}} = $hash;
 }
 
+
 my ($template, $loggedinuser, $cookie) = get_template_and_user({
-                template_name => "patroncards/members-search.tmpl",
+                template_name => "patroncards/members-search.tt",
                 query => $cgi,
                 type => "intranet",
                 authnotrequired => 0,
                 flagsrequired => {borrowers => 1},
                 debug => 1,});
 
+if(scalar(@categories) < 1){ $no_categories = 1; }
+if($no_categories && C4::Context->preference("AddPatronLists")=~/code/){
+    $template->param(no_categories => 1);
+} else {
+    $template->param(
+        categories=>\@categories,
+        category => $category
+    );
+}
+
 $orderby = "surname,firstname" unless $orderby;
 $member =~ s/,//g;   #remove any commas from search string
 $member =~ s/\*/%/g;
@@ -122,6 +134,8 @@ else {
     $template->param( batch_id => $batch_id);
 }
 
+$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
+
 output_html_with_http_headers $cgi, $cookie, $template->output;
 
 __END__