From 990c0b561e31c33ab24115e9d11312095519afda Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Sat, 19 Jul 2014 20:58:17 -0300 Subject: [PATCH] [PASSED QA] Bug 12614: Remove CGI::scrolling_list from auth_subfields_structure.pl This patch removes all instances on this file. Even removes some commented out instances. Also re-enable editor feature to show/change kohafield value, can't find when or why it was removed. Up to QA or RM for consideration, simply to remove. But is strange to have a non editable field on auth frameworks. To test: 1. Apply the patch 2. Go to Administration > Authority types 3. Clic MARC structure of any auth fw 4. Clic subfield on any tag, e.g. 031 5. Clic 'Edit subfields' button Now the tests proper 6. 'Help input' box (editor bottom): Eight(8) scrolling_list removed, they use to feed the four pulldowns, so check each one 'Koha field' is new (for me at last) 'Authorised value', 'Thesaurus' (is this valid/useful here?) 'Plugin' There is a difference between existing subtags and a new subtag, the 'id' of the pulldowns (so the 8 scrolling list removed) Check assign/remove/save/load values, search for regressions If you edit subtag 942, it has a value on kohafield (default fw) I think that this box could be prettified with fixed width for pulldowns. 7. No more functional tests, there are 4 scrolling_list removed that are commented (removed also commented code on tt file), and two instances that are similar to previously removed instances, evidently with no effect. Signed-off-by: Jonathan Druart Not sure about the new Koha field entry... All works as expected. Signed-off-by: Katrin Fischer All works as expected. About Koha field: I think it makes sense to have it in the form, so you can configure the fields for new authority types. In my database I have mappings on authtypecode and authid. --- admin/auth_subfields_structure.pl | 186 ++++++--------------- .../en/modules/admin/auth_subfields_structure.tt | 53 +++++- 2 files changed, 97 insertions(+), 142 deletions(-) diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index c25090bf..67c7fac 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -148,62 +148,31 @@ if ($op eq 'add_form') { id => "ohidden$i", default => $data->{'hidden'} }; - #$row_data{ihidden} = CGI::scrolling_list(-name=>'ihidden', - # -id=>"ihidden$i", - # -values=>['0','1','2'], - # -labels => {'0'=>'Show','1'=>'Show Collapsed', - # '2' =>'Hide', - # }, - # -default=>substr($data->{'hidden'},1,1), - # -size=>1, - # -multiple=>0, - # ); - #$row_data{ehidden} = CGI::scrolling_list(-name=>'ehidden', - # -id=>"ehidden$i", - # -values=>['0','1','2'], - # -labels => {'0'=>'Show','1'=>'Show Collapsed', - # '2' =>'Hide', - # }, - # -default=>substr($data->{'hidden'}." ",2,1), - # -size=>1, - # -multiple=>0, - # ); $row_data{tagsubfieldinput} = "{'tagsubfield'}."\" id=\"tagsubfield\" />"; $row_data{tagsubfield} = $data->{'tagsubfield'}; $row_data{liblibrarian} = CGI::escapeHTML($data->{'liblibrarian'}); $row_data{libopac} = CGI::escapeHTML($data->{'libopac'}); $row_data{seealso} = CGI::escapeHTML($data->{'seealso'}); - $row_data{kohafield}= CGI::scrolling_list( -name=>"kohafield", - -id=>"kohafield$i", - -values=> \@kohafields, - -default=> "$data->{'kohafield'}", - -size=>1, - -multiple=>0, - ); - $row_data{authorised_value} = CGI::scrolling_list(-name=>'authorised_value', - -id=>"authorised_value$i", - -values=> \@authorised_values, - -default=>$data->{'authorised_value'}, - -size=>1, - -tabindex=>'', - -multiple=>0, - ); - $row_data{frameworkcode} = CGI::scrolling_list(-name=>'frameworkcode', - -id=>"frameworkcode$i", - -values=> \@authtypes, - -default=>$data->{'frameworkcode'}, - -size=>1, - -tabindex=>'', - -multiple=>0, - ); - $row_data{value_builder} = CGI::scrolling_list(-name=>'value_builder', - -id=>"value_builder$i", - -values=> \@value_builder, - -default=>$data->{'value_builder'}, - -size=>1, - -tabindex=>'', - -multiple=>0, - ); + $row_data{kohafield} = { + id => "kohafield$i", + values => \@kohafields, + default => "$data->{'kohafield'}", + }; + $row_data{authorised_value} = { + id => "authorised_value$i", + values => \@authorised_values, + default => $data->{'authorised_value'}, + }; + $row_data{frameworkcode} = { + id => "frameworkcode$i", + values => \@authtypes, + default => $data->{'frameworkcode'}, + }; + $row_data{value_builder} = { + id => "value_builder$i", + values => \@value_builder, + default => $data->{'value_builder'}, + }; $row_data{repeatable} = CGI::checkbox(-name=>"repeatable$i", -checked => $data->{'repeatable'}?'checked':'', @@ -229,63 +198,15 @@ if ($op eq 'add_form') { for (my $i=1;$i<=$more_subfields;$i++) { my %row_data; # get a fresh hash for the row data $row_data{'new_subfield'} = 1; - $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=>"", - -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=>"0", - -default=>$data->{'hidden'}, - #-default=>"-5", - -size=>1, - -multiple=>0, - ); + $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'], - # -labels => {'0'=>'Show','1'=>'Show Collapsed', - # '2' =>'Hide', - # }, - # -default=>"0", - # -size=>1, - # -multiple=>0, - # ); - #$row_data{ehidden} = CGI::scrolling_list(-name=>'ehidden', - # -id=>"ehidden$i", - # -values=>['0','1','2'], - # -labels => {'0'=>'Show','1'=>'Show Collapsed', - # '2' =>'Hide', - # }, - # -default=>"0", - # -size=>1, - # -multiple=>0, - # ); $row_data{tagsubfieldinput} = "{'tagsubfield'}."\" size=\"1\" id=\"tagsubfield\" maxlength=\"1\" />"; $row_data{tagsubfieldinput} = "