BUGFIX: fixed issue with rule based validation trying to save the default rule

This commit is contained in:
Will Rossiter 2009-06-25 06:55:42 +00:00
parent 2fb5441019
commit 1d3d309582
4 changed files with 15 additions and 10 deletions

View File

@ -195,7 +195,7 @@
} }
/* HIDE */ /* HIDE */
#Fields_fields li.EditableFormField div.hidden { #Fields_fields li.EditableFormField .hidden {
display: none; display: none;
} }

View File

@ -59,9 +59,7 @@
//update the internal lists //update the internal lists
var name = $("#Fields_fields li.EditableFormField:last").attr("id").split(' '); var name = $("#Fields_fields li.EditableFormField:last").attr("id").split(' ');
$("#Fields_fields select.fieldOption").each(function(i, domElement) { $("#Fields_fields select.fieldOption").append("<option value='"+ name[2] +"'>New "+ name[2] + "</option>");
$(domElement).append("<option value='"+ name[2] +"'>New "+ name[2] + "</option>");
});
}, },
// error creating new field // error creating new field

View File

@ -91,7 +91,14 @@
<label><% _t('WHEN', 'When') %></label> <label><% _t('WHEN', 'When') %></label>
<select class="fieldOption customRuleField" name="{$FieldName}[CustomRules][ConditionField]"> <select class="fieldOption customRuleField" name="{$FieldName}[CustomRules][ConditionField]">
<option></option>
<% control Parent %>
<% if Fields %>
<% control Fields %>
<option value="$Name"><% if Title %>$Title<% else %>$Name<% end_if %></option>
<% end_control %>
<% end_if %>
<% end_control %>
</select> </select>
<label><% _t('IS', 'Is') %></label> <label><% _t('IS', 'Is') %></label>
@ -120,5 +127,5 @@
<!-- Hidden option Fields --> <!-- Hidden option Fields -->
<input type="hidden" class="canDeleteHidden" name="{$FieldName}[CanDelete]" value="$CanDelete" /> <input type="hidden" class="canDeleteHidden" name="{$FieldName}[CanDelete]" value="$CanDelete" />
<input type="hidden" class="typeHidden" name="{$FieldName}[Type]" value="$ClassName" /> <input type="hidden" class="typeHidden" name="{$FieldName}[Type]" value="$ClassName" />
<input type="hidden" class="sortHidden" name="{$FieldName}[Sort]" value="$Sort" /> <input type="hidden" class="sortHidden" name="{$FieldName}[Sort]" value="$Sort" />
</li> </li>

View File

@ -1,10 +1,10 @@
<select class="displayOption customRuleField" name="{$Name}[CustomRules][$Pos][Display]"> <select class="displayOption customRuleField" name="{$FieldName}[CustomRules][$Pos][Display]">
<option value="Show" <% if Display = Show %>selected="selected"<% end_if %>><% _t('SHOWTHISFIELD', 'Show This Field') %></option> <option value="Show" <% if Display = Show %>selected="selected"<% end_if %>><% _t('SHOWTHISFIELD', 'Show This Field') %></option>
<option value="Hide" <% if Display = Hide %><% if First %><% else %>selected="selected"<% end_if %><% end_if %>><% _t('HIDETHISFIELD', 'Hide This Field') %></option> <option value="Hide" <% if Display = Hide %><% if First %><% else %>selected="selected"<% end_if %><% end_if %>><% _t('HIDETHISFIELD', 'Hide This Field') %></option>
</select> </select>
<label><% _t('WHEN', 'When') %></label> <label><% _t('WHEN', 'When') %></label>
<select class="fieldOption customRuleField" name="{$Name}[CustomRules][$Pos][ConditionField]"> <select class="fieldOption customRuleField" name="{$FieldName}[CustomRules][$Pos][ConditionField]">
<option value="" selected="selected"></option> <option value="" selected="selected"></option>
<% control Fields %> <% control Fields %>
<option value="$BaseName" <% if isSelected %>selected="selected"<% end_if %>>$Title</option> <option value="$BaseName" <% if isSelected %>selected="selected"<% end_if %>>$Title</option>
@ -12,7 +12,7 @@
</select> </select>
<label><% _t('IS', 'Is') %></label> <label><% _t('IS', 'Is') %></label>
<select class="conditionOption customRuleField" name="{$Name}[CustomRules][$Pos][ConditionOption]"> <select class="conditionOption customRuleField" name="{$FieldName}[CustomRules][$Pos][ConditionOption]">
<option value=""></option> <option value=""></option>
<option value="IsBlank" <% if ConditionOption = IsBlank %>selected="selected"<% end_if %>><% _t('BLANK', 'Blank') %></option> <option value="IsBlank" <% if ConditionOption = IsBlank %>selected="selected"<% end_if %>><% _t('BLANK', 'Blank') %></option>
<option value="IsNotBlank" <% if ConditionOption = IsNotBlank %>selected="selected"<% end_if %>><% _t('NOTBLANK', 'Not Blank') %></option> <option value="IsNotBlank" <% if ConditionOption = IsNotBlank %>selected="selected"<% end_if %>><% _t('NOTBLANK', 'Not Blank') %></option>
@ -20,6 +20,6 @@
<option value="ValueNot" <% if ConditionOption = ValueNot %>selected="selected"<% end_if %>><% _t('NOTVALUE', 'Not Value') %></option> <option value="ValueNot" <% if ConditionOption = ValueNot %>selected="selected"<% end_if %>><% _t('NOTVALUE', 'Not Value') %></option>
</select> </select>
<input type="text" class="ruleValue <% if Value %><% else %>hidden<% end_if %> customRuleField" name="{$Name}[CustomRules][$Pos][Value]" value="$Value" /> <input type="text" class="ruleValue <% if Value %><% else %>hidden<% end_if %> customRuleField" name="{$FieldName}[CustomRules][$Pos][Value]" value="$Value" />
<a href="#" class="deleteCondition" title="<% _t('DELETE', 'Delete') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'Delete') %>" /></a> <a href="#" class="deleteCondition" title="<% _t('DELETE', 'Delete') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'Delete') %>" /></a>