2012-03-29 16:42:09 -04:00
|
|
|
Ext.onReady(function(){
|
|
|
|
|
|
|
|
|
|
var cmbSkins = new Ext.form.ComboBox({
|
|
|
|
|
fieldLabel : _('ID_DEFAULT_SKIN'),
|
2012-04-05 12:52:33 -04:00
|
|
|
id : 'default_skin',
|
2012-03-29 16:42:09 -04:00
|
|
|
hiddenName : 'default_skin',
|
|
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields: ['ID', 'NAME'],
|
|
|
|
|
data : skinsList
|
|
|
|
|
}),
|
|
|
|
|
mode : 'local',
|
|
|
|
|
emptyText : _('ID_SELECT'),
|
|
|
|
|
valueField : 'ID',
|
|
|
|
|
displayField : 'NAME',
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
editable : true,
|
|
|
|
|
triggerAction: 'all',
|
|
|
|
|
allowBlank : false,
|
|
|
|
|
forceSelection: true,
|
|
|
|
|
listeners:{
|
|
|
|
|
select: function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
},
|
|
|
|
|
afterrender: function(){
|
|
|
|
|
i = cmbSkins.store.findExact('ID', sysConf.default_skin, 0);
|
|
|
|
|
if (i == -1) return;
|
|
|
|
|
cmbSkins.setValue(cmbSkins.store.getAt(i).data.ID);
|
|
|
|
|
cmbSkins.setRawValue(cmbSkins.store.getAt(i).data.NAME);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var cmbLang = new Ext.form.ComboBox({
|
2012-04-04 18:02:32 -04:00
|
|
|
fieldLabel : _('ID_DEFAULT_LANGUAGE'),
|
2012-04-05 12:52:33 -04:00
|
|
|
id : 'default_lang',
|
2012-03-29 16:42:09 -04:00
|
|
|
hiddenName : 'default_lang',
|
|
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields: ['ID', 'NAME'],
|
|
|
|
|
data : languagesList
|
|
|
|
|
}),
|
|
|
|
|
mode : 'local',
|
|
|
|
|
emptyText : _('ID_SELECT'),
|
|
|
|
|
valueField : 'ID',
|
|
|
|
|
displayField : 'NAME',
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
editable : true,
|
|
|
|
|
triggerAction: 'all',
|
|
|
|
|
forceSelection: true,
|
|
|
|
|
allowBlank : false,
|
|
|
|
|
listeners:{
|
|
|
|
|
select: function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
},
|
|
|
|
|
afterrender: function(){
|
|
|
|
|
i = cmbLang.store.findExact('ID', sysConf.default_lang, 0);
|
|
|
|
|
if (i == -1) return;
|
|
|
|
|
cmbLang.setValue(cmbLang.store.getAt(i).data.ID);
|
|
|
|
|
cmbLang.setRawValue(cmbLang.store.getAt(i).data.NAME);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var cmbTimeZone = new Ext.form.ComboBox({
|
|
|
|
|
fieldLabel : _('ID_TIME_ZONE'),
|
|
|
|
|
hiddenName : 'time_zone',
|
|
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields: ['ID', 'NAME'],
|
|
|
|
|
data : timeZonesList
|
|
|
|
|
}),
|
|
|
|
|
mode : 'local',
|
|
|
|
|
emptyText : _('ID_SELECT'),
|
|
|
|
|
valueField : 'ID',
|
|
|
|
|
displayField : 'NAME',
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
editable : true,
|
|
|
|
|
triggerAction: 'all',
|
|
|
|
|
forceSelection : true,
|
|
|
|
|
allowBlank : false,
|
|
|
|
|
listeners:{
|
|
|
|
|
select: function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-07-10 17:55:22 -04:00
|
|
|
|
2012-03-29 16:42:09 -04:00
|
|
|
cmbTimeZone.setValue(sysConf.time_zone);
|
|
|
|
|
|
|
|
|
|
saveButton = new Ext.Action({
|
|
|
|
|
text : _('ID_SAVE_SETTINGS'),
|
|
|
|
|
disabled : true,
|
|
|
|
|
handler : saveSettings
|
|
|
|
|
});
|
2012-07-10 17:55:22 -04:00
|
|
|
|
|
|
|
|
xfieldsUp = new Ext.form.FieldSet({
|
2012-03-29 16:42:09 -04:00
|
|
|
title: _('ID_SYSTEM_SETTINGS'),
|
|
|
|
|
items : [
|
|
|
|
|
cmbTimeZone,
|
|
|
|
|
{
|
|
|
|
|
xtype: 'numberfield',
|
|
|
|
|
id : 'memory_limit',
|
|
|
|
|
name : 'memory_limit',
|
2012-04-04 18:02:32 -04:00
|
|
|
fieldLabel: _('ID_MEMORY_LIMIT'),
|
2012-03-29 16:42:09 -04:00
|
|
|
allowBlank: false,
|
|
|
|
|
value: sysConf.memory_limit,
|
|
|
|
|
listeners:{
|
|
|
|
|
change: function(){
|
|
|
|
|
changeSettings();
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-10 17:55:22 -04:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
xfieldsBelow = new Ext.form.FieldSet({
|
|
|
|
|
title: '',
|
|
|
|
|
items : [
|
|
|
|
|
cmbSkins,
|
|
|
|
|
cmbLang,
|
2012-03-29 16:42:09 -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_SYSTEM')+" "+_('ID_MESSAGE_SYSTEM2')
|
2012-07-10 17:55:22 -04:00
|
|
|
}
|
|
|
|
|
]
|
2012-03-29 16:42:09 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var frm = new Ext.FormPanel({
|
|
|
|
|
title: ' ',
|
|
|
|
|
id:'frm',
|
|
|
|
|
labelWidth: 170,
|
|
|
|
|
width:460,
|
|
|
|
|
labelAlign:'right',
|
|
|
|
|
autoScroll: true,
|
2012-07-10 17:55:22 -04:00
|
|
|
bodyStyle:'padding:5px',
|
2012-03-29 16:42:09 -04:00
|
|
|
waitMsgTarget : true,
|
|
|
|
|
frame: true,
|
|
|
|
|
|
|
|
|
|
defaults: {
|
|
|
|
|
allowBlank: false,
|
|
|
|
|
msgTarget: 'side',
|
|
|
|
|
align:'center'
|
|
|
|
|
},
|
2012-07-10 17:55:22 -04:00
|
|
|
items:[ xfieldsUp, xfieldsBelow ],
|
|
|
|
|
buttons : [saveButton]
|
2012-03-29 16:42:09 -04:00
|
|
|
|
|
|
|
|
});
|
|
|
|
|
//render to process-panel
|
|
|
|
|
frm.render(document.body);
|
|
|
|
|
|
|
|
|
|
}); //end onready()
|
|
|
|
|
|
|
|
|
|
function saveSettings()
|
|
|
|
|
{
|
|
|
|
|
Ext.getCmp('frm').getForm().submit( {
|
|
|
|
|
url : '../adminProxy/saveSystemConf',
|
|
|
|
|
waitMsg : _('ID_SAVING_PROCESS'),
|
|
|
|
|
timeout : 36000,
|
|
|
|
|
success : function(obj, resp) {
|
|
|
|
|
//nothing to do
|
|
|
|
|
response = Ext.decode(resp.response.responseText);
|
|
|
|
|
parent.PMExt.notify(_('ID_INFO'),_('ID_SAVED_SUCCESSFULLY'));
|
|
|
|
|
|
|
|
|
|
if(response.restart) {
|
2012-04-04 18:02:32 -04:00
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_SYSTEM_REDIRECT_CONFIRM'), function(){
|
2012-03-29 16:42:09 -04:00
|
|
|
if (typeof window.parent.parent != 'undefined')
|
2012-04-05 12:52:33 -04:00
|
|
|
window.parent.parent.location.href = response.url;
|
2012-03-29 16:42:09 -04:00
|
|
|
if (typeof window.parent != 'undefined')
|
2012-04-05 12:52:33 -04:00
|
|
|
window.parent.location.href = response.url;
|
2012-03-29 16:42:09 -04:00
|
|
|
else
|
2012-04-05 12:52:33 -04:00
|
|
|
window.location.href = response.url;
|
2012-03-29 16:42:09 -04:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
saveButton.disable();
|
|
|
|
|
},
|
|
|
|
|
failure: function(obj, resp) {
|
|
|
|
|
PMExt.error( _('ID_ERROR'), resp.result.message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeSettings = function()
|
|
|
|
|
{
|
|
|
|
|
saveButton.enable();
|
|
|
|
|
}
|