sync
This commit is contained in:
@ -12,6 +12,7 @@ define(['common'], function (Common) {
|
||||
var namecontrol = undefined;
|
||||
var displaytextcontrol = undefined;
|
||||
var notescontrol = undefined;
|
||||
var displayonreportcontrol = undefined;
|
||||
s.prototype.createContent = function () {
|
||||
var _this = this;
|
||||
editable = true;
|
||||
@ -22,7 +23,7 @@ define(['common'], function (Common) {
|
||||
|
||||
var func = $('<div class="function_title"></div>');
|
||||
if (sectiontype == 0) {
|
||||
var btn = $('<span class="sbutton iconsave">' + GetTextByKey("P_IPT_SAVE","Save") + '</span>').click(function () {
|
||||
var btn = $('<span class="sbutton iconsave">' + GetTextByKey("P_IPT_SAVE", "Save") + '</span>').click(function () {
|
||||
saveData(0);
|
||||
});
|
||||
func.append(btn);
|
||||
@ -82,12 +83,18 @@ define(['common'], function (Common) {
|
||||
tb.append(tr);
|
||||
tr.append('<td class="label" style="vertical-align:middle;">' + GetTextByKey("P_IPT_DISPLAYTEXT_COLON", "Display Text:") + '<span class="redasterisk">*</span></td>');
|
||||
displaytextcontrol = $('<input type="text" maxlength="200" autocomplete="off"/>');
|
||||
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_XXX", "Language Selection") + '"/>');
|
||||
addiText = $('<span class="spanbtn iconmultitext" style="font-size:14px;" title="' + GetTextByKey("P_IPT_LANGUAGESELECTION", "Language Selection") + '"/>');
|
||||
addiText.click(function () {
|
||||
Common.createMultiTextDialog(displaytextcontrol, _this.section);
|
||||
});
|
||||
tr.append($('<td></td>').append(displaytextcontrol).append(addiText));
|
||||
|
||||
tr = $('<tr></tr>');
|
||||
tb.append(tr);
|
||||
tr.append('<td class="label">' + GetTextByKey("P_IPT_DISPLAYONREPORT_COLON", "Display on Report:") + '</td>');
|
||||
displayonreportcontrol = $('<input type="checkbox" />');
|
||||
tr.append($('<td></td>').append(displayonreportcontrol));
|
||||
|
||||
tr = $('<tr></tr>');
|
||||
tb.append(tr);
|
||||
tr.append('<td class="label">' + GetTextByKey("P_IPT_NOTES_COLON", "Notes:") + '</td>');
|
||||
@ -103,6 +110,10 @@ define(['common'], function (Common) {
|
||||
namecontrol.val(section.Name).data("texts", section.LocalNames);
|
||||
displaytextcontrol.val(section.DisplayText).data("texts", section.LocalDisplayTexts);
|
||||
notescontrol.val(section.Notes);
|
||||
displayonreportcontrol.attr('checked', section.DisplayOnReport);
|
||||
}
|
||||
else {
|
||||
displayonreportcontrol.attr('checked', true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,13 +121,15 @@ define(['common'], function (Common) {
|
||||
namecontrol.prop('disabled', true);
|
||||
displaytextcontrol.prop('disabled', true);
|
||||
notescontrol.prop('disabled', true);
|
||||
displayonreportcontrol.prop('disabled', true);
|
||||
}
|
||||
|
||||
function getData() {
|
||||
var item = {
|
||||
'Name': namecontrol.val(),
|
||||
'DisplayText': displaytextcontrol.val(),
|
||||
'Notes': notescontrol.val()
|
||||
'Notes': notescontrol.val(),
|
||||
'DisplayOnReport': displayonreportcontrol.prop('checked')
|
||||
};
|
||||
var texts = namecontrol.data("texts");
|
||||
if (texts) {
|
||||
@ -129,17 +142,17 @@ define(['common'], function (Common) {
|
||||
var alerttitle;
|
||||
if (_this.section) {
|
||||
item.Id = _this.section.Id;
|
||||
alerttitle = GetTextByKey("P_IPT_EDITSECTION","Edit Section");
|
||||
alerttitle = GetTextByKey("P_IPT_EDITSECTION", "Edit Section");
|
||||
} else {
|
||||
alerttitle = GetTextByKey("P_IPT_ADDSECTION","Add Section");
|
||||
alerttitle = GetTextByKey("P_IPT_ADDSECTION", "Add Section");
|
||||
}
|
||||
|
||||
if (!item.Name || item.Name.length == 0) {
|
||||
showAlert(GetTextByKey("P_IPT_NAMENOTBEEMPTY",'Name cannot be empty.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_IPT_NAMENOTBEEMPTY", 'Name cannot be empty.'), alerttitle);
|
||||
return false;
|
||||
}
|
||||
if (!item.DisplayText || item.DisplayText.length == 0) {
|
||||
showAlert(GetTextByKey("P_IPT_DISPLAYTEXTNOTBEEMPTY",'Display Text cannot be empty.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_IPT_DISPLAYTEXTNOTBEEMPTY", 'Display Text cannot be empty.'), alerttitle);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -162,7 +175,7 @@ define(['common'], function (Common) {
|
||||
_this.section = { 'Id': data[0] };
|
||||
}
|
||||
if (exit == 0) {
|
||||
showAlert(GetTextByKey("P_IPT_SAVSUCCESSFULLY",'Saved successfully.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_IPT_SAVSUCCESSFULLY", 'Saved successfully.'), alerttitle);
|
||||
_this.datasaved = true;
|
||||
}
|
||||
if (exit == 1) {
|
||||
@ -171,7 +184,7 @@ define(['common'], function (Common) {
|
||||
}
|
||||
}
|
||||
}, function (err) {
|
||||
showAlert(GetTextByKey("P_IPT_FAILEDTOSAVESECTION",'Failed to save Section.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_IPT_FAILEDTOSAVESECTION", 'Failed to save Section.'), alerttitle);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user