X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=admin%2Fauth_subfields_structure.pl;h=321e54c1ac68af31e2de0254a7dbf86759071f09;hb=5d6c092921919526ade501facb1220f8a108a08f;hp=432d49667fa4bec4fb046fd5adea3d686e554b9f;hpb=03890c90ac41f66b2de04d0280e2e96a0d2e8be8;p=koha_fer diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index 432d49667f..321e54c1ac 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -57,7 +57,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { parameters => 1 }, + flagsrequired => { parameters => 'parameters_remaining_permissions' }, debug => 1, } ); @@ -139,41 +139,15 @@ if ($op eq 'add_form') { while ($data =$sth->fetchrow_hashref) { my %row_data; # get a fresh hash for the row data - $row_data{tab} = CGI::scrolling_list(-name=>'tab', - -id=>"tab$i", - -values => - [ '-1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ], - -labels => { - '-1' => 'ignore', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - }, - -default=>$data->{'tab'}, - -size=>1, - -tabindex=>'', - -multiple=>0, - ); - $row_data{ohidden} = CGI::scrolling_list(-name=>'ohidden', - -id=>"ohidden$i", - #-values=>['0','1','2'], - #-labels => {'0'=>'Show','1'=>'Show Collapsed', - # '2' =>'Hide', - # }, - -values=>['0','-5'], - -labels => {'0'=>'Show All','-5'=>'Hide All',}, - -default=>$data->{'hidden'}, - #-default=>"-5", - -size=>1, - -multiple=>0, - ); + $row_data{defaultvalue} = $data->{defaultvalue}; + $row_data{tab} = { + id => "tab$i", + default => $data->{'tab'}, + }; + $row_data{ohidden} = { + id => "ohidden$i", + default => $data->{'hidden'} + }; #$row_data{ihidden} = CGI::scrolling_list(-name=>'ihidden', # -id=>"ihidden$i", # -values=>['0','1','2'], @@ -386,10 +360,10 @@ if ($op eq 'add_form') { $template->param(tagfield => "$input->param('tagfield')"); # my $sth=$dbh->prepare("replace auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl) # values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); - my $sth_insert = $dbh->prepare("insert into auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl) - values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); - my $sth_update = $dbh->prepare("update auth_subfield_structure set authtypecode=?, tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, frameworkcode=?, value_builder=?, hidden=?, isurl=? - where authtypecode=? and tagfield=? and tagsubfield=?"); + my $sth_insert = $dbh->prepare("insert into auth_subfield_structure (authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl,defaultvalue) + values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); + my $sth_update = $dbh->prepare("update auth_subfield_structure set authtypecode=?, tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, frameworkcode=?, value_builder=?, hidden=?, isurl=?, defaultvalue=? + where authtypecode=? and tagfield=? and tagsubfield=?"); my @tagsubfield = $input->param('tagsubfield'); my @liblibrarian = $input->param('liblibrarian'); my @libopac = $input->param('libopac'); @@ -404,6 +378,7 @@ if ($op eq 'add_form') { my $authtypecode = $input->param('authtypecode'); my @frameworkcodes = $input->param('frameworkcode'); my @value_builder =$input->param('value_builder'); + my @defaultvalue = $input->param('defaultvalue'); for (my $i=0; $i<= $#tagsubfield ; $i++) { my $tagfield =$input->param('tagfield'); my $tagsubfield =$tagsubfield[$i]; @@ -418,6 +393,7 @@ if ($op eq 'add_form') { my $authorised_value =$authorised_values[$i]; my $frameworkcode =$frameworkcodes[$i]; my $value_builder=$value_builder[$i]; + my $defaultvalue = $defaultvalue[$i]; #my $hidden = $ohidden[$i].$ihidden[$i].$ehidden[$i]; #collate from 3 hiddens; my $hidden = $ohidden[$i]; #collate from 3 hiddens; my $isurl = $input->param("isurl$i")?1:0; @@ -440,6 +416,7 @@ if ($op eq 'add_form') { $value_builder, $hidden, $isurl, + $defaultvalue, ( $authtypecode, $tagfield, @@ -463,6 +440,7 @@ if ($op eq 'add_form') { $value_builder, $hidden, $isurl, + $defaultvalue, ); } }