Bug 16047 [Follow-up] Software error on deleting a group with no category code
authorOwen Leonard <oleonard@myacpl.org>
Thu, 17 Mar 2016 13:08:39 +0000 (09:08 -0400)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 14:41:07 +0000 (16:41 +0200)
This follow-up take the original patch a little further, making category
name required on the entry form as well. Without a category name there
is no label in the interface when selecting a category. That doens't
make any sense.

Also changed on the group entry form:

- Added "required" attribute to labels on required fields.
- Changed "Update" submit button label to "Submit."
- Added a "Cancel" link.
- Added the "validated" class to the form so that our built-in
  validation script will process it (not strictly necessary but makes
  the validation appearance more consistent).

Followed test plan, form displays and behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit df127ebad814ad1710b161b85a69d408de95de85)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit c514e1fee2890660caa36c1dae62bcfbc6f72fc3)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt

index 7d28a63..f7c768e 100644 (file)
@@ -308,7 +308,7 @@ tinyMCE.init({
 
 [% IF ( editcategory ) %]
     <h3>[% IF ( categorycode ) %]Edit group [% categorycode %][% ELSE %]Add group[% END %]</h3>
-    <form action="[% action %]" name="Aform" method="post">
+    <form action="[% action %]" name="Aform" method="post" class="validated">
     <input type="hidden" name="op" value="addcategory_validate" />
        [% IF ( categorycode ) %]
        <input type="hidden" name="add" value="0">
@@ -323,14 +323,15 @@ tinyMCE.init({
                     <input type="hidden" name="categorycode" id="categorycode" value="[% categorycode |html %]" />
                     [% categorycode %]
                 [% ELSE %]
-                <label for="categorycode">Category code:</label>
+                <label for="categorycode" class="required">Category code:</label>
                     <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required" required="required" />
                     <span class="required">Required</span>
                 [% END %]
             </li>
         <li>
-            <label for="categoryname">Name: </label>
-            <input type="text" name="categoryname" id="categoryname" size="32" maxlength="32" value="[% categoryname |html %]" />
+            <label for="categoryname" class="required">Name: </label>
+            <input type="text" name="categoryname" id="categoryname" size="32" maxlength="32" value="[% categoryname |html %]" class="required" required="required"/>
+            <span class="required">Required</span>
         </li>
         <li>
             <label for="codedescription">Description: </label>
@@ -358,7 +359,10 @@ tinyMCE.init({
         </li>
                </ol>
     </fieldset>
-       <fieldset class="action"><input type="submit" value="Update" /></fieldset>
+    <fieldset class="action">
+        <input type="submit" value="Submit" />
+        <a href="/cgi-bin/koha/admin/branches.pl" class="cancel">Cancel</a>
+    </fieldset>
     </form>
 [% END %]