Bugzilla – Attachment 27931 Details for
Bug 12180
Remove HTML from batchMod.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12180 - Remove HTML from batchMod.pl
Bug-12180---Remove-HTML-from-batchModpl.patch (text/plain), 9.54 KB, created by
Bernardo Gonzalez Kriegel
on 2014-05-04 17:33:50 UTC
(
hide
)
Description:
Bug 12180 - Remove HTML from batchMod.pl
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-05-04 17:33:50 UTC
Size:
9.54 KB
patch
obsolete
>From 2ef0080984dea88ce93582dacc0dc0771e505284 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Sun, 4 May 2014 14:19:02 -0300 >Subject: [PATCH] Bug 12180 - Remove HTML from batchMod.pl > >This patch removes HTML code from batchMod.pl > >To test: >1. Check no regressions on batchMod editor, >Go to Tools > Batch item modification, >put a know barcode on barcode list, press continue > >2. Check new line on translation files, update >a language, look for 'Tag editor' > >Fixed capitalizacion >--- > .../prog/en/modules/tools/batchMod-edit.tt | 28 +++++++- > tools/batchMod.pl | 76 ++++++++++++-------- > 2 files changed, 74 insertions(+), 30 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >index db78536..12283b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >@@ -177,7 +177,33 @@ $(document).ready(function(){ > [% ite.marc_lib %] > </label> > [% UNLESS ( ite.mandatory ) %]<input type="checkbox" id="row[% ite.tag %][% ite.subfield %][% ite.random %]" title="Check to delete subfield [% ite.subfield %]" name="disable_input" value="[% ite.subfield %]" />[% ELSE %]<span class="required">Required</span>[% END %] >- [% ite.marc_value %] >+ >+ [% SET mv = ite.marc_value %] >+ [% IF ( mv.type == 'select' ) -%] >+ <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" tabindex="1" class="input_marceditor"> >+ [%- FOREACH aval IN mv.values %] >+ [% IF aval == mv.default %] >+ <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option> >+ [% ELSE %] >+ <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option> >+ [% END %] >+ [%- END -%] >+ </select> >+ [% ELSIF ( mv.type == 'text1' ) %] >+ <input type="text" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" /> >+ <a href="#" class="buttonDot" onclick="Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=[%- mv.authtypecode -%]&index=[%- mv.id -%]','[%- mv.id -%]'); return false;" title="Tag editor">...</a> >+ [% ELSIF ( mv.type == 'text2' ) %] >+ <input type="text" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" onfocus="Focus[%- mv.function -%]([%- mv.random -%], '[%- mv.id -%]');" onblur=" Blur[%- mv.function -%]([%- mv.random -%], '[%- mv.id -%]');" /> >+ <a href="#" class="buttonDot" onclick="Clic[%- mv.function -%]('[%- mv.id -%]'); return false;" title="Tag editor">...</a> >+ [% javascript %] >+ [% ELSIF ( mv.type == 'text' ) %] >+ <input type="text" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" /> >+ [% ELSIF ( mv.type == 'hidden' ) %] >+ <input type="hidden" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" /> >+ [% ELSIF ( mv.type == 'textarea' ) %] >+ <textarea tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value -%]"</textarea> >+ [%- END -%] >+ > <input type="hidden" name="tag" value="[% ite.tag %]" /> > <input type="hidden" name="subfield" value="[% ite.subfield %]" /> > <input type="hidden" name="mandatory" value="[% ite.mandatory %]" /> >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 41d15cb..abf7417 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -330,9 +330,6 @@ foreach my $tag (sort keys %{$tagslib}) { > $subfield_data{visibility} = "display:none;" if (($tagslib->{$tag}->{$subfield}->{hidden} > 4) || ($tagslib->{$tag}->{$subfield}->{hidden} < -4)); > # testing branch value if IndependentBranches. > >- my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" ); >- my $attributes = qq($attributes_no_value value="$value" ); >- > if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { > my @authorised_values; > my %authorised_lib; >@@ -383,25 +380,23 @@ foreach my $tag (sort keys %{$tagslib}) { > } > $value=""; > } >- $subfield_data{marc_value} =CGI::scrolling_list( # FIXME: factor out scrolling_list >- -name => "field_value", >- -values => \@authorised_values, >- -default => $value, >- -labels => \%authorised_lib, >- -override => 1, >- -size => 1, >- -multiple => 0, >- -tabindex => 1, >- -id => "tag_".$tag."_subfield_".$subfield."_".$index_subfield, >- -class => "input_marceditor", >- ); >+ $subfield_data{marc_value} = { >+ type => 'select', >+ id => "tag_".$tag."_subfield_".$subfield."_".$index_subfield, >+ name => "field_value", >+ values => \@authorised_values, >+ labels => \%authorised_lib, >+ default => $value, >+ }; > # it's a thesaurus / authority field > } > elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) { >- $subfield_data{marc_value} = "<input type=\"text\" $attributes /> >- <a href=\"#\" class=\"buttonDot\" >- onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a> >- "; >+ $subfield_data{marc_value} = { >+ type => 'text1', >+ id => $subfield_data{id}, >+ value => $value, >+ authtypecode => $tagslib->{$tag}->{$subfield}->{authtypecode}, >+ } > # it's a plugin field > } > elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) { >@@ -411,21 +406,36 @@ foreach my $tag (sort keys %{$tagslib}) { > my $temp; > my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data ); > my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data ); >- $subfield_data{marc_value} = qq[<input type="text" $attributes >- onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');" >- onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" /> >- <a href="#" class="buttonDot" onclick="Clic$function_name('$subfield_data{id}'); return false;" title="Tag Editor">...</a> >- $javascript]; >+ $subfield_data{marc_value} = { >+ type => 'text2', >+ id => $subfield_data{id}, >+ value => $value, >+ function => $function_name, >+ random => $subfield_data{random}, >+ javascript => $javascript, >+ }; > } else { > warn "Plugin Failed: $plugin"; >- $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form >+ $subfield_data{marc_value} = { # supply default input form >+ type => 'text', >+ id => $subfield_data{id}, >+ value => $value, >+ }; > } > } > elsif ( $tag eq '' ) { # it's an hidden field >- $subfield_data{marc_value} = qq(<input type="hidden" $attributes />); >+ $subfield_data{marc_value} = { >+ type => 'hidden', >+ id => $subfield_data{id}, >+ value => $value, >+ }; > } > elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ? >- $subfield_data{marc_value} = qq(<input type="text" $attributes />); >+ $subfield_data{marc_value} = { >+ type => 'text', >+ id => $subfield_data{id}, >+ value => $value, >+ }; > } > elsif ( length($value) > 100 > or (C4::Context->preference("marcflavour") eq "UNIMARC" and >@@ -434,10 +444,18 @@ foreach my $tag (sort keys %{$tagslib}) { > 500 <= $tag && $tag < 600 ) > ) { > # oversize field (textarea) >- $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n"; >+ $subfield_data{marc_value} = { >+ type => 'textarea', >+ id => $subfield_data{id}, >+ value => $value, >+ }; > } else { > # it's a standard field >- $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; >+ $subfield_data{marc_value} = { >+ type => 'text', >+ id => $subfield_data{id}, >+ value => $value, >+ }; > } > # $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">"; > push (@loop_data, \%subfield_data); >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12180
:
27930
|
27931
|
30808
|
30867
|
30871