Browse Source

Bug 11019 - Require some fields when adding authorized value category

This patch modifies the form for adding an authorized value so that
the category is a required fields.
Previously a new authorized value category could be saved with no data.

To test, apply the patch and go to Administration -> Authorized values.

- Click the "New category" button.
- Click the save button without filling in the category.
  You should be prevented from submitting the form.
- Verify that filling in the required field allows the form to be
  submitted.
- Perform the same test when editing an existing authorized value.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Follow-up for QA: Allow a blank authorised value to be created.

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>
Amended test plan.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
16.11.x
Owen Leonard 8 years ago
committed by Kyle M Hall
parent
commit
a5b0aa20e5
  1. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt

8
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt

@ -76,12 +76,14 @@ $(document).ready(function() {
[% IF ( action_modify ) %]<div class="note"><i class="fa fa-exclamation"></i> <strong>NOTE:</strong> If you change an authorized value code, existing records using it won't be updated. Changes to value descriptions will show immediately.</div>[% END %]
<form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post">
<form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated">
<input type="hidden" name="op" value="add" />
<fieldset class="rows"><ol>
<li>
[% IF ( action_add_category ) %]<label for="category">Category: </label>
<input type="text" name="category" id="category" size="32" maxlength="32" class="focus" />
[% IF ( action_add_category ) %]
<label for="category" class="required">Category: </label>
<input type="text" name="category" id="category" size="32" maxlength="32" class="focus required" />
<span class="required">Required</span>
[% ELSE %]<span class="label">Category</span>
<input type="hidden" name="category" value="[% category %]" /> [% category %]
[% END %]

Loading…
Cancel
Save