Bugzilla – Attachment 31271 Details for
Bug 12765
Capitalization: Cataloguing > Z39.50 search > "Try another search"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revert "Bug 12176 - Remove HTML from additem.pl"
Revert-Bug-12176---Remove-HTML-from-additempl.patch (text/plain), 10.53 KB, created by
PTFS Europe Sandboxes
on 2014-08-28 21:28:28 UTC
(
hide
)
Description:
Revert "Bug 12176 - Remove HTML from additem.pl"
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2014-08-28 21:28:28 UTC
Size:
10.53 KB
patch
obsolete
>From 4705242ef8100cc9d747635c1f6d9efc2eb948ec Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Wed, 27 Aug 2014 08:24:44 -0300 >Subject: [PATCH] Revert "Bug 12176 - Remove HTML from additem.pl" > >This reverts commit 0033d287bad3344fad0861134d8dd3e03e56ed24. > >I made a mistake pushing this one before the UTF-8 work. > >Signed-off-by: George Williams <georgew@latahlibrary.org> > >http://bugs.koha-community.org/show_bug.cgi?id=12765 >--- > cataloguing/additem.pl | 91 +++++++------------- > .../prog/en/modules/cataloguing/additem.tt | 27 +----- > 2 files changed, 31 insertions(+), 87 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index f196ff5..7110f7f 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -154,6 +154,9 @@ sub generate_subfield_form { > my $input = new CGI; > $value = $input->param('barcode'); > } >+ my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" ); >+ my $attributes_no_value_textarea = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" rows="5" cols="64" ); >+ my $attributes = qq($attributes_no_value value="$value" ); > > if ( $subfieldlib->{authorised_value} ) { > my @authorised_values; >@@ -210,35 +213,29 @@ sub generate_subfield_form { > } > > if ($subfieldlib->{'hidden'}) { >- $subfield_data{marc_value} = { >- type => 'hidden', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- avalue => $authorised_lib{$value}, >- }; >+ $subfield_data{marc_value} = qq(<input type="hidden" $attributes /> $authorised_lib{$value}); > } > else { >- $subfield_data{marc_value} = { >- type => 'select', >- id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, >- name => "field_value", >- values => \@authorised_values, >- labels => \%authorised_lib, >- default => $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, >+ -id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, >+ -class => "input_marceditor", >+ ); > } > > } > # it's a thesaurus / authority field > elsif ( $subfieldlib->{authtypecode} ) { >- $subfield_data{marc_value} = { >- type => 'text1', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- authtypecode => $subfieldlib->{authtypecode}, >- }; >+ $subfield_data{marc_value} = "<input type=\"text\" $attributes /> >+ <a href=\"#\" class=\"buttonDot\" >+ onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$subfieldlib->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a> >+ "; > } > # it's a plugin field > elsif ( $subfieldlib->{value_builder} ) { >@@ -250,41 +247,22 @@ sub generate_subfield_form { > my $change = index($javascript, 'function Change') > -1 ? > "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" : > 'return 1;'; >- $subfield_data{marc_value} = { >- type => 'text2', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- function => $function_name, >- data_random => $subfield_data{random}, >- change => $change, >- javascript => $javascript, >- }; >+ $subfield_data{marc_value} = qq[<input type="text" $attributes >+ onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');" >+ onchange=" $change" >+ 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]; > } else { > warn "Plugin Failed: $plugin"; >- $subfield_data{marc_value} = { >- type => 'text', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- }; # supply default input form >+ $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form > } > } > elsif ( $tag eq '' ) { # it's an hidden field >- $subfield_data{marc_value} = { >- type => 'hidden', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- }; >+ $subfield_data{marc_value} = qq(<input type="hidden" $attributes />); > } > elsif ( $subfieldlib->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ? >- $subfield_data{marc_value} = { >- type => 'text', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- }; >+ $subfield_data{marc_value} = qq(<input type="text" $attributes />); > } > elsif ( length($value) > 100 > or (C4::Context->preference("marcflavour") eq "UNIMARC" and >@@ -293,19 +271,10 @@ sub generate_subfield_form { > 500 <= $tag && $tag < 600 ) > ) { > # oversize field (textarea) >- $subfield_data{marc_value} = { >- type => 'textarea', >- id => $subfield_data{id}, >- value => $value, >- }; >+ $subfield_data{marc_value} = "<textarea $attributes_no_value_textarea>$value</textarea>\n"; > } else { > # it's a standard field >- $subfield_data{marc_value} = { >- type => 'text', >- id => $subfield_data{id}, >- maxlength => $subfield_data{max_length}, >- value => $value, >- }; >+ $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; > } > > return \%subfield_data; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 1111f14..85a4486 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -212,32 +212,7 @@ $(document).ready(function() { > [% ELSE %] > <label>[% ite.subfield %] - [% ite.marc_lib %]</label> > [% END %] >- >- [% SET mv = ite.marc_value %] >- [% IF ( mv.type == 'hidden' ) %] >- <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />[% mv.avalue %] >- [% ELSIF ( mv.type == 'select' ) %] >- <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="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" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" 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" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" onfocus="Focus[%- mv.function -%]([%- mv.data_random -%], '[%- mv.id -%]');" onchange="[%- mv.change -%]" onblur="Blur[%- mv.function -%]([%- mv.data_random -%], '[%- mv.id -%]');" /> >- <a href="#" class="buttonDot" onclick="Clic[%- mv.function -%]('[%- mv.id -%]'); return false;" title="Tag editor">...</a>[% mv.javascript %] >- [% ELSIF ( mv.type == 'text' ) %] >- <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" /> >- [% ELSIF ( mv.type == 'textarea' ) %] >- <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea> >- [% END %] >- >+ [% ite.marc_value %] > <input type="hidden" name="tag" value="[% ite.tag %]" /> > <input type="hidden" name="subfield" value="[% ite.subfield %]" /> > <input type="hidden" name="mandatory" value="[% ite.mandatory %]" /> >-- >1.7.10.4
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 12765
:
30821
|
31270
|
31271
|
31303
|
31451