#set ($BD_COLLECT_TIME = $CommonFunctions.encodeJavaScriptString($CommonFunctions.getTermFromResourceBundle($currentUserId, "FocusAdmin", "burndowndialog.label.timetocollect"))) #set ($BD_TITLE = $CommonFunctions.encodeJavaScriptString($CommonFunctions.getTermFromResourceBundle($currentUserId, "FocusAdmin", "burndowndialog.title"))) #set ($DLG_SAVE = $CommonFunctions.encodeJavaScriptString($CommonFunctions.getTermFromResourceBundle($currentUserId, "GStoryDialog", "dialog.button.save"))) #set ($DLG_CANCEL = $CommonFunctions.encodeJavaScriptString($CommonFunctions.getTermFromResourceBundle($currentUserId, "GStoryDialog", "dialog.button.cancel"))) #set ($EDIT_BURNDOWN_TITLE = $CommonFunctions.encodeJavaScriptString($CommonFunctions.getTermFromResourceBundle($currentUserId, "FocusAdmin", "burndowndialog.success.title"))) // ---------- Confidence Enumeration Field Set up Dialog ---------- var burndownSetting = { dialog : null, init : function() { if(!burndownSetting.dialog) { burndownSetting.dlgFormRec = Ext.data.Record.create( [ { name:'bdtime' } ]); burndownSetting.timeCombo = new Ext.form.TimeField({ fieldLabel: '$BD_COLLECT_TIME', name: 'bdtime', allowBlank: false, increment: 15 }); burndownSetting.fmCtrl = new Ext.FormPanel({ buttonAlign: 'right', labelAlign: 'right', labelWidth: 120, frame:true, width: 320, reader: new Ext.data.JsonReader({}, burndownSetting.dlgFormRec), items: [burndownSetting.timeCombo], buttons: [{ id: 'bdSettingSaveButton', text: '$DLG_SAVE', handler: function(){ if(!burndownSetting.fmCtrl.form.isValid()) { BxtUtil.showErrorMsg("The entered value is invalid. Please re-enter valid values and save again.") return; } burndownSetting.submit(burndownSetting.timeCombo.getValue()); } }, { text: '$DLG_CANCEL', handler: function() { burndownSetting.dialog.hide(); } }] }); burndownSetting.dialog = new Ext.Window({ title: '$BD_TITLE', layout:'fit', width:320, height:120, closeAction:'hide', plain: true, items: burndownSetting.fmCtrl, modal: true, resizable : false, closable: true, renderTo: document.body }); } }, show : function() { burndownSetting.init(); var fdataUrl = 'focus/FocusAdminHandler?action=LOAD-FOCUSDATA' ; burndownSetting.fmCtrl.form.load({url: fdataUrl, failure: function( form, action) { var respText = action.response.responseText; BxtUtil.showErrorMsg('FailureType:' + action.failureType + ' responseText:' + respText); }}); burndownSetting.dialog.show(); }, submit : function(v) { Ext.Ajax.request({ url: 'focus/FocusAdminHandler?action=SAVE-FOCUSDATA', success: burndownSetting.success, failure: confidenceEnumSetupDialog.failure, params: {dataid: 'BurndownTime', value: v} }); }, success : function(resp, options) { var sresp = eval('(' + resp.responseText +')'); if(sresp.success) { Ext.Msg.show({ title: '$EDIT_BURNDOWN_TITLE', msg: ''+ sresp.data[0].msg +'', buttons: Ext.Msg.OK, icon: Ext.MessageBox.INFO }); burndownSetting.dialog.hide(); } else { BxtUtil.showErrorMsg(sresp.data[0].msg); } }, failure : function(resp, options) { BxtUtil.showErrorMsg('An error occurred while saving the Burndown settings.' + resp.status); } };