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

1 parent f8df6b05
......@@ -36,6 +36,12 @@ Ext.define('MyMA.model.Users', {
}, {
name: 'manager',
type: 'int'
}, {
name: 'backup',
type: 'int'
}, {
name: 'backup_last',
type: 'date'
}],
validations: [{
type: 'format',
......
......@@ -73,6 +73,14 @@ Ext.define('MyMA.view.User', {
fieldLabel: 'Quota',
anchor: '60%',
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', {
}, {
header: 'uid',
dataIndex: 'uid',
hidden: true,
width: 40
}, {
header: 'gid',
dataIndex: 'gid',
hidden: true,
width: 40
}, {
header: 'Mail directory',
......@@ -123,6 +125,7 @@ Ext.define('MyMA.view.Users', {
}, {
header: 'SMTP',
dataIndex: 'smtp',
width: 55,
editor: {
xtype: 'combo',
valueField: 'id',
......@@ -140,6 +143,7 @@ Ext.define('MyMA.view.Users', {
}, {
header: 'IMAP',
dataIndex: 'imap',
width: 55,
editor: {
xtype: 'combo',
valueField: 'id',
......@@ -162,6 +166,16 @@ Ext.define('MyMA.view.Users', {
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',
width: 30,
items: [{
......
......@@ -52,7 +52,7 @@ class User extends ActiveRecord
public function rules()
{
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('smtp, imap, manager', 'numerical', 'on' => 'update', 'allowEmpty' => false, 'integerOnly' => true),
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!