my $repeatable =$input->param('repeatable');
my $mandatory =$input->param('mandatory');
my $authorised_value =$input->param('authorised_value');
- $sth->execute($tagfield,
- $liblibrarian,
- $libopac,
- $repeatable?1:0,
- $mandatory?1:0,
- $authorised_value
- );
+ unless (C4::Context->config('demo') eq 1) {
+ $sth->execute($tagfield,
+ $liblibrarian,
+ $libopac,
+ $repeatable?1:0,
+ $mandatory?1:0,
+ $authorised_value
+ );
+ }
$sth->finish;
print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=marctagstructure.pl?tagfield=$tagfield\"></html>";
exit;
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ($op eq 'delete_confirmed') {
my $dbh = C4::Context->dbh;
- $dbh->do("delete from marc_tag_structure where $pkfield='$searchfield'");
- $dbh->do("delete from marc_subfield_structure where tagfield='$searchfield'");
+ unless (C4::Context->config('demo') eq 1) {
+ $dbh->do("delete from marc_tag_structure where $pkfield='$searchfield'");
+ $dbh->do("delete from marc_subfield_structure where tagfield='$searchfield'");
+ }
# END $OP eq DELETE_CONFIRMED
################## DEFAULT ##################################
} else { # DEFAULT
}
if ($op eq 'update_and_reedit') {
- foreach ($input->param) {
- warn "$_: ".$input->param($_)."\n";
- }
- my $value='';
- if (my $currentorder=$input->param('currentorder')) {
- my @currentorder=split /\|/, $currentorder;
- my $orderchanged=0;
- foreach my $param ($input->param) {
- if ($param=~m#up-(\d+).x#) {
- my $temp=$currentorder[$1];
- $currentorder[$1]=$currentorder[$1-1];
- $currentorder[$1-1]=$temp;
- $orderchanged=1;
- last;
- } elsif ($param=~m#down-(\d+).x#) {
- my $temp=$currentorder[$1];
- $currentorder[$1]=$currentorder[$1+1];
- $currentorder[$1+1]=$temp;
- $orderchanged=1;
- last;
- }
+ foreach ($input->param) {
}
- $value=join ' ', @currentorder;
- if ($orderchanged) {
- $op='add_form';
- $template->param(script_name => $script_name,
- $op => 1); # we show only the TMPL_VAR names $op
- } else {
- $op='';
- $searchfield='';
- $template->param(script_name => $script_name,
- else => 1); # we show only the TMPL_VAR names $op
+ my $value='';
+ if (my $currentorder=$input->param('currentorder')) {
+ my @currentorder=split /\|/, $currentorder;
+ my $orderchanged=0;
+ foreach my $param ($input->param) {
+ if ($param=~m#up-(\d+).x#) {
+ my $temp=$currentorder[$1];
+ $currentorder[$1]=$currentorder[$1-1];
+ $currentorder[$1-1]=$temp;
+ $orderchanged=1;
+ last;
+ } elsif ($param=~m#down-(\d+).x#) {
+ my $temp=$currentorder[$1];
+ $currentorder[$1]=$currentorder[$1+1];
+ $currentorder[$1+1]=$temp;
+ $orderchanged=1;
+ last;
+ }
+ }
+ $value=join ' ', @currentorder;
+ if ($orderchanged) {
+ $op='add_form';
+ $template->param(script_name => $script_name,
+ $op => 1); # we show only the TMPL_VAR names $op
+ } else {
+ $op='';
+ $searchfield='';
+ $template->param(script_name => $script_name,
+ else => 1); # we show only the TMPL_VAR names $op
+ }
}
- }
- my $dbh = C4::Context->dbh;
- my $query="select * from systempreferences where variable=?";
- my $sth=$dbh->prepare($query);
- $sth->execute($input->param('variable'));
- if ($sth->rows) {
- my $query = "update systempreferences set value=?,explanation=? where variable=?";
- my $sth=$dbh->prepare($query);
- $sth->execute($value, $input->param('explanation'), $input->param('variable'));
- $sth->finish;
+ my $dbh = C4::Context->dbh;
+ my $query="select * from systempreferences where variable=?";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($input->param('variable'));
+ if ($sth->rows) {
+ unless (C4::Context->config('demo') eq 1) {
+ my $query = "update systempreferences set value=?,explanation=? where variable=?";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($value, $input->param('explanation'), $input->param('variable'));
+ $sth->finish;
+ }
} else {
- my $query = "insert into systempreferences (variable,value,explanation) values (?,?,?)";
- my $sth=$dbh->prepare($query);
- $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
- $sth->finish;
- }
- $sth->finish;
+ unless (C4::Context->config('demo') eq 1) {
+ my $query = "insert into systempreferences (variable,value,explanation) values (?,?,?)";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
+ $sth->finish;
+ }
+ }
+ $sth->finish;
}
my $sth=$dbh->prepare($query);
$sth->execute($input->param('variable'));
if ($sth->rows) {
- my $query = "update systempreferences set value=?,explanation=? where variable=?";
- my $sth=$dbh->prepare($query);
- $sth->execute($input->param('value'), $input->param('explanation'), $input->param('variable'));
- $sth->finish;
+ unless (C4::Context->config('demo') eq 1) {
+ my $query = "update systempreferences set value=?,explanation=? where variable=?";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($input->param('value'), $input->param('explanation'), $input->param('variable'));
+ $sth->finish;
+ }
} else {
- my $query = "insert into systempreferences (variable,value,explanation) values (?,?,?)";
- my $sth=$dbh->prepare($query);
- $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
- $sth->finish;
+ unless (C4::Context->config('demo') eq 1) {
+ my $query = "insert into systempreferences (variable,value,explanation) values (?,?,?)";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
+ $sth->finish;
+ }
}
$sth->finish;
################## DELETE_CONFIRM ##################################