From 207270e450bf383fecad9442f730a3c8b6ac4abc Mon Sep 17 00:00:00 2001 From: remi Date: Fri, 31 Jul 2015 08:40:55 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 8643: Removed all uses of CGI::Checkbox in marc_subfields_structure.pl To test this patch : 1) Apply all patches 2) Run ./installer/data/mysql/updatedatabase.pl 3) Go to More > Administration > MARC bibliographic framework > default framework ("MARC structure") 4) Search for tag 100 > Click subfields 5) Edit the "a" field and check the "reapeatable","mandatory","important" and "Is a URL" checkboxes 6) Click save an validate that the constraints for field "a" were modified properly. Signed-off-by: Bernardo Gonzalez Kriegel All checkboxes work, verified on db No errors --- admin/marc_subfields_structure.pl | 45 ++-------------------- .../en/modules/admin/marc_subfields_structure.tt | 34 ++++++++++++++-- 2 files changed, 34 insertions(+), 45 deletions(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index edfe91b..1e303d4 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -196,7 +196,10 @@ if ( $op eq 'add_form' ) { $row_data{liblibrarian} = CGI::escapeHTML( $data->{'liblibrarian'} ); $row_data{libopac} = CGI::escapeHTML( $data->{'libopac'} ); $row_data{seealso} = CGI::escapeHTML( $data->{'seealso'} ); + $row_data{repeatable} = $data->{'repeatable'} ? 1 : 0; + $row_data{mandatory} = $data->{'mandatory'} ? 1 : 0; $row_data{important} = $data->{'important'} ? 1 : 0; + $row_data{isurl} = $data->{'isurl'} ? 1 : 0; $row_data{kohafield} = { id => "kohafield$i", values => \@kohafields, @@ -217,28 +220,7 @@ if ( $op eq 'add_form' ) { values => \@authtypes, default => $data->{'authtypecode'}, }; - $row_data{repeatable} = CGI::checkbox( - -name => "repeatable$i", - -checked => $data->{'repeatable'} ? 'checked' : '', - -value => 1, - -label => '', - -id => "repeatable$i" - ); - $row_data{mandatory} = CGI::checkbox( - -name => "mandatory$i", - -checked => $data->{'mandatory'} ? 'checked' : '', - -value => 1, - -label => '', - -id => "mandatory$i" - ); $row_data{hidden} = CGI::escapeHTML( $data->{hidden} ); - $row_data{isurl} = CGI::checkbox( - -name => "isurl$i", - -id => "isurl$i", - -checked => $data->{'isurl'} ? 'checked' : '', - -value => 1, - -label => '' - ); $row_data{row} = $i; $row_data{link} = CGI::escapeHTML( $data->{'link'} ); push( @loop_data, \%row_data ); @@ -268,27 +250,6 @@ if ( $op eq 'add_form' ) { default => "$data->{'kohafield'}", }; $row_data{hidden} = ""; - $row_data{repeatable} = CGI::checkbox( - -name => "repeatable$i", - -id => "repeatable$i", - -checked => '', - -value => 1, - -label => '' - ); - $row_data{mandatory} = CGI::checkbox( - -name => "mandatory$i", - -id => "mandatory$i", - -checked => '', - -value => 1, - -label => '' - ); - $row_data{isurl} = CGI::checkbox( - -name => "isurl$i", - -id => "isurl$i", - -checked => '', - -value => 1, - -label => '' - ); $row_data{value_builder} = { id => "value_builder$i", values => \@value_builder, 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 226c09b..b7303ca 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 @@ -227,8 +227,26 @@ function populateHiddenCheckboxes(tab) { [% END %]
  • -
  • [% loo.repeatable %]
  • -
  • [% loo.mandatory %]
  • +
  • + + +
  • +
  • + + +
  • -
  • [% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)
  • +
  • + + + (if checked, it means that the subfield is a URL and can be clicked) +
  • (e.g., Title or Local-Number) NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.
  • -- 1.9.1