bug 7262: global settings page - if no value is assigned, display "Not applicable". (merge from 2.2.beta1 branch to master branch)

This commit is contained in:
Jessica Wang 2010-11-23 16:53:29 -08:00
parent eb6169ad1e
commit 952dec199a

View File

@ -58,11 +58,17 @@ function populateGlobalSettingGrid() {
});
}
var notApplicable = "Not applicable";
var globalsettingGridIndex = 0;
function globalsettingJSONToTemplate(jsonObj, template) {
(globalsettingGridIndex++ % 2 == 0)? template.addClass("even"): template.addClass("odd");
template.find("#name").text(fromdb(jsonObj.name));
template.find("#value").text(fromdb(jsonObj.value));
if(fromdb(jsonObj.value).length > 0)
template.find("#value").text(fromdb(jsonObj.value));
else
template.find("#value").text(notApplicable);
template.find("#value_edit").val(fromdb(jsonObj.value));
template.find("#description").text(fromdb(jsonObj.description));
}
@ -90,7 +96,11 @@ function doEditGlobalSetting() {
function doEditGlobalSetting2($readonlyFields, $editFields) {
$("#right_panel_content #tab_content_details").find("#globalsetting_template").each(function(index) {
var $thisRow =$(this);
var $thisRow =$(this);
if($thisRow.find("#value_edit").val() == "" && $thisRow.find("#value").text() == notApplicable)
return;
if($thisRow.find("#value_edit").val() != $thisRow.find("#value").text()) {
// validate values
var isValid = true;