From 39597b86ae299a9b4c0c1e8221f51f9e8dd300ed Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 9 Feb 2016 17:02:05 +0000 Subject: [PATCH] Bug 15773: Fix and standardise checkboxes code in framework When creating a new subfield for an authority framework, the checkboxes don't behave as they should. If you click on the 'repeatable', 'mandatory' or 'is url' checkbox's label, the checkbox from the second tab will be checked/unchecked. This is caused by a non-unique id of the input element. I have found this bug when working on the removal of CGI::checkbox in both admin/auth_subfields_structure.pl and admin/marc_subfields_structure.pl scripts. This patch remove the use of CGI::checkbox as well as the generation of html code from these 2 pl scripts (which should be avoided). The code these scripts are now pretty similar. Test plan: Add/modify/remove subfield for a MARC framework and an Authority framework. Use as many field as possible and confirm that the values are correctly inserted/displayed. Signed-off-by: Hector Castro Works as advertised Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- admin/auth_subfields_structure.pl | 179 +++++------------ admin/marc_subfields_structure.pl | 183 +++++------------- .../modules/admin/auth_subfields_structure.tt | 100 ++++++---- .../modules/admin/marc_subfields_structure.tt | 74 ++++--- 4 files changed, 209 insertions(+), 327 deletions(-) diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index f06ee4fff2..e26aa79196 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Output; use C4::Auth; use CGI qw ( -utf8 ); @@ -52,7 +51,7 @@ my $input = new CGI; my $tagfield = $input->param('tagfield'); my $tagsubfield = $input->param('tagsubfield'); my $authtypecode = $input->param('authtypecode'); -my $offset = $input->param('offset'); +my $offset = $input->param('offset') || 0; my $op = $input->param('op') || ''; my $script_name = "/cgi-bin/koha/admin/auth_subfields_structure.pl"; @@ -84,8 +83,6 @@ my $dbh = C4::Context->dbh; ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record if ($op eq 'add_form') { - my $data; - my $more_subfields = $input->param("more_subfields")+1; # builds kohafield tables my @kohafields; push @kohafields, ""; @@ -130,133 +127,58 @@ if ($op eq 'add_form') { $sth->execute($tagfield,$authtypecode); my @loop_data = (); my $i=0; - while ($data =$sth->fetchrow_hashref) { - - my %row_data; # get a fresh hash for the row data - $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{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} = { - 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':'', - -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; - push(@loop_data, \%row_data); - $i++; - } - # add more_subfields empty lines for add if needed - 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} = { - id => "tab$i", - default => $data->{'tab'}, - }; - $row_data{ohidden} = { - id => "ohidden$i", - default => $data->{'hidden'} - }; + while ( my $data = $sth->fetchrow_hashref ) { + my %row_data; # get a fresh hash for the row data + $row_data{defaultvalue} = $data->{defaultvalue}; + $row_data{tab} = $data->{tab}; + $row_data{ohidden} = $data->{'hidden'}; + $row_data{tagsubfield} = $data->{'tagsubfield'}; + $row_data{liblibrarian} = $data->{'liblibrarian'}; + $row_data{libopac} = $data->{'libopac'}; + $row_data{seealso} = $data->{'seealso'}; + $row_data{kohafields} = \@kohafields; + $row_data{kohafield} = $data->{'kohafield'}; + $row_data{authorised_values} = $authorised_values; + $row_data{authorised_value} = $data->{'authorised_value'}; + $row_data{frameworkcodes} = \@authtypes; + $row_data{frameworkcode} = $data->{'frameworkcode'}; + $row_data{value_builders} = \@value_builder; + $row_data{value_builder} = $data->{'value_builder'}; + $row_data{repeatable} = $data->{repeatable}; + $row_data{mandatory} = $data->{mandatory}; + $row_data{hidden} = $data->{hidden}; + $row_data{isurl} = $data->{isurl}; + $row_data{row} = $i; + push( @loop_data, \%row_data ); + $i++; + } - $row_data{tagsubfieldinput} = "{'tagsubfield'}."\" size=\"1\" id=\"tagsubfield\" maxlength=\"1\" />"; - $row_data{tagsubfieldinput} = - ""; - $row_data{tagsubfield} = $data->{'tagsubfield'}; - $row_data{liblibrarian} = ""; - $row_data{libopac} = ""; - $row_data{seealso} = ""; - $row_data{hidden} = "000"; - $row_data{repeatable} = CGI::checkbox( -name=> 'repeatable', - -id => "repeatable$i", - -checked => '', - -value => 1, - -label => ''); - $row_data{mandatory} = CGI::checkbox( -name=> 'mandatory', - -id => "mandatory$i", - -checked => '', - -value => 1, - -label => ''); - $row_data{isurl} = CGI::checkbox(-name => 'isurl', - -id => "isurl$i", - -checked => '', - -value => 1, - -label => ''); - $row_data{kohafield} = { - id => "kohafield$i", - values => \@kohafields, - default => "", - }; - $row_data{authorised_value} = { - id => "authorised_value", - values => $authorised_values, - default => "", - }; - $row_data{frameworkcode} = { - id => "frameworkcode", - values => \@authtypes, - default => $data->{'frameworkcode'}, - }; - $row_data{value_builder} = { - id => "value_builder", - values => \@value_builder, - default => $data->{'value_builder'}, - }; + # Add a new row for the "New" tab + my %row_data; # get a fresh hash for the row data + $row_data{'new_subfield'} = 1; + $row_data{tab} = -1; # ignore + $row_data{ohidden} = 0; # show all + $row_data{tagsubfield} = ""; + $row_data{liblibrarian} = ""; + $row_data{libopac} = ""; + $row_data{seealso} = ""; + $row_data{hidden} = "000"; + $row_data{repeatable} = 0; + $row_data{mandatory} = 0; + $row_data{isurl} = 0; + $row_data{kohafields} = \@kohafields, + $row_data{authorised_values} = $authorised_values; + $row_data{frameworkcodes} = \@authtypes; + $row_data{value_builders} = \@value_builder; + $row_data{row} = $i; + push( @loop_data, \%row_data ); - $row_data{row} = $i; - push(@loop_data, \%row_data); - } $template->param('use_heading_flags_p' => 1); $template->param('heading_edit_subfields_p' => 1); $template->param(action => "Edit subfields", tagfield => $tagfield, tagfieldinput => "", loop => \@loop_data, - more_subfields => $more_subfields, more_tag => $tagfield); # END $OP eq ADD_FORM @@ -276,9 +198,7 @@ if ($op eq 'add_form') { my @kohafield = ''.$input->param('kohafield'); my @tab = $input->param('tab'); my @seealso = $input->param('seealso'); - my @ohidden = $input->param('ohidden'); - #my @ihidden = $input->param('ihidden'); - #my @ehidden = $input->param('ehidden'); + my @ohidden = $input->param('ohidden'); my @authorised_values = $input->param('authorised_value'); my $authtypecode = $input->param('authtypecode'); my @frameworkcodes = $input->param('frameworkcode'); @@ -299,11 +219,10 @@ if ($op eq 'add_form') { 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; if ($liblibrarian) { - unless (C4::Context->config('demo') eq 1) { + unless (C4::Context->config('demo') or C4::Context->config('demo') eq 1) { if (auth_subfield_structure_exists($authtypecode, $tagfield, $tagsubfield)) { $sth_update->execute( $authtypecode, @@ -372,7 +291,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') eq 1) { + unless (C4::Context->config('demo') or C4::Context->config('demo') eq 1) { my $sth=$dbh->prepare("delete from auth_subfield_structure where tagfield=? and tagsubfield=? and authtypecode=?"); $sth->execute($tagfield,$tagsubfield,$authtypecode); } diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index e6d2231aca..979d7ec2b2 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Output; use C4::Auth; use CGI qw ( -utf8 ); @@ -65,7 +64,7 @@ my $tagfield = $input->param('tagfield'); my $tagsubfield = $input->param('tagsubfield'); my $frameworkcode = $input->param('frameworkcode'); my $pkfield = "tagfield"; -my $offset = $input->param('offset'); +my $offset = $input->param('offset') || 0; my $script_name = "/cgi-bin/koha/admin/marc_subfields_structure.pl"; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( @@ -80,7 +79,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $cache = Koha::Cache->get_instance(); -my $op = $input->param('op'); +my $op = $input->param('op') || ""; $tagfield =~ s/\,//g; if ($op) { @@ -103,9 +102,7 @@ else { ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record if ( $op eq 'add_form' ) { - my $data; my $dbh = C4::Context->dbh; - my $more_subfields = $input->param("more_subfields") + 1; # builds kohafield tables my @kohafields; @@ -173,135 +170,56 @@ if ( $op eq 'add_form' ) { $sth->execute( $tagfield, $frameworkcode ); my @loop_data = (); my $i = 0; - while ( $data = $sth->fetchrow_hashref ) { + while ( my $data = $sth->fetchrow_hashref ) { my %row_data; # get a fresh hash for the row data - $row_data{defaultvalue} = $data->{defaultvalue}; - $row_data{maxlength} = $data->{maxlength}; - $row_data{tab} = { - id => "tab$i", - default => $data->{'tab'}, - }; - - $row_data{tagsubfield} = - $data->{'tagsubfield'} - . "{'tagsubfield'} - . "\" id=\"tagsubfield\" />"; - $row_data{subfieldcode} = $data->{'tagsubfield'} eq '@'?'_':$data->{'tagsubfield'}; - $row_data{urisubfieldcode} = $row_data{subfieldcode} eq '%' ? 'pct' : $row_data{subfieldcode}; - $row_data{liblibrarian} = CGI::escapeHTML( $data->{'liblibrarian'} ); - $row_data{libopac} = CGI::escapeHTML( $data->{'libopac'} ); - $row_data{seealso} = CGI::escapeHTML( $data->{'seealso'} ); - $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' : '', - -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'} ); + $row_data{defaultvalue} = $data->{defaultvalue}; + $row_data{maxlength} = $data->{maxlength}; + $row_data{tab} = $data->{tab}; + $row_data{tagsubfield} = $data->{tagsubfield}; + $row_data{subfieldcode} = $data->{'tagsubfield'} eq '@' ? '_' : $data->{'tagsubfield'}; + $row_data{urisubfieldcode} = $row_data{subfieldcode} eq '%' ? 'pct' : $row_data{subfieldcode}; + $row_data{liblibrarian} = $data->{'liblibrarian'}; + $row_data{libopac} = $data->{'libopac'}; + $row_data{seealso} = $data->{'seealso'}; + $row_data{kohafields} = \@kohafields; + $row_data{kohafield} = $data->{kohafield}; + $row_data{authorised_values} = \@authorised_values; + $row_data{authorised_value} = $data->{authorised_value}; + $row_data{value_builders} = \@value_builder; + $row_data{value_builder} = $data->{'value_builder'}; + $row_data{authtypes} = \@authtypes; + $row_data{authtypecode} = $data->{'authtypecode'}; + $row_data{repeatable} = $data->{repeatable}; + $row_data{mandatory} = $data->{mandatory}; + $row_data{hidden} = $data->{hidden}; + $row_data{isurl} = $data->{isurl}; + $row_data{row} = $i; + $row_data{link} = $data->{'link'}; push( @loop_data, \%row_data ); $i++; } - # add more_subfields empty lines for add if needed - my %row_data; # get a fresh hash for the row data - $row_data{'new_subfield'} = 1; - $row_data{'subfieldcode'} = ''; - $row_data{'maxlength'} = 9999; - - $row_data{tab} = { - id => "tab$i", - default => $data->{'tab'}, - }; - $row_data{tagsubfield} = - "{'tagsubfield'} - . "\" size=\"1\" id=\"tagsubfield\" maxlength=\"1\" />"; - $row_data{liblibrarian} = ""; - $row_data{libopac} = ""; - $row_data{seealso} = ""; - $row_data{kohafield} = { - id => "kohafield$i", - values => \@kohafields, - 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, - 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 ); + # Add a new row for the "New" tab + my %row_data; # get a fresh hash for the row data + $row_data{'new_subfield'} = 1; + $row_data{'subfieldcode'} = ''; + $row_data{'maxlength'} = 9999; + $row_data{tab} = -1; #ignore + $row_data{tagsubfield} = ""; + $row_data{liblibrarian} = ""; + $row_data{libopac} = ""; + $row_data{seealso} = ""; + $row_data{hidden} = ""; + $row_data{repeatable} = 0; + $row_data{mandatory} = 0; + $row_data{isurl} = 0; + $row_data{kohafields} = \@kohafields; + $row_data{authorised_values} = \@authorised_values; + $row_data{value_builders} = \@value_builder; + $row_data{authtypes} = \@authtypes; + $row_data{link} = ""; + $row_data{row} = $i; + push( @loop_data, \%row_data ); $template->param( 'use_heading_flags_p' => 1 ); $template->param( 'heading_edit_subfields_p' => 1 ); @@ -309,7 +227,6 @@ if ( $op eq 'add_form' ) { action => "Edit subfields", tagfield => $tagfield, loop => \@loop_data, - more_subfields => $more_subfields, more_tag => $tagfield ); @@ -368,7 +285,7 @@ elsif ( $op eq 'add_validate' ) { my $maxlength = $maxlength[$i] ? $maxlength[$i] : 9999; if (defined($liblibrarian) && $liblibrarian ne "") { - unless ( C4::Context->config('demo') eq 1 ) { + unless ( C4::Context->config('demo') or C4::Context->config('demo') eq 1 ) { if (marc_subfield_structure_exists($tagfield, $tagsubfield, $frameworkcode)) { $sth_update->execute( $tagfield, @@ -457,7 +374,7 @@ elsif ( $op eq 'delete_confirm' ) { } elsif ( $op eq 'delete_confirmed' ) { my $dbh = C4::Context->dbh; - unless ( C4::Context->config('demo') eq 1 ) { + unless ( C4::Context->config('demo') or C4::Context->config('demo') eq 1 ) { my $sth = $dbh->prepare( "delete from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?" diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt index 0d5bff3c6a..7caceca0b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt @@ -49,9 +49,9 @@
    [% FOREACH loo IN loop %] [% IF ( loo.new_subfield ) %] -
  • New
  • +
  • New
  • [% ELSE %] -
  • +
  • [% loo.tagsubfield %]
  • [% END %] @@ -62,28 +62,45 @@
      - [% IF ( loo.new_subfield ) %] -
    1. [% loo.tagsubfieldinput %] 
    2. + [% IF ( loo.new_subfield ) %] +
    3. + + +
    4. + [% ELSE %] +
    5. + +
    6. + [% END %] +
    7. + + [% IF loo.repeatable %] + [% ELSE %] + + [% END %] +
    8. - -
    9. + + [% IF loo.mandatory %] + + [% ELSE %] + [% END %] -
    10. [% loo.repeatable %] 
    11. -
    12. [% loo.mandatory %] 
    13. -
    14. -
    15. + +
    16. +
    17. - + [%- IF ( loo.tab == -1 ) -%] [%- ELSE -%] [%- END -%] [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%] - [%- IF ( loo.tab.default == t && t.length>0 ) -%] + [%- IF ( loo.tab == t && t.length>0 ) -%] - [%- ELSIF ( loo.tab.default == t ) -%] + [%- ELSIF ( loo.tab == t ) -%] [%- ELSE -%] @@ -97,11 +114,11 @@ Display
      1. - + [%- IF ( loo.ohidden == 0 ) -%] - [%- ELSIF ( loo.ohidden.default == -5 ) -%] + [%- ELSIF ( loo.ohidden == -5 ) -%] [%- ELSE -%] @@ -117,7 +134,15 @@
        Advanced constraints:
          -
        1. [% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)
        2. +
        3. + + [% IF loo.isurl %] + + [% ELSE %] + + [% END %] + (if checked, it means that the subfield is a URL and can be clicked) +
        4. @@ -130,11 +155,11 @@
          1. - + [%- FOREACH value IN loo.kohafields %] + [% IF ( value == loo.kohafield && value.length>0 ) -%] - [%- ELSIF ( value == loo.kohafield.default ) -%] + [%- ELSIF ( value == loo.kohafield ) -%] [%- ELSIF ( value.length==0 ) -%] @@ -146,11 +171,11 @@
          2. - + [%- FOREACH value IN loo.authorised_values %] + [% IF ( value == loo.authorised_value && value.length>0 ) -%] - [%- ELSIF ( value == loo.authorised_value.default ) -%] + [%- ELSIF ( value == loo.authorised_value ) -%] [%- ELSIF ( value.length==0 ) -%] @@ -162,11 +187,11 @@
          3. - + [%- FOREACH value IN loo.frameworkcodes %] + [% IF ( value == loo.frameworkcode && value.length>0 ) -%] - [%- ELSIF ( value == loo.frameworkcode.default ) -%] + [%- ELSIF ( value == loo.frameworkcode ) -%] [%- ELSIF ( value.length==0 ) -%] @@ -178,11 +203,11 @@
          4. - + [%- FOREACH value IN loo.value_builders %] + [% IF ( value == loo.value_builder && value.length>0 ) -%] - [%- ELSIF ( value == loo.value_builder.default ) -%] + [%- ELSIF ( value == loo.value_builder ) -%] [%- ELSIF ( value.length==0 ) -%] @@ -210,7 +235,7 @@ - +
            Subfield: [% tagsubfield %]
            Description: [% liblibrarian %]
            Description: [% liblibrarian | html_entity %]
            @@ -219,7 +244,6 @@ -
            @@ -257,9 +281,9 @@ [% loo.tagsubfield %] [% IF ( loo.subfield_ignored ) %] - [% loo.liblibrarian %] + [% loo.liblibrarian | html_entity %] [% ELSE %] - [% loo.liblibrarian %] + [% loo.liblibrarian | html_entity %] [% END %] 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 883d1689c7..78e12ac23e 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 @@ -46,9 +46,9 @@
              [% FOREACH loo IN loop %] [% IF ( loo.new_subfield ) %] -
            • New
            • +
            • New
            • [% ELSE %] -
            • +
            • [% loo.subfieldcode %]
            • [% END %] @@ -67,25 +67,39 @@ [% ELSE %]
            • [% END %] -
            • -
            • -
            • [% loo.repeatable %]
            • -
            • [% loo.mandatory %]
            • +
            • +
            • +
            • + + [% IF loo.repeatable %] + + [% ELSE %] + + [% END %] +
            • +
            • + + [% IF loo.mandatory %] + + [% ELSE %] + + [% END %] +
            • - + [%- IF ( loo.tab == -1 ) -%] [%- ELSE -%] [%- END -%] [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%] - [%- IF ( loo.tab.default == t ) -%] + [%- IF ( loo.tab == t ) -%] [%- ELSE -%] [%- END -%] [%- END -%] - [%- IF ( loo.tab.default == 10 ) -%] + [%- IF ( loo.tab == 10 ) -%] [%- ELSE -%] @@ -117,13 +131,21 @@
            • -
            • [% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)
            • +
            • + + [% IF loo.isurl %] + + [% ELSE %] + + [% END %] + (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.
            • - + [% FOREACH value IN loo.kohafields %] + [% IF ( value == loo.kohafield ) %] [% ELSE %] @@ -140,9 +162,9 @@
              1. - + [% FOREACH value IN loo.authorised_values %] + [% IF ( value == loo.authorised_value ) %] [% ELSE %] @@ -152,9 +174,9 @@
              2. - + [% FOREACH value IN loo.authtypes %] + [% IF ( value == loo.authtypecode ) %] [% ELSE %] @@ -164,9 +186,9 @@
              3. - + [% FOREACH value IN loo.value_builders %] + [% IF ( value == loo.value_builder ) %] [% ELSE %] @@ -191,7 +213,7 @@

                Confirm deletion of subfield [% tagsubfield %]?

                Subfield: [% tagsubfield %]

                -

                Description: [% liblibrarian %]

                +

                Description: [% liblibrarian | html_entity %]

                @@ -241,9 +263,9 @@ [% loo.tagsubfield %] [% IF ( loo.subfield_ignored ) %] - [% loo.liblibrarian %] + [% loo.liblibrarian | html_entity %] [% ELSE %] - [% loo.liblibrarian %] + [% loo.liblibrarian | html_entity %] [% END %] -- 2.39.5