Bug 10661: format mandatory item fields the same on all forms
Mandatory item fields are not indicated the same way in all places. This patch corrects two places where required fields were shown in bold rather than using the standard "required" class: When adding an order from a staged file and when adding an item for a new issue of a serial. This patch also normalizes the text input size on item entry forms: In some places it was 50, others 67. I have changed the latter to 50. Unrelated changes: Added $KohaDates formatting of date and time and corrected capitalization on a heading on the add order from staged file page. It would be nice to be able to use the same method for displaying the item form as we use on neworderentry.tt -- pulling in the form from a separate include. However that system is designed for handling multiple items and would need to be adapted for these cases. To test, you must have a staged file from which to add an order. Open an existing basket or create a new one and choose to add an order "From a staged file." Choose a staged file from which to order. The item entry form under the "Import all" heading should show required fields in red. To test in serials: Begin the process for receiving an item from an existing subscription. On the serials-edit page, find the "Click to add item" links and click to open the item edit forms. There should be one under the numbered issue and the supplemental issue forms. In both cases the item edit screen should show the mandatory item fields in red. Confirm that the cataloging add item form looks correct and works correctly. Revision: Left out the "required" note which should appear after each required field. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
f3b28a5d8a
commit
dcaa3ff704
10
C4/Items.pm
10
C4/Items.pm
|
|
@ -2797,21 +2797,21 @@ 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 type="text" 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="50" 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 type="text" 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="50" maxlength="255" />); # supply default input form
|
||||
}
|
||||
}
|
||||
elsif ( $tag eq '' ) { # it's an hidden field
|
||||
$subfield_data{marc_value} = qq(<input type="hidden" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" value="$defaultvalue" />);
|
||||
$subfield_data{marc_value} = qq(<input type="hidden" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" value="$defaultvalue" />);
|
||||
}
|
||||
elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ?
|
||||
$subfield_data{marc_value} = qq(<input type="text" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" value="$defaultvalue" />);
|
||||
$subfield_data{marc_value} = qq(<input type="text" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" value="$defaultvalue" />);
|
||||
}
|
||||
elsif ( length($defaultvalue) > 100
|
||||
or (C4::Context->preference("marcflavour") eq "UNIMARC" and
|
||||
|
|
@ -2820,7 +2820,7 @@ sub PrepareItemrecordDisplay {
|
|||
500 <= $tag && $tag < 600 )
|
||||
) {
|
||||
# oversize field (textarea)
|
||||
$subfield_data{marc_value} = qq(<textarea tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255">$defaultvalue</textarea>\n");
|
||||
$subfield_data{marc_value} = qq(<textarea tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255">$defaultvalue</textarea>\n");
|
||||
} else {
|
||||
$subfield_data{marc_value} = "<input type=\"text\" name=\"field_value\" value=\"$defaultvalue\" size=\"50\" maxlength=\"255\" />";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ sub generate_subfield_form {
|
|||
my $input = new CGI;
|
||||
$value = $input->param('barcode');
|
||||
}
|
||||
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="$subfield_data{maxlength}" );
|
||||
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" );
|
||||
my $attributes_no_value_textarea = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" rows="5" cols="64" );
|
||||
my $attributes = qq($attributes_no_value value="$value" );
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
<div class="yui-b">
|
||||
[% IF ( batch_details ) %]
|
||||
<h1>Add orders from [% comments %]
|
||||
([% file_name %] staged on [% upload_timestamp %])
|
||||
([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
|
||||
</h1>
|
||||
<div>
|
||||
<form action="[% scriptname %]" method="post" name="import_biblios">
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
</div>
|
||||
[% IF ( import_batch_id ) %]
|
||||
<div class="yui-b">
|
||||
<h2>Import All</h2>
|
||||
<h2>Import all</h2>
|
||||
<p>Import all the lines in the basket with the following parameters:</p>
|
||||
<form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
|
||||
<input type="hidden" name="op" value="import_records"/>
|
||||
|
|
@ -150,14 +150,18 @@
|
|||
<div id="itemblock">
|
||||
<ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
|
||||
<div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
|
||||
<label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
|
||||
[% IF (iteminformatio.mandatory) %]
|
||||
<label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
|
||||
[% ELSE %]
|
||||
<label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
|
||||
[% END %]
|
||||
[% iteminformatio.marc_value %]
|
||||
<input type="hidden" name="itemid" value="1" />
|
||||
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
|
||||
<input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
|
||||
<input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
|
||||
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
|
||||
[% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
|
||||
</div></li>
|
||||
[% END %]
|
||||
</ol>
|
||||
|
|
|
|||
|
|
@ -236,8 +236,11 @@ $(document).ready(function() {
|
|||
<div id="item[% item.serialid %][% item.countitems %]" class="items">
|
||||
<ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
|
||||
<div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
|
||||
<label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
|
||||
[% IF (iteminformatio.mandatory) %]
|
||||
<label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
|
||||
[% ELSE %]
|
||||
<label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
|
||||
[% END %]
|
||||
[% iteminformatio.marc_value %]
|
||||
<input type="hidden" name="itemid" value="[% item.itemid %]" />
|
||||
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
|
||||
|
|
@ -249,7 +252,7 @@ $(document).ready(function() {
|
|||
<img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
|
||||
[% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
|
||||
</div></li>
|
||||
[% END %]</ol></div><!-- /iteminformation -->
|
||||
|
||||
|
|
@ -344,8 +347,11 @@ $(document).ready(function() {
|
|||
<div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
|
||||
<ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
|
||||
<div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
|
||||
|
||||
<label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
|
||||
[% IF (iteminformatio.mandatory) %]
|
||||
<label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
|
||||
[% ELSE %]
|
||||
<label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
|
||||
[% END %]
|
||||
[% iteminformatio.marc_value %]
|
||||
<input type="hidden" name="itemid" value="[% newserialloo.itemid %]" />
|
||||
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
|
||||
|
|
@ -357,6 +363,7 @@ $(document).ready(function() {
|
|||
<img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
|
||||
</a>
|
||||
[% END %]
|
||||
[% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
|
||||
</div>
|
||||
</li>[% END %]</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ 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="67" maxlength="255" );
|
||||
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} ) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue