my $op = $input->param('op');
$searchfield=~ s/\,//g;
my ($template, $borrowernumber, $cookie)
- = get_template_and_user({template_name => "parameters/authtypes.tmpl",
+ = get_template_and_user({template_name => "admin/authtypes.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
my $data;
if ($authtypecode) {
my $dbh = C4::Context->dbh;
- my $sth=$dbh->prepare("select authtypecode,authtypetext,auth_tag_to_report from auth_types where authtypecode=?");
+ my $sth=$dbh->prepare("select * from auth_types where authtypecode=?");
$sth->execute($authtypecode);
$data=$sth->fetchrow_hashref;
$sth->finish;
}
+ warn "=> $data->{'authtypetext'} : ".$data->{'summary'};
$template->param(authtypecode => $authtypecode,
authtypetext => $data->{'authtypetext'},
auth_tag_to_report => $data->{'auth_tag_to_report'},
+ summary => $data->{'summary'},
);
;
# END $OP eq ADD_FORM
# called by add_form, used to insert/modify data in DB
} elsif ($op eq 'add_validate') {
my $dbh = C4::Context->dbh;
- my $sth=$dbh->prepare("replace auth_types (authtypecode,authtypetext,auth_tag_to_report) values (?,?,?)");
- $sth->execute($input->param('authtypecode'),$input->param('authtypetext'),$input->param('auth_tag_to_report'));
+ my $sth=$dbh->prepare("replace auth_types (authtypecode,authtypetext,auth_tag_to_report,summary) values (?,?,?,?)");
+ $sth->execute($input->param('authtypecode'),$input->param('authtypetext'),$input->param('auth_tag_to_report'),$input->param('summary'));
$sth->finish;
print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authtypes.pl\"></html>";
exit;
#start the page and read in includes
my $dbh = C4::Context->dbh;
- # Check both categoryitem and biblioitems, see Bug 199
my $total = 0;
for my $table ('auth_tag_structure') {
my $sth=$dbh->prepare("select count(*) as total from $table where authtypecode=?");
$sth->finish;
}
- my $sth=$dbh->prepare("select authtypecode,authtypetext from authtypes where authtypecode=?");
+ my $sth=$dbh->prepare("select * from auth_types where authtypecode=?");
$sth->execute($authtypecode);
my $data=$sth->fetchrow_hashref;
$sth->finish;
$template->param(authtypecode => $authtypecode,
authtypetext => $data->{'authtypetext'},
+ summary => $data->{'summary'},
total => $total);
# END $OP eq DELETE_CONFIRM
################## DELETE_CONFIRMED ##################################
#start the page and read in includes
my $dbh = C4::Context->dbh;
my $authtypecode=uc($input->param('authtypecode'));
- my $sth=$dbh->prepare("delete from auth_types where authtypecode=?");
+ my $sth=$dbh->prepare("delete from auth_tag_structure where authtypecode=?");
+ $sth->execute($authtypecode);
+ $sth=$dbh->prepare("delete from auth_subfield_structure where authtypecode=?");
+ $sth->execute($authtypecode);
+ $sth=$dbh->prepare("delete from auth_types where authtypecode=?");
$sth->execute($authtypecode);
$sth->finish;
print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authtypes.pl\"></html>";
$row_data{authtypecode} = $results->[$i]{'authtypecode'};
$row_data{authtypetext} = $results->[$i]{'authtypetext'};
$row_data{auth_tag_to_report} = $results->[$i]{'auth_tag_to_report'};
+ $row_data{summary} = $results->[$i]{'summary'};
push(@loop_data, \%row_data);
}
$template->param(loop => \@loop_data);