Bug 8683: ensure clear button clears all item fields on order form
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 13 Nov 2013 10:33:05 +0000 (11:33 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 10 Dec 2013 03:37:10 +0000 (03:37 +0000)
The clear js function parses input text, but input filled to a plugin
does not contain the type attribute.

Test plan:
- fill the barcode field to the barcode plugin
- go on the new order page
- verify the barcode plugin works as before
- verify the clear link clears the barcode field and all others fields.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes all tests and QA script.
Template change only.
Barcode and date acquired are now also cleared with the
'clear' link.

But: it only works when you enter a barcode manually currently,
because the AutoBarcode functionality is broken on master (bug 11273).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Items.pm

index 073d6f7..231e5c4 100644 (file)
@@ -2797,14 +2797,14 @@ sub PrepareItemrecordDisplay {
                             my $extended_param = plugin_parameters( $dbh, undef, $tagslib, $subfield_data{id}, undef );
                             my ( $function_name, $javascript ) = plugin_javascript( $dbh, undef, $tagslib, $subfield_data{id}, undef );
                             $subfield_data{random}     = int(rand(1000000));    # why do we need 2 different randoms?
-                            $subfield_data{marc_value} = qq[<input tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255"
+                            $subfield_data{marc_value} = qq[<input type="text" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255"
                                 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];
                         } else {
                             warn "Plugin Failed: $plugin";
-                            $subfield_data{marc_value} = qq(<input tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" />); # supply default input form
+                            $subfield_data{marc_value} = qq(<input type="text" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" />); # supply default input form
                         }
                 }
                 elsif ( $tag eq '' ) {       # it's an hidden field