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>
This commit is contained in:
David Cook 2022-08-11 05:40:45 +00:00 committed by Tomas Cohen Arazi
parent 21e4995a31
commit 5c1db538e6
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

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