Bug 31294: Show "Required" label on mandatory fields

This patch adds "Required" label on mandatory fields for Article Requests

0. Apply the patch
1. koha-plack --restart kohadev
2. Change syspref 'ArticleRequests' to 'Enable'
3. Change syspref 'ArticleRequestsMandatoryFields' to '[Select all]'
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
5. Click "Request article" for "Gairm"
6. Note that "Title", "Author", "Volume", "Issue", "Date", "Pages", and
   "Chapters" all say required
7. Change syspref 'ArticleRequestsMandatoryFields' to 'Title' and
   'Author'
8. Go to http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=29
9. Note that only "Title" and "Author" say required

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5c1db538e6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
David Cook 2022-08-11 05:40:45 +00:00 committed by Lucas Gass
parent 528bb4af53
commit 369087c7de

View file

@ -75,6 +75,7 @@
[% IF mandatory_fields.search('title') %] [% IF mandatory_fields.search('title') %]
<label for="title" class="required">Title:</label> <label for="title" class="required">Title:</label>
<input type="text" required="required" name="title" id="title" size="50" value="[% title | html %]"/> <input type="text" required="required" name="title" id="title" size="50" value="[% title | html %]"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="title">Title:</label> <label for="title">Title:</label>
<input type="text" name="title" id="title" size="50" value="[% title | html %]"/> <input type="text" name="title" id="title" size="50" value="[% title | html %]"/>
@ -85,6 +86,7 @@
[% IF mandatory_fields.search('author') %] [% IF mandatory_fields.search('author') %]
<label for="author" class="required">Author:</label> <label for="author" class="required">Author:</label>
<input type="text" required="required" name="author" id="author" size="50" value="[% author | html %]"/> <input type="text" required="required" name="author" id="author" size="50" value="[% author | html %]"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="author">Author:</label> <label for="author">Author:</label>
<input type="text" name="author" id="author" size="50" value="[% author | html %]"/> <input type="text" name="author" id="author" size="50" value="[% author | html %]"/>
@ -95,6 +97,7 @@
[% IF mandatory_fields.search('volume') %] [% IF mandatory_fields.search('volume') %]
<label for="volume" class="required">Volume:</label> <label for="volume" class="required">Volume:</label>
<input type="text" required="required" name="volume" id="volume" size="50"/> <input type="text" required="required" name="volume" id="volume" size="50"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="volume">Volume:</label> <label for="volume">Volume:</label>
<input type="text" name="volume" id="volume" size="50"/> <input type="text" name="volume" id="volume" size="50"/>
@ -105,6 +108,7 @@
[% IF mandatory_fields.search('issue') %] [% IF mandatory_fields.search('issue') %]
<label for="issue" class="required">Issue:</label> <label for="issue" class="required">Issue:</label>
<input type="text" required="required" name="issue" id="issue" size="50"/> <input type="text" required="required" name="issue" id="issue" size="50"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="issue">Issue:</label> <label for="issue">Issue:</label>
<input type="text" name="issue" id="issue" size="50"/> <input type="text" name="issue" id="issue" size="50"/>
@ -115,6 +119,7 @@
[% IF mandatory_fields.search('date') %] [% IF mandatory_fields.search('date') %]
<label for="date" class="required">Date:</label> <label for="date" class="required">Date:</label>
<input type="text" required="required" name="date" id="date" size="50"/> <input type="text" required="required" name="date" id="date" size="50"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="date">Date:</label> <label for="date">Date:</label>
<input type="text" name="date" id="date" size="50"/> <input type="text" name="date" id="date" size="50"/>
@ -130,6 +135,7 @@
[% IF mandatory_fields.search('pages') %] [% IF mandatory_fields.search('pages') %]
<label for="pages" class="required">Pages:</label> <label for="pages" class="required">Pages:</label>
<input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/> <input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="pages">Pages:</label> <label for="pages">Pages:</label>
<input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/> <input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
@ -140,6 +146,7 @@
[% IF mandatory_fields.search('chapters') %] [% IF mandatory_fields.search('chapters') %]
<label for="chapters" class="required">Chapters:</label> <label for="chapters" class="required">Chapters:</label>
<input type="text" required="required" name="chapters" id="chapters" size="50"/> <input type="text" required="required" name="chapters" id="chapters" size="50"/>
<div class="required_label required">Required</div>
[% ELSE %] [% ELSE %]
<label for="chapters">Chapters:</label> <label for="chapters">Chapters:</label>
<input type="text" name="chapters" id="chapters" size="50"/> <input type="text" name="chapters" id="chapters" size="50"/>