Bugzilla – Attachment 39518 Details for
Bug 12176
Remove HTML from additem.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12176: [QA Follow-up] Small additem adjustments
Bug-12176-QA-Follow-up-Small-additem-adjustments.patch (text/plain), 7.25 KB, created by
Jonathan Druart
on 2015-05-26 12:59:35 UTC
(
hide
)
Description:
Bug 12176: [QA Follow-up] Small additem adjustments
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-05-26 12:59:35 UTC
Size:
7.25 KB
patch
obsolete
>From 618367004505c1d05f0e1a88caad028042dccd90 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 20 May 2015 14:56:48 +0200 >Subject: [PATCH] Bug 12176: [QA Follow-up] Small additem adjustments > >Adjusting a few small things and making qa tools happy: > >[1] Remove .hidden after [% avalue %] in additem.tt. (Typo) >[2] A closer look revealed that mv.avalue is useless too. An input element > does not contain any content. Putting it after the hidden element > in a non-visible context has no meaning. >[3] Change handling of select attributes readonly and disabled. >[4] Remove unused variable $attributes_no_value_textarea >[5] Removed a comment with TODO referring to this report. >[6] Moving a duplicated TT variable (mv.javascript) outside IF statement. >[7] And finally could not resist this one: Moving strings Tag editor and > No popup from script to template. Plugins++ > NOTE: Most item plugins redirect click to focus. In that case there is > no popup, but unfortunately the text Tag editor comes up. > When you remove or rename function Click, No popup comes up. So it works. > >Sorry that this small list kept growing :) > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> >--- > cataloguing/additem.pl | 13 +++---------- > .../prog/en/modules/cataloguing/additem.tt | 17 +++++++++++------ > 2 files changed, 14 insertions(+), 16 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 48bcd59..8a800e1 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -155,7 +155,6 @@ sub generate_subfield_form { > $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" ); > > # Getting list of subfields to keep when restricted editing is enabled > my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing'); >@@ -236,7 +235,6 @@ sub generate_subfield_form { > id => $subfield_data{id}, > maxlength => $subfield_data{max_length}, > value => $value, >- avalue => $authorised_lib{$value}, > }; > } > else { >@@ -249,14 +247,11 @@ sub generate_subfield_form { > }; > # If we're on restricted editing, and our field is not in the list of subfields to allow, > # then it is read-only >- if ( >+ $subfield_data{marc_value}->{readonlyselect} = ( > not $allowAllSubfields > and $restrictededition > and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow >- ) { >- $subfield_data{marc_value}->{readonly} ='readonly="readonly"', >- $subfield_data{marc_value}->{disabled} ='disabled="disabled"', >- } >+ ) ? 1: 0; > } > } > # it's a thesaurus / authority field >@@ -280,16 +275,14 @@ sub generate_subfield_form { > id => $subfield_data{id}, tabloop => $loop_data }; > $plugin->build( $pars ); > if( !$plugin->errstr ) { >- #TODO Report 12176 will make this even better ! > my $class= 'buttonDot'. ( $plugin->noclick? ' disabled': '' ); >- my $title= $plugin->noclick? 'No popup': 'Tag editor'; > $subfield_data{marc_value} = { > type => 'text_plugin', > id => $subfield_data{id}, > maxlength => $subfield_data{max_length}, > value => $value, > class => $class, >- title => $title, >+ nopopup => $plugin->noclick, > javascript => $plugin->javascript, > }; > } else { >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 78e97c5..1cc8402 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -228,9 +228,13 @@ $(document).ready(function() { > > [% 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 %].hidden >+ <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]"> > [% ELSIF ( mv.type == 'select' ) %] >- <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" class="input_marceditor" [% mv.readonly %] [% mv.disabled %]> >+ [% IF ( mv.readonlyselect ) %] >+ <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled"> >+ [% ELSE %] >+ <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" class="input_marceditor"> >+ [% END %] > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] > <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option> >@@ -245,11 +249,12 @@ $(document).ready(function() { > <a href="#" class="buttonDot" onclick="[%- dopop -%]; return false;" title="Tag Editor">...</a> > [% ELSIF ( mv.type == 'text_plugin' ) %] > <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" /> >- [% IF ( mv.title == 'Tag editor' ) %] >- <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>[%- mv.javascript -%] >- [% ELSIF ( mv.title == 'No popup' ) %] >- <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>[%- mv.javascript -%] >+ [% IF ( mv.nopopup ) %] >+ <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a> >+ [% ELSE %] >+ <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a> > [% END %] >+ [%- 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' ) %] >-- >2.1.0
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 12176
:
27927
|
30270
|
30975
|
31138
|
39303
|
39345
|
39346
|
39347
|
39348
|
39442
|
39450
|
39451
|
39452
|
39503
|
39513
|
39516
|
39517
| 39518 |
39519
|
39520