X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=admin%2Fmarctagstructure.pl;h=0326b93b2c5b8bf81d738f7eb525dc824a2e2b6d;hb=2870c6bd851e967d08d9e4613095ebdfdb8a4c01;hp=a20f77c13289e0ffcdcb6e416c9b79155ae9dbf5;hpb=a75a9264e19fe658f475c8a8ee40e0b1ca53dbd2;p=koha_fer diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index a20f77c132..0326b93b2c 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, }); @@ -118,12 +118,12 @@ if ($op eq 'add_form') { if ($searchfield) { $template->param(searchfield => $searchfield); $template->param(action => "Modify tag"); - $template->param('heading-modify-tag-p' => 1); + $template->param('heading_modify_tag_p' => 1); } else { $template->param(action => "Add tag"); - $template->param('heading-add-tag-p' => 1); + $template->param('heading_add_tag_p' => 1); } - $template->param('use-heading-flags-p' => 1); + $template->param('use_heading_flags_p' => 1); $template->param(liblibrarian => $data->{'liblibrarian'}, libopac => $data->{'libopac'}, repeatable => CGI::checkbox(-name=>'repeatable', @@ -149,7 +149,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 +194,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 +267,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'}; @@ -348,6 +348,7 @@ sub StringSearch { # sub duplicate_framework { my ($newframeworkcode,$oldframeworkcode) = @_; + my $dbh = C4::Context->dbh; my $sth = $dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where frameworkcode=?"); $sth->execute($oldframeworkcode); my $sth_insert = $dbh->prepare("insert into marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) values (?,?,?,?,?,?,?)");