From 5e3c11a8a7cf001ae50c84f91f998fc44dab2409 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Sun, 20 Jul 2014 18:59:59 -0300 Subject: [PATCH] Bug 12615: Remove CGI::scrolling_list from marc_subfields_structure.pl This patch removes all instances on this file. 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 > MARC frameworks 3. Clic MARC structure of any auth fw 4. Clic subfield on any tag, e.g. 020 5. Clic 'Edit subfields' button Now the tests proper 6. On any subfield, check pulldown 'Managed in tab', was replaced, so test if it works and search for regressions Change, save, load, change again 7. Clic on 'Other options' box 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' Check assign/remove/save/load values, search for regressions Check adding a new subfield --- admin/marc_subfields_structure.pl | 157 +++++++-------------- .../en/modules/admin/marc_subfields_structure.tt | 74 +++++++++- 2 files changed, 119 insertions(+), 112 deletions(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 552bb89..475555e 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -179,29 +179,11 @@ if ( $op eq 'add_form' ) { my %row_data; # get a fresh hash for the row data $row_data{defaultvalue} = $data->{defaultvalue}; $row_data{maxlength} = $data->{maxlength}; - $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', - '10' => 'items (10)', - }, - -default => $data->{'tab'}, - -size => 1, - -multiple => 0, - ); + $row_data{tab} = { + id => "tab$i", + default => $data->{'tab'}, + }; + $row_data{tagsubfield} = $data->{'tagsubfield'} . "{'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, - -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, - -multiple => 0, - ); - $row_data{authtypes} = CGI::scrolling_list( - -name => "authtypecode", - -id => "authtypecode$i", - -values => \@authtypes, - -default => $data->{'authtypecode'}, - -size => 1, - -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{value_builder} = { + id => "value_builder$i", + values => \@value_builder, + default => $data->{'value_builder'}, + }; + $row_data{authtypes} = { + id => "authtypecode$i", + values => \@authtypes, + default => $data->{'authtypecode'}, + }; $row_data{repeatable} = CGI::checkbox( -name => "repeatable$i", -checked => $data->{'repeatable'} ? 'checked' : '', @@ -278,29 +248,10 @@ if ( $op eq 'add_form' ) { $row_data{'subfieldcode'} = ''; $row_data{'maxlength'} = 9999; - $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', - '10' => 'items (10)', - }, - -default => "", - -size => 1, - -multiple => 0, - ); + $row_data{tab} = { + id => "tab$i", + default => $data->{'tab'}, + }; $row_data{tagsubfield} = "{'tagsubfield'} @@ -308,14 +259,11 @@ if ( $op eq 'add_form' ) { $row_data{liblibrarian} = ""; $row_data{libopac} = ""; $row_data{seealso} = ""; - $row_data{kohafield} = CGI::scrolling_list( - -name => 'kohafield', - -id => "kohafield$i", - -values => \@kohafields, - -default => "", - -size => 1, - -multiple => 0, - ); + $row_data{kohafield} = { + id => "kohafield$i", + values => \@kohafields, + default => "$data->{'kohafield'}", + }; $row_data{hidden} = ""; $row_data{repeatable} = CGI::checkbox( -name => "repeatable$i", @@ -338,28 +286,21 @@ if ( $op eq 'add_form' ) { -value => 1, -label => '' ); - $row_data{value_builder} = CGI::scrolling_list( - -name => "value_builder", - -id => "value_builder$i", - -values => \@value_builder, - -default => $data->{'value_builder'}, - -size => 1, - -multiple => 0, - ); - $row_data{authorised_value} = CGI::scrolling_list( - -name => "authorised_value", - -id => "authorised_value$i", - -values => \@authorised_values, - -size => 1, - -multiple => 0, - ); - $row_data{authtypes} = CGI::scrolling_list( - -name => "authtypecode", - -id => "authtypecode$i", - -values => \@authtypes, - -size => 1, - -multiple => 0, - ); + $row_data{value_builder} = { + id => "value_builder$i", + values => \@value_builder, + default => $data->{'value_builder'}, + }; + $row_data{authorised_value} = { + id => "authorised_value$i", + values => \@authorised_values, + default => $data->{'authorised_value'}, + }; + $row_data{authtypes} = { + id => "authtypecode$i", + values => \@authtypes, + default => $data->{'authtypecode'}, + }; $row_data{link} = CGI::escapeHTML( $data->{'link'} ); $row_data{row} = $i; push( @loop_data, \%row_data ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt index 4936041..2d8b445 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt @@ -229,7 +229,28 @@ function populateHiddenCheckboxes(tab) {
  • [% loo.repeatable %]
  • [% loo.mandatory %]
  • -
  • [% loo.tab %] (ignore means that the subfield does not display in the record editor)
  • +
  • + + (ignore means that the subfield does not display in the record editor) +
  • @@ -264,9 +285,54 @@ function populateHiddenCheckboxes(tab) {
      -
    1. [% loo.authorised_value %]
    2. -
    3. [% loo.authtypes %]
    4. -
    5. [% loo.value_builder %]
    6. +
    7. + + +
    8. +
    9. + + +
    10. +
    11. + + +
    12. +
    13. + + +
    -- 1.9.1