Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 87 lines (71 sloc) 1.938 kb
# script to edit a member's flags
# Written by Steve Tonnesen
# July 26, 2002 (my birthday!)
use strict;
use C4::Search;
use CGI;
use C4::Output;
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;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "member-flags.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {borrowers => 1},
debug => 1,
my $member=$input->param('member');
my %env;
my %member2;
my $issues=currentissues(\%env,\%member2);
my $i=0;
foreach (sort keys %$issues) {
if ($input->param('newflags')) {
my $dbh=C4::Context->dbh();
my $flags=0;
foreach ($input->param) {
if (/flag-(\d+)/) {
my $flag=$1;
my $sth=$dbh->prepare("update borrowers set flags=? where borrowernumber=?");
$sth->execute($flags, $member);
print $input->redirect("/cgi-bin/koha/$member");
} else {
my ($bor,$flags,$accessflags)=getpatroninformation(\%env, $member,'');
my $dbh=C4::Context->dbh();
my $sth=$dbh->prepare("select bit,flag,flagdesc from userflags order by bit");
my @loop;
while (my ($bit, $flag, $flagdesc) = $sth->fetchrow) {
my $checked='';
if ($accessflags->{$flag}) {
my %row = ( bit => $bit,
flag => $flag,
checked => $checked,
flagdesc => $flagdesc );
push @loop, \%row;
$template->param(member => $member,
surname => $bor->{'surname'},
firstname => $bor->{'firstname'},
loop => \@loop);
output_html_with_http_headers $input, $cookie, $template->output;
Jump to Line
Something went wrong with that request. Please try again.