2011-06-03 18:40:51 -04:00
|
|
|
Ext.onReady(function(){
|
|
|
|
|
|
|
|
|
|
var cmbLanguages = new Ext.form.ComboBox({
|
2012-03-29 16:42:09 -04:00
|
|
|
fieldLabel : _('ID_DEFAULT_LANGUAGE'),
|
2011-06-03 18:40:51 -04:00
|
|
|
hiddenName : 'lang',
|
|
|
|
|
store : new Ext.data.Store( {
|
|
|
|
|
proxy : new Ext.data.HttpProxy( {
|
|
|
|
|
url : 'loginSettingsAjax',
|
|
|
|
|
method : 'POST'
|
|
|
|
|
}),
|
|
|
|
|
baseParams : {request : 'getLangList'},
|
|
|
|
|
reader : new Ext.data.JsonReader( {
|
|
|
|
|
root : 'rows',
|
|
|
|
|
fields : [ {name : 'LAN_ID'}, {name : 'LAN_NAME'} ]
|
|
|
|
|
})
|
|
|
|
|
}),
|
|
|
|
|
valueField : 'LAN_ID',
|
|
|
|
|
displayField : 'LAN_NAME',
|
2013-03-14 15:15:04 -04:00
|
|
|
emptyText : _('ID_SELECT'),
|
2011-06-03 18:40:51 -04:00
|
|
|
selectOnFocus : true,
|
|
|
|
|
editable : false,
|
|
|
|
|
allowBlank : false,
|
|
|
|
|
listeners:{
|
2012-03-29 16:42:09 -04:00
|
|
|
select: function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
}
|
2011-06-03 18:40:51 -04:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cmbLanguages.store.on('load',function(){ cmbLanguages.setValue ( currentLang ) });
|
|
|
|
|
cmbLanguages.store.load();
|
|
|
|
|
saveButton = new Ext.Action({
|
|
|
|
|
text : _('ID_SAVE_SETTINGS'),
|
|
|
|
|
disabled : true,
|
|
|
|
|
handler : saveSettings
|
|
|
|
|
});
|
|
|
|
|
|
2012-03-29 16:42:09 -04:00
|
|
|
loginFields = new Ext.form.FieldSet({
|
2011-06-03 18:40:51 -04:00
|
|
|
title: _('ID_LOGIN_SETTINGS'),
|
|
|
|
|
items : [
|
2012-03-29 16:42:09 -04:00
|
|
|
cmbLanguages,
|
|
|
|
|
{
|
|
|
|
|
name: 'forgotPasswd',
|
2011-06-03 18:40:51 -04:00
|
|
|
xtype: 'checkbox',
|
2012-03-29 16:42:09 -04:00
|
|
|
checked: forgotPasswd,
|
2011-06-03 18:40:51 -04:00
|
|
|
fieldLabel: _('ID_ENABLE_FOTGOT_PASSWORD'),
|
|
|
|
|
listeners:{
|
2012-03-29 16:42:09 -04:00
|
|
|
check:function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'virtualKeyboad',
|
|
|
|
|
xtype: 'checkbox',
|
|
|
|
|
checked: virtualKeyboad,
|
|
|
|
|
fieldLabel: _('ID_ENABLE_VIRTUAL_KEYBOARD'),
|
|
|
|
|
listeners:{
|
|
|
|
|
check:function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
}
|
2011-06-03 18:40:51 -04:00
|
|
|
}
|
2012-07-10 17:55:22 -04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
xtype: 'panel',
|
|
|
|
|
anchor: '100%',
|
|
|
|
|
bodyStyle:'padding:5px',
|
|
|
|
|
frame: true,
|
|
|
|
|
height: 'auto',
|
2012-07-10 19:01:57 -04:00
|
|
|
html: _('ID_MESSAGE_LOGIN')
|
2011-10-19 09:15:51 -04:00
|
|
|
}
|
2011-06-03 18:40:51 -04:00
|
|
|
],
|
2012-03-29 16:42:09 -04:00
|
|
|
buttons : [saveButton]
|
2011-06-03 18:40:51 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2012-03-29 16:42:09 -04:00
|
|
|
var frm = new Ext.FormPanel({
|
2011-06-03 18:40:51 -04:00
|
|
|
title: ' ',
|
|
|
|
|
id:'frm',
|
|
|
|
|
labelWidth: 150,
|
2012-03-29 16:42:09 -04:00
|
|
|
width:460,
|
2011-06-03 18:40:51 -04:00
|
|
|
labelAlign:'right',
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
bodyStyle:'padding:2px',
|
|
|
|
|
waitMsgTarget : true,
|
|
|
|
|
frame: true,
|
|
|
|
|
|
|
|
|
|
defaults: {
|
|
|
|
|
allowBlank: false,
|
|
|
|
|
msgTarget: 'side',
|
|
|
|
|
align:'center'
|
|
|
|
|
},
|
|
|
|
|
items:[ loginFields ]
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
//render to process-panel
|
|
|
|
|
frm.render(document.body);
|
|
|
|
|
|
2012-03-29 16:42:09 -04:00
|
|
|
}); //end onready()
|
|
|
|
|
|
|
|
|
|
function saveSettings()
|
|
|
|
|
{
|
2011-06-03 18:40:51 -04:00
|
|
|
Ext.getCmp('frm').getForm().submit( {
|
|
|
|
|
url : 'loginSettingsAjax?request=saveSettings',
|
|
|
|
|
waitMsg : _('ID_SAVING_PROCESS'),
|
2013-09-02 10:55:45 -04:00
|
|
|
waitTitle : " ",
|
2011-06-03 18:40:51 -04:00
|
|
|
timeout : 36000,
|
|
|
|
|
success : function(obj, resp) {
|
|
|
|
|
//nothing to do
|
|
|
|
|
response = Ext.decode(resp.response.responseText);
|
2012-03-29 16:42:09 -04:00
|
|
|
parent.PMExt.notify(_('ID_INFO'),_('ID_SAVED_SUCCESSFULLY'));
|
2011-06-03 18:40:51 -04:00
|
|
|
saveButton.disable();
|
|
|
|
|
},
|
|
|
|
|
failure: function(obj, resp) {
|
|
|
|
|
Ext.Msg.alert( _('ID_ERROR'), resp.result.msg);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-29 16:42:09 -04:00
|
|
|
changeSettings = function()
|
|
|
|
|
{
|
2011-06-03 18:40:51 -04:00
|
|
|
saveButton.enable();
|
|
|
|
|
}
|