From e54da1edf342749bea7ebb2f8b65e21a9f262f62 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 21 Feb 2014 09:22:50 -0500 Subject: [PATCH] Bug 10751: standardize validation of title in staff purchase suggestions form MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The form for adding a new purchase suggestion in the staff client indicates that the title field is required but does nothing to enforce this rule. This can be handled client-side with HTML5 validation attributes and Koha's built-in validation plugin. This patch implements this. To test, apply the patch and go to Acquisitions -> Suggestions -> New purchase suggestion. Try submitting the form without entering a title. Doing so should trigger a validation warning. Submission of the form with valid data should work correctly. Editing an existing suggestion should also work correctly. The patch displays a message 'Required' near the title field. After submitting a empty title it changes to 'This field is required' Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart The title field is required since commit d565fb02e9fca2ac9c506e4e7d44fd8b0d66f06a This one makes it more consistent with formatting. It makes sense. Signed-off-by: Galen Charlton (cherry picked from commit 59b9078a3f7cf240bd814ee611e8f553d043491e) Signed-off-by: Fridolin Somers Conflicts: koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt Signed-off-by: Kyle M Hall (cherry picked from commit 0092cd702e706a3564bcfd1dcdc1457615c09bb1) --- .../prog/en/modules/suggestion/suggestion.tt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 8b37a91a1f..f3206ed76a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -259,7 +259,7 @@ $(document).ready(function() { calcNewsuggTotal(); });
[% IF ( op_save ) %] -
+ [% IF ( suggestionid ) %]

Edit purchase suggestion #[% suggestionid %]

@@ -267,7 +267,11 @@ $(document).ready(function() { calcNewsuggTotal(); });

Enter a new purchase suggestion

[% END %]
Bibliographic information
    -
  1. +
  2. + + + Required +
  3. -- 2.39.5