Bugzilla – Attachment 114737 Details for
Bug 27297
When itemtype is marked as required in OpacSuggestion MandatoryFields the field is not required
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27297: Add required and blank options to av-build-dropbox.inc
Bug-27297-Add-required-and-blank-options-to-av-bui.patch (text/plain), 3.01 KB, created by
Kelly McElligott
on 2020-12-29 23:29:54 UTC
(
hide
)
Description:
Bug 27297: Add required and blank options to av-build-dropbox.inc
Filename:
MIME Type:
Creator:
Kelly McElligott
Created:
2020-12-29 23:29:54 UTC
Size:
3.01 KB
patch
obsolete
>From 23160e82389e823b8f04429a5f9829a1ce2f3a76 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 22 Dec 2020 19:28:28 +0000 >Subject: [PATCH] Bug 27297: Add required and blank options to > av-build-dropbox.inc > >This patch adds two options to av-build-drobx >required - which will add the required attribute to the select >blank - which will add a blank option to avoid preselecting others > >To test: >1 - In OpacSuggestionMandatoryFeilds select itemtype >2 - Go to OPAC >3 - Add a suggestion >4 - Don't fill out any fields >5 - Submit >6 - Suggestion is added >7 - Delete it >8 - Apply patch >9 - Add a suggestion >10 - Note itemtyp edefaults to 'None' >11 - You cannot submit until you select a value > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc | 9 ++++++++- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 2 +- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc >index 8e88cb55fc..0bcf878792 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc >@@ -10,8 +10,15 @@ > [% DEFAULT class = '' size = 20 %] > > [% IF avs %] >- <select id="[% name | html %]" name="[% name | html %]" class="[% class | html %]" > >+ [% IF required %] >+ <select id="[% name | html %]" name="[% name | html %]" class="[% class | html %]" required="required"> >+ [% ELSE %] >+ <select id="[% name | html %]" name="[% name | html %]" class="[% class | html %]"> >+ [% END %] > [% FOR av IN avs %] >+ [% IF blank %] >+ <option value="">None</option> >+ [% END %] > [% IF av.authorised_value == default %] > <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html_entity %]</option> > [% ELSE %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index c5d8ef650d..f034a88447 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -166,7 +166,7 @@ > <li> > [% IF ( itemtype_required ) %] > <label for="itemtype" class="required">Item type:</label> >- [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %] >+ [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, required = 1, blank = 1 %] > <span class="required">Required</span> > [% ELSE %] > <label for="itemtype">Item type:</label> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27297
:
114620
|
114737
|
115020
|
115215
|
115219