Removing +1y expiry time from cookies so that cookies expire when the browser
[koha.git] / moremember.pl
index a4cd034..4fbd333 100755 (executable)
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use C4::Context;
 use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Interface::CGI::Template;
 use CGI;
 use C4::Search;
 use Date::Manip;
@@ -46,9 +49,14 @@ my $dbh = C4::Context->dbh;
 
 my $input = new CGI;
 
-my $theme = $input->param('theme'); # only used if allowthemeoverride is set
-my %tmpldata = pathtotemplate ( template => 'moremember.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/moremember.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {borrowers => 1},
+                            debug => 1,
+                            });
 
 my $bornum=$input->param('bornum');
 
@@ -62,6 +70,8 @@ $data->{'dateofbirth'} = slashifyDate($data->{'dateofbirth'});
 
 $data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'});
 
+$data->{&expand_sex_into_predicate($data->{'sex'})} = 1;
+
 if ($data->{'categorycode'} eq 'C'){
     my $data2=borrdata('',$data->{'guarantor'});
     $data->{'streetaddress'}=$data2->{'streetaddress'};
@@ -190,11 +200,10 @@ for (my $i=0;$i<$rescount;$i++){
 }
 
 $template->param($data);
-$template->param(startmenumember => join('', startmenu('member')),
-                endmenumember   => join('', endmenu('member')),
+$template->param(
                 bornum          => $bornum,
                 accountloop     => \@accountdata,
                 issueloop       => \@issuedata,
                 reserveloop     => \@reservedata);
 
-print "Content-Type: text/html\n\n", $template->output;
+output_html_with_http_headers $input, $cookie, $template->output;