From 76df76e7a41756114778227bad86bd8240327000 Mon Sep 17 00:00:00 2001 From: wolfpac444 Date: Sun, 13 Apr 2003 04:08:56 +0000 Subject: [PATCH] Fixed bug #340 and templated member-flags.tmpl --- .../default/en/member-flags.tmpl | 28 +++++++++++ member-flags.pl | 47 ++++++++++--------- 2 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/default/en/member-flags.tmpl diff --git a/koha-tmpl/intranet-tmpl/default/en/member-flags.tmpl b/koha-tmpl/intranet-tmpl/default/en/member-flags.tmpl new file mode 100644 index 0000000000..3ae0b2b338 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/member-flags.tmpl @@ -0,0 +1,28 @@ + + +

,

+
+ > + + + + + + + + + + +
FLAGS
+ > + + + + +
+ +

+ +

+ + diff --git a/member-flags.pl b/member-flags.pl index 836273d8ec..1f67dc929d 100755 --- a/member-flags.pl +++ b/member-flags.pl @@ -13,13 +13,25 @@ use C4::Auth; use C4::Context; use C4::Circulation::Circ2; #use C4::Acquisitions; +use HTML::Template; +use C4::Interface::CGI::Output; my $input = new CGI; my $flagsrequired; $flagsrequired->{borrowers}=1; $flagsrequired->{permissions}=1; -my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired); + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "member-flags.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + debug => 1, + }); + + + my $member=$input->param('member'); my %env; @@ -31,6 +43,7 @@ my $i=0; foreach (sort keys %$issues) { $i++; } + if ($input->param('newflags')) { my $dbh=C4::Context->dbh(); my $flags=0; @@ -49,32 +62,24 @@ if ($input->param('newflags')) { my $dbh=C4::Context->dbh(); my $sth=$dbh->prepare("select bit,flag,flagdesc from userflags order by bit"); $sth->execute; - my $flagtext=''; + my @loop; while (my ($bit, $flag, $flagdesc) = $sth->fetchrow) { my $checked=''; if ($accessflags->{$flag}) { $checked='checked'; } - $flagtext.="$flag$flagdesc\n"; + my %row = ( bit => $bit, + flag => $flag, + checked => $checked, + flagdesc => $flagdesc ); + push @loop, \%row; } - print $input->header(-cookie => $cookie); - print startpage(); - print startmenu('member'); - print qq| -

$bor->{'surname'}, $bor->{'firstname'}

-
- - - - - $flagtext -
FLAGS
-

- -

- |; + $template->param(member => $member, + surname => $bor->{'surname'}, + firstname => $bor->{'firstname'}, + loop => \@loop); + + output_html_with_http_headers $input, $cookie, $template->output; - print endmenu('member'); - print endpage(); } -- 2.39.5