Bugzilla – Attachment 103215 Details for
Bug 18680
sort1/sort1 dropdowns (when mapped to authorized value) have no empty entry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18680: Add an empty entry by default to sort1/sort2 values in patron account
Bug-18680-Add-an-empty-entry-by-default-to-sort1so.patch (text/plain), 4.90 KB, created by
David Roberts
on 2020-04-19 15:52:59 UTC
(
hide
)
Description:
Bug 18680: Add an empty entry by default to sort1/sort2 values in patron account
Filename:
MIME Type:
Creator:
David Roberts
Created:
2020-04-19 15:52:59 UTC
Size:
4.90 KB
patch
obsolete
>From df78b293256c5273eb00da1bfda650f36caea34e Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Tue, 14 Apr 2020 16:57:38 +0000 >Subject: [PATCH] Bug 18680: Add an empty entry by default to sort1/sort2 > values in patron account > >When using sort1/sort2 with authorised values to create a pull down >list, there will be no empty entry unless one is manually added to >the authorised values list. > >This is not a good default behaviour, as it can easily >cause errors on patron creation. Without the empty entry, the first >alphabetic value is pre-selected and will be saved if not explicitly >changed. It also doesn't allow to mark sort1/sort2 as mandatory, >as the value is always 'set', the required message won't be triggered. > >This adds an empty parameter to av-build-dropbox.inc to allow selectively >adding this empty entry without causing side-effects in other places >this include is used. > >To test: >- Create authorised values for either Bsort1 or Bsort2 authorised > value category >- Create a new patron: > - you should see a pull down list on one and an input field for the other > - for the pull down list, there will be no empty entry and the first > alphabetic value will be preselected >- Make your sort1 and sort2 mandatory using BorrowerMandatoryField >- Verify there is still on empty entry >- Apply patch >- Repeat tests and verify that the behaviour is as expected > - There should now be an empty entry > - When the field is marked mandatory and empty is left, the required > warning will be shown. > >Signed-off-by: David Roberts <david@koha-ptfs.co.uk> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc | 6 ++++-- > koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 4 ++-- > 2 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc >index 4385125153..f3b57374fe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc >@@ -4,8 +4,9 @@ > [%# category: the authorised value category %] > [%# default: the default authorised value to select %] > [%# class: the CSS class of the select element %] >-[%# size: the size to use for the input (generated if the authorised value category does not exist). %] >-[%# all: add a "All" entry %] >+[%# size: the size to use for the input (generated if the authorised value category does not exist). %] >+[%# all: add a "All" entry. All and empty should not be used at the same time. %] >+[%# empty: add an empty entry. All and empty should not be used at the same time. %] > > [% SET avs = AuthorisedValues.GetAuthValueDropbox( category ) %] > [% DEFAULT class = '' size = 20 %] >@@ -13,6 +14,7 @@ > [% IF avs %] > <select id="[% name | html %]" name="[% name | html %]" class="[% class | html %]" > > [% IF all %]<option value="">All</option>[% END %] >+ [% IF empty %]<option value=""></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/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index eec68264d9..4b5eb35d12 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -847,7 +847,7 @@ legend:hover { > [% END %] > Sort 1: > </label> >- [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %] >+ [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, empty=1, size = 20 %] > [% IF ( mandatorysort1 ) %] > <span class="required">Required</span> > [% END %] >@@ -863,7 +863,7 @@ legend:hover { > [% END %] > Sort 2: > </label> >- [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %] >+ [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, empty=1, size = 20 %] > [% IF ( mandatorysort2 ) %] > <span class="required">Required</span> > [% 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 18680
:
103213
|
103214
|
103215
|
103257