[Rt-commit] rt branch, 4.4/select-cf-hide-invalid-empty-values, created. rt-4.2.3-203-g3155be6

? sunnavy sunnavy at bestpractical.com
Thu Jun 12 08:50:06 EDT 2014


The branch, 4.4/select-cf-hide-invalid-empty-values has been created
        at  3155be6e61ca7bfeef22a96da84e38e630728931 (commit)

- Log -----------------------------------------------------------------
commit 3155be6e61ca7bfeef22a96da84e38e630728931
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jun 12 20:31:22 2014 +0800

    hide "(no value)" from select cfs if it doesn't match pattern
    
    this is initially for mandatory validation: it's weird that the
    cf is mandatory but we offer a "(no value)" option

diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect
index e1c010b..c3418de 100644
--- a/share/html/Elements/EditCustomFieldSelect
+++ b/share/html/Elements/EditCustomFieldSelect
@@ -104,10 +104,12 @@ jQuery(  function () {
 <fieldset class="cfedit">
 <div data-name="<%$name%>" id="<%$name%>">
 %   if ( $checktype eq 'radio' ) {
+% if ( $CustomField->MatchPattern('') ) {
   <div class="none">
   <input class="none" type="<% $checktype %>" name="<% $name %>" id="<% $name %>-none" value="" <% keys %default ? '' : ' checked="checked"' |n%> />
   <label for="<% $name %>-none"><&|/l&>(no value)</&></label><br />
   </div>
+% }
 %   }
 %   my $CFVs = $CustomField->Values;
 %   while ( my $value = $CFVs->Next ) {
@@ -125,7 +127,9 @@ jQuery(  function () {
 %# this hidden select is to supply a full list of values,
 %# see filter_cascade_select() in js/cascaded.js
       <select name="<%$name%>-Complete" id="<%$name%>-Complete" class="hidden" disabled="disabled">
+% if ( $CustomField->MatchPattern('') ) {
         <option value=""<% !$selected && qq[ selected="selected"] |n %>><&|/l&>(no value)</&></option>
+% }
 %       $m->out($out);
       </select>
 % }
@@ -135,7 +139,9 @@ jQuery(  function () {
   size="<% $Rows %>"
 % }
 <% $Multiple && qq[multiple="multiple"] |n %> >
+% if ( $CustomField->MatchPattern('') ) {
 <option value=""<% !$selected && qq[ selected="selected"] |n %>><&|/l&>(no value)</&></option>
+% }
 % $m->out($out);
 </select>
 % }

-----------------------------------------------------------------------


More information about the rt-commit mailing list