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>
(cherry picked from commit a5b0aa20e5)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5b1b874557)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Owen Leonard 2016-08-18 11:58:42 -04:00 committed by Julian Maurice
parent b277edf1a9
commit 01e6632c0e
1 changed files with 5 additions and 3 deletions

View File

@ -76,12 +76,14 @@ $(document).ready(function() {
[% IF ( action_modify ) %]<div class="note"><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 %]