my $tagfield = $input->param('tagfield');
my $tagsubfield = $input->param('tagsubfield');
my $authtypecode = $input->param('authtypecode');
-my $offset = $input->param('offset') || 0;
+my $offset = $input->param('offset');
+$offset = 0 if not defined $offset or $offset < 0;
my $op = $input->param('op') || '';
my $script_name = "/cgi-bin/koha/admin/auth_subfields_structure.pl";
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { parameters => 'parameters_remaining_permissions' },
+ flagsrequired => { parameters => 'manage_marc_frameworks' },
debug => 1,
}
);
my $hidden = $ohidden[$i]; #collate from 3 hiddens;
my $isurl = $input->param("isurl$i")?1:0;
if ($liblibrarian) {
- unless (C4::Context->config('demo') or C4::Context->config('demo') eq 1) {
if (auth_subfield_structure_exists($authtypecode, $tagfield, $tagsubfield)) {
$sth_update->execute(
$authtypecode,
$defaultvalue,
);
}
- }
}
}
print $input->redirect("/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=$tagfield&authtypecode=$authtypecode");
################## DELETE_CONFIRMED ##################################
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ($op eq 'delete_confirmed') {
- unless (C4::Context->config('demo') or C4::Context->config('demo') eq 1) {
- my $sth=$dbh->prepare("delete from auth_subfield_structure where tagfield=? and tagsubfield=? and authtypecode=?");
- $sth->execute($tagfield,$tagsubfield,$authtypecode);
- }
+ my $sth=$dbh->prepare("delete from auth_subfield_structure where tagfield=? and tagsubfield=? and authtypecode=?");
+ $sth->execute($tagfield,$tagsubfield,$authtypecode);
print $input->redirect("/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=$tagfield&authtypecode=$authtypecode");
exit;
# END $OP eq DELETE_CONFIRMED
$row_data{value_builder} = $results->[$i]{'value_builder'};
$row_data{hidden} = $results->[$i]{'hidden'} if($results->[$i]{'hidden'} gt "000") ;
$row_data{isurl} = $results->[$i]{'isurl'};
- $row_data{delete} = "$script_name?op=delete_confirm&tagfield=$tagfield&tagsubfield=".$results->[$i]{'tagsubfield'}."&authtypecode=$authtypecode";
if ($row_data{tab} eq -1) {
$row_data{subfield_ignored} = 1;
}