Добавлена поддержка полей для системы backup

1 parent f8df6b05
...@@ -36,6 +36,12 @@ Ext.define('MyMA.model.Users', { ...@@ -36,6 +36,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',
......
...@@ -73,6 +73,14 @@ Ext.define('MyMA.view.User', { ...@@ -73,6 +73,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
}] }]
}] }]
}); });
...@@ -112,10 +112,12 @@ Ext.define('MyMA.view.Users', { ...@@ -112,10 +112,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',
...@@ -123,6 +125,7 @@ Ext.define('MyMA.view.Users', { ...@@ -123,6 +125,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',
...@@ -140,6 +143,7 @@ Ext.define('MyMA.view.Users', { ...@@ -140,6 +143,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',
...@@ -162,6 +166,16 @@ Ext.define('MyMA.view.Users', { ...@@ -162,6 +166,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: [{
......
...@@ -52,7 +52,7 @@ class User extends ActiveRecord ...@@ -52,7 +52,7 @@ class User extends ActiveRecord
public function rules() public function rules()
{ {
return array( return array(
array('name, login, passwd, uid, gid, maildir, smtp, imap, quota, manager', 'default', 'on' => 'update'), array('name, login, passwd, uid, gid, maildir, smtp, imap, quota, manager, backup', 'default', 'on' => 'update'),
array('login, passwd, maildir', 'required', 'on' => 'update'), array('login, passwd, maildir', 'required', 'on' => 'update'),
array('smtp, imap, manager', 'numerical', 'on' => 'update', 'allowEmpty' => false, 'integerOnly' => true), array('smtp, imap, manager', 'numerical', 'on' => 'update', 'allowEmpty' => false, 'integerOnly' => true),
array('login', 'email', 'on' => 'update'), array('login', 'email', 'on' => 'update'),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!