X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=admin%2Fmarctagstructure.pl;h=d3b227d7c1a01f42bae532183cec094f8b2df7fc;hb=d90b4b6a08aa946fd40d1c1a45d1cc4ad64c30e5;hp=a86d78841b34a755b8508249b9d6e7bf7a01f010;hpb=1ee7f449be2ba45c2458d2ac571172ecf58752b2;p=koha_fer diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index a86d78841b..d3b227d7c1 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -52,7 +52,7 @@ my ($template, $loggedinuser, $cookie) query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => {parameters => 1}, + flagsrequired => {parameters => 'parameters_remaining_permissions'}, debug => 1, }); @@ -126,16 +126,8 @@ if ($op eq 'add_form') { $template->param('use_heading_flags_p' => 1); $template->param(liblibrarian => $data->{'liblibrarian'}, libopac => $data->{'libopac'}, - repeatable => CGI::checkbox(-name=>'repeatable', - -checked=> $data->{'repeatable'}?'checked':'', - -value=> 1, - -label => '', - -id=> 'repeatable'), - mandatory => CGI::checkbox(-name => 'mandatory', - -checked => $data->{'mandatory'}?'checked':'', - -value => 1, - -label => '', - -id => 'mandatory'), + repeatable => $data->{'repeatable'}, + mandatory => $data->{'mandatory'}, authorised_value => $authorised_value, frameworkcode => $frameworkcode, ); # FIXME: move checkboxes to presentation layer @@ -149,7 +141,7 @@ if ($op eq 'add_form') { my $repeatable = $input->param('repeatable') ? 1 : 0; my $mandatory = $input->param('mandatory') ? 1 : 0; my $authorised_value = $input->param('authorised_value'); - unless (C4::Context->config('demo') == 1) { + unless (C4::Context->config('demo')) { if ($input->param('modif')) { $sth = $dbh->prepare( "UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" @@ -194,7 +186,7 @@ if ($op eq 'add_form') { ################## 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') == 1) { + unless (C4::Context->config('demo')) { my $sth1 = $dbh->prepare("DELETE FROM marc_tag_structure WHERE tagfield=? AND frameworkcode=?"); my $sth2 = $dbh->prepare("DELETE FROM marc_subfield_structure WHERE tagfield=? AND frameworkcode=?"); $sth1->execute($searchfield, $frameworkcode); @@ -267,7 +259,7 @@ if ($op eq 'add_form') { $row_data{delete} = "$script_name?op=delete_confirm&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; $j=$i; my @internal_loop = (); - while ( ( $results[$i]->{'tagfield'} == $results[$j]->{'tagfield'} ) and ( $j < $cnt ) ) { + while ( ( $j < $cnt ) and ( $results[$i]->{'tagfield'} == $results[$j]->{'tagfield'} ) ) { my %subfield_data; $subfield_data{tagsubfield} = $results[$j]->{'tagsubfield'}; $subfield_data{liblibrarian} = $results[$j]->{'liblibrarian'};