Bug 31450: Make additional contents publication date required
HTML customizations and news will not display without a publication date, so we should make it required. This patch adds client-side validation of the field to check that it's filled. To test, apply the patch and go to Tools -> News (or HTML customizations, or Pages). - Click "New entry" - Try to submit this new entry without entering a publication date. - You should be prevented from submitting the form. - Fill in the publication date and confirm that the form submits correctly. Sponsored-by: Athens County Public Libraries Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
57a068ca6f
commit
1b1e96a17c
|
|
@ -220,7 +220,7 @@
|
|||
[% END %]
|
||||
</div>
|
||||
|
||||
<form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validate">
|
||||
<form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validated">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-add_validate" />
|
||||
<input type="hidden" name="category" value="[% category | html %]" />
|
||||
|
|
@ -260,8 +260,9 @@
|
|||
</li>
|
||||
[% END %]
|
||||
<li>
|
||||
<label for="from">Publication date: </label>
|
||||
<input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="flatpickr" data-date_to="to" />
|
||||
<label for="from" class="required">Publication date: </label>
|
||||
<input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="flatpickr" data-date_to="to" required="required" class="required" />
|
||||
<span class="required">Required</span>
|
||||
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
Loading…
Reference in New Issue