Исправления и доработки

Исправлены ошибки:
- После выхода из интерфейса и повторный вход - возникала ошибка при
попытке открыть предыдущих открытых форм
- Исправлена ошибка поиска почтового аккаунта, ошибка проявилась после
перехода на новую структуру данных

Доработки:
- Сделан перевод фокуса между открытыми формами
1 parent 9b44882a
...@@ -17,6 +17,9 @@ Ext.define('MyMA.controller.Aliases', { ...@@ -17,6 +17,9 @@ Ext.define('MyMA.controller.Aliases', {
}, },
'aliases actioncolumn': { 'aliases actioncolumn': {
click: this.onActionColumn click: this.onActionColumn
},
'aliases > grid': {
afterrender: this.onGridRender
} }
}); });
}, },
...@@ -80,5 +83,13 @@ Ext.define('MyMA.controller.Aliases', { ...@@ -80,5 +83,13 @@ Ext.define('MyMA.controller.Aliases', {
*/ */
onSearch: function(Button) { onSearch: function(Button) {
this.getAliasesList().getStore().reload({ params: Button.up('toolbar').getValues() }); this.getAliasesList().getStore().reload({ params: Button.up('toolbar').getValues() });
},
/**
* Fires when widget is shown
*/
onGridRender: function(grid) {
grid.getStore().reload();
} }
}); });
...@@ -108,7 +108,13 @@ Ext.define('MyMA.controller.Taskpanel', { ...@@ -108,7 +108,13 @@ Ext.define('MyMA.controller.Taskpanel', {
} }
if ((widget = Ext.getCmp(record.get('item')))) { if ((widget = Ext.getCmp(record.get('item')))) {
widget[record.get('state') == 'show' ? 'hide' : 'show'](); if(record.get('state') == 'show' && Ext.WindowManager.getActive() != widget) {
widget.toFront();
Ext.getCmp(record.get('control')).toggle(true, true);
}
else {
widget[record.get('state') == 'show' ? 'hide' : 'show']();
}
} }
}, },
...@@ -117,11 +123,12 @@ Ext.define('MyMA.controller.Taskpanel', { ...@@ -117,11 +123,12 @@ Ext.define('MyMA.controller.Taskpanel', {
* Close all process those are registed in the Programs storage * Close all process those are registed in the Programs storage
*/ */
closeAll: function() { closeAll: function() {
this.getStore('Programs').each(function(record){ var widgets = this.getStore('Programs').collect('item');
if ((widget = Ext.getCmp(record.get('item')))) {
widget.hide(); Ext.Array.each(widgets, function(item) {
this.getTaskPanel().items.get(record.get('control')).destroy(); if ((widget = Ext.getCmp(item))) {
widget.close();
} }
}, this); });
} }
}); });
...@@ -48,6 +48,7 @@ Ext.define('MyMA.controller.Users', { ...@@ -48,6 +48,7 @@ Ext.define('MyMA.controller.Users', {
widget.setTitle('User: ' + record.get('name')); widget.setTitle('User: ' + record.get('name'));
widget.down('form').getForm().loadRecord(record); widget.down('form').getForm().loadRecord(record);
widget.down('form').down('combo[name=domid]').getStore().reload();
} }
if(e.getTarget('.x-ibtn-delete')) { if(e.getTarget('.x-ibtn-delete')) {
var record = scope.store.getAt(rowIndex); var record = scope.store.getAt(rowIndex);
...@@ -74,10 +75,11 @@ Ext.define('MyMA.controller.Users', { ...@@ -74,10 +75,11 @@ Ext.define('MyMA.controller.Users', {
* @param {Object} Button * @param {Object} Button
*/ */
showForm: function(Button) { showForm: function(Button) {
this.getController('Taskpanel').addProgram({ var widget = this.getController('Taskpanel').addProgram({
name: 'user', name: 'user',
title: 'New User' title: 'New User'
}); });
widget.down('form').down('combo[name=domid]').getStore().reload();
}, },
......
...@@ -116,8 +116,13 @@ Ext.define('MyMA.controller.Viewport', { ...@@ -116,8 +116,13 @@ Ext.define('MyMA.controller.Viewport', {
setGuest: function(state) { setGuest: function(state) {
this.isGuest = Ext.isBoolean(state) ? state : true; this.isGuest = Ext.isBoolean(state) ? state : true;
if(this.isGuest && !this.getAuthPanel()) { if(this.isGuest) {
this.getView('Authorize').create(); if(!this.getAuthPanel()) {
this.getView('Authorize').create();
}
else {
this.Authorize();
}
} }
}, },
...@@ -188,11 +193,11 @@ Ext.define('MyMA.controller.Viewport', { ...@@ -188,11 +193,11 @@ Ext.define('MyMA.controller.Viewport', {
method: 'PUT', method: 'PUT',
scope: this, scope: this,
callback: function() { callback: function() {
this.setGuest(this, true);
if(this.getAppView()) { if(this.getAppView()) {
this.getController('Taskpanel').closeAll(); this.getController('Taskpanel').closeAll();
this.getAppView().destroy(); this.getAppView().destroy();
} }
this.setGuest(this, true);
} }
}); });
} }
......
...@@ -2,7 +2,6 @@ Ext.define('MyMA.store.UserTransport', { ...@@ -2,7 +2,6 @@ Ext.define('MyMA.store.UserTransport', {
extend: 'Ext.data.Store', extend: 'Ext.data.Store',
requires: 'MyMA.model.Transports', requires: 'MyMA.model.Transports',
model: 'MyMA.model.Transports', model: 'MyMA.model.Transports',
autoLoad: true,
remoteSort: true, remoteSort: true,
pageSize: 100 pageSize: 100
}); });
...@@ -78,6 +78,7 @@ Ext.define('MyMA.view.Aliases', { ...@@ -78,6 +78,7 @@ Ext.define('MyMA.view.Aliases', {
features: [{ features: [{
ftype: 'grouping', ftype: 'grouping',
id: 'alias-groups', id: 'alias-groups',
enableGroupingMenu: false,
groupHeaderTpl: 'Group: {name} ({rows.length})', groupHeaderTpl: 'Group: {name} ({rows.length})',
startCollapsed: false startCollapsed: false
}], }],
......
...@@ -105,6 +105,7 @@ Ext.define('MyMA.view.User', { ...@@ -105,6 +105,7 @@ Ext.define('MyMA.view.User', {
allowDecimal: false, allowDecimal: false,
fieldLabel: 'Backup (day)', fieldLabel: 'Backup (day)',
anchor: '60%', anchor: '60%',
value: 0,
maxValue: 7, maxValue: 7,
minValue: 0 minValue: 0
}] }]
......
...@@ -54,8 +54,15 @@ class UserController extends WRestController ...@@ -54,8 +54,15 @@ class UserController extends WRestController
$criteria->order = implode(", ", $sort); $criteria->order = implode(", ", $sort);
} }
if (!is_null( ($value = Yii::app()->request->getParam('query')) )) {
$criteria->compare("name", $value, true, 'OR');
$criteria->compare("login", $value, true, 'OR');
}
$models = $model->with('transport')->findAll($criteria); $models = $model->with('transport')->findAll($criteria);
$result = array();
if ($models) { if ($models) {
foreach ($models as $item) { foreach ($models as $item) {
$result[] = array_merge($item->getAllAttributes(), array("domain" => $item->transport->domain)); $result[] = array_merge($item->getAllAttributes(), array("domain" => $item->transport->domain));
......
...@@ -560,10 +560,12 @@ Ext.define('MyMA.view.Users', { ...@@ -560,10 +560,12 @@ Ext.define('MyMA.view.Users', {
}, { }, {
header: 'uid', header: 'uid',
dataIndex: 'uid', dataIndex: 'uid',
hidden: true,
width: 40 width: 40
}, { }, {
header: 'gid', header: 'gid',
dataIndex: 'gid', dataIndex: 'gid',
hidden: true,
width: 40 width: 40
}, { }, {
header: 'Mail directory', header: 'Mail directory',
...@@ -571,6 +573,7 @@ Ext.define('MyMA.view.Users', { ...@@ -571,6 +573,7 @@ Ext.define('MyMA.view.Users', {
}, { }, {
header: 'SMTP', header: 'SMTP',
dataIndex: 'smtp', dataIndex: 'smtp',
width: 55,
editor: { editor: {
xtype: 'combo', xtype: 'combo',
valueField: 'id', valueField: 'id',
...@@ -588,6 +591,7 @@ Ext.define('MyMA.view.Users', { ...@@ -588,6 +591,7 @@ Ext.define('MyMA.view.Users', {
}, { }, {
header: 'IMAP', header: 'IMAP',
dataIndex: 'imap', dataIndex: 'imap',
width: 55,
editor: { editor: {
xtype: 'combo', xtype: 'combo',
valueField: 'id', valueField: 'id',
...@@ -610,6 +614,16 @@ Ext.define('MyMA.view.Users', { ...@@ -610,6 +614,16 @@ Ext.define('MyMA.view.Users', {
allowDecimal: false allowDecimal: false
} }
}, { }, {
header: 'Backup (days)',
dataIndex: 'backup',
renderer: function(value) {
return value == 0 ? 'Off' : value;
}
}, {
header: 'Last Backup',
dataIndex: 'backup_last',
renderer: Ext.util.Format.dateRenderer('d.m.Y H:i')
}, {
xtype: 'actioncolumn', xtype: 'actioncolumn',
width: 30, width: 30,
items: [{ items: [{
...@@ -696,6 +710,14 @@ Ext.define('MyMA.view.User', { ...@@ -696,6 +710,14 @@ Ext.define('MyMA.view.User', {
fieldLabel: 'Quota', fieldLabel: 'Quota',
anchor: '60%', anchor: '60%',
value: 100000000 value: 100000000
}, {
xtype: 'numberfield',
name: 'backup',
allowDecimal: false,
fieldLabel: 'Backup (day)',
anchor: '60%',
maxValue: 7,
minValue: 0
}] }]
}] }]
}); });
...@@ -988,6 +1010,12 @@ Ext.define('MyMA.model.Users', { ...@@ -988,6 +1010,12 @@ Ext.define('MyMA.model.Users', {
}, { }, {
name: 'manager', name: 'manager',
type: 'int' type: 'int'
}, {
name: 'backup',
type: 'int'
}, {
name: 'backup_last',
type: 'date'
}], }],
validations: [{ validations: [{
type: 'format', type: 'format',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!