Bugzilla – Attachment 115215 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.44 KB, created by
PTFS Europe Sandboxes
on 2021-01-15 21:49:17 UTC
(
hide
)
Description:
Bug 27297: Add required and blank options to av-build-dropbox.inc
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2021-01-15 21:49:17 UTC
Size:
3.44 KB
patch
obsolete
>From 693264d05da9220b22672ef4e703b4da46fd5b0c 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: Barbara Johnson <barbara.johnson@bedfordtx.gov> >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc | 9 ++++++++- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 4 ++-- > 2 files changed, 10 insertions(+), 3 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..9b833fcfe0 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,7 +10,14 @@ > [% 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 %] >+ [% IF blank %] >+ <option value="">None</option> >+ [% END %] > [% FOR av IN avs %] > [% IF av.authorised_value == default %] > <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html_entity %]</option> >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..3320a57555 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -166,11 +166,11 @@ > <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> >- [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %] >+ [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, blank = 1 %] > [% END %] > </li> > [% END %] >-- >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