search on MARC datas.
[koha_fer] / memberentry.pl
index 4a6d469..98660f0 100755 (executable)
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use C4::Context;
 use C4::Output;
+use C4::Charset;
 use CGI;
 use C4::Search;
 use C4::Koha;
@@ -33,9 +35,14 @@ use HTML::Template;
 
 my $input = new CGI;
 
-my $theme = $input->param('theme'); # only used if allowthemeoverride is set
-my %tmpldata = pathtotemplate ( template => 'memberentry.tmpl', theme => $theme );
-my $template = HTML::Template->new(filename => $tmpldata{'path'}, die_on_bad_params => 0);
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "members/memberentry.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
 
 my $member=$input->param('bornum');
 if ($member eq ''){
@@ -130,7 +137,7 @@ if ($delete){
   my $ethnicitycategoriescount=$#{$categories};
   my $ethcatpopup;
   if ($ethnicitycategoriescount>=0) {
-       $ethcatpopup = popup_menu(-name=>'ethnicity',
+       $ethcatpopup = CGI::popup_menu(-name=>'ethnicity',
                                -values=>$categories,
                                -default=>$data->{'ethnicity'},
                                -labels=>$labels);
@@ -191,8 +198,8 @@ if ($delete){
   foreach (keys(%flags)) {
     my $key = $_;
     my %row =  ('key'   => $key,
-               'name'  => $flags{$key}[0],
-               'html'  => $flags{$key}[1]);
+               'name'  => $flags{$key}[0],
+               'html'  => $flags{$key}[1]);
     if ($data->{$key}) {
       $row{'yes'}=' checked';
       $row{'no'}='';
@@ -207,8 +214,7 @@ if ($delete){
     $template->param( modify => 1 );
   }
 
-  $template->param( startmenumember => join ('', startmenu('member')),
-                       endmenumember   => join ('', endmenu('member')),
+  $template->param( 
                        member          => $member,
                        firstname       => $data->{'firstname'},
                        surname         => $data->{'surname'},
@@ -216,7 +222,7 @@ if ($delete){
                        initials        => $data->{'initials'},
                        ethcatpopup     => $ethcatpopup,
                        catcodepopup    => $catcodepopup,
-                       streetaddress   => $data->{'physstreet'},
+                       streetaddress   => $data->{'streetaddress'},
                        streetcity      => $data->{'streetcity'},
                        city            => $data->{'city'},
                        phone           => $data->{'phone'},
@@ -236,7 +242,10 @@ if ($delete){
                        cardnumber      => $cardnumber,
                        dateofbirth     => $data->{'dateofbirth'});
 
-  print "Content-Type: text/html\n\n", $template->output;
+print $input->header(
+    -type => guesstype($template->output),
+    -cookie => $cookie
+),$template->output;
 
 
 }