2010-11-07 19:47:58 +01:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2010, Sebastian Sdorra
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
|
* 3. Neither the name of SCM-Manager; nor the names of its
|
|
|
|
|
* contributors may be used to endorse or promote products derived from this
|
|
|
|
|
* software without specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
|
|
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*
|
|
|
|
|
* http://bitbucket.org/sdorra/scm-manager
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// register namespace
|
|
|
|
|
Ext.ns('Sonia.user');
|
|
|
|
|
|
2010-11-29 21:18:22 +01:00
|
|
|
|
|
|
|
|
// functions
|
|
|
|
|
|
|
|
|
|
Sonia.user.setEditPanel = function(panel){
|
|
|
|
|
var editPanel = Ext.getCmp('userEditPanel');
|
|
|
|
|
editPanel.removeAll();
|
|
|
|
|
editPanel.add(panel);
|
|
|
|
|
editPanel.doLayout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Panels
|
|
|
|
|
|
|
|
|
|
Sonia.user.DefaultPanel = {
|
|
|
|
|
region: 'south',
|
|
|
|
|
title: 'User Form',
|
|
|
|
|
padding: 5,
|
|
|
|
|
xtype: 'panel',
|
|
|
|
|
html: 'Add or select an User'
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-07 19:47:58 +01:00
|
|
|
// UserGrid
|
2010-11-08 20:10:20 +01:00
|
|
|
Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
|
2010-11-07 19:47:58 +01:00
|
|
|
|
2011-03-05 13:26:58 +01:00
|
|
|
titleText: 'User Form',
|
|
|
|
|
colNameText: 'Name',
|
|
|
|
|
colDisplayNameText: 'Display Name',
|
|
|
|
|
colMailText: 'Mail',
|
|
|
|
|
colAdminText: 'Admin',
|
|
|
|
|
colCreationDateText: 'Creation Date',
|
|
|
|
|
colLastModifiedText: 'Last modified',
|
|
|
|
|
colTypeText: 'Type',
|
|
|
|
|
|
2010-11-07 19:47:58 +01:00
|
|
|
initComponent: function(){
|
|
|
|
|
|
|
|
|
|
var userStore = new Sonia.rest.JsonStore({
|
2011-02-13 16:31:02 +01:00
|
|
|
proxy: new Ext.data.HttpProxy({
|
|
|
|
|
url: restUrl + 'users.json',
|
|
|
|
|
disableCaching: false
|
|
|
|
|
}),
|
2011-01-13 20:19:06 +01:00
|
|
|
fields: [ 'name', 'displayName', 'mail', 'admin', 'creationDate', 'lastModified', 'type'],
|
2010-11-07 19:47:58 +01:00
|
|
|
sortInfo: {
|
|
|
|
|
field: 'name'
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var userColModel = new Ext.grid.ColumnModel({
|
|
|
|
|
defaults: {
|
|
|
|
|
sortable: true,
|
|
|
|
|
scope: this,
|
|
|
|
|
width: 125
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
2011-03-05 13:26:58 +01:00
|
|
|
{id: 'name', header: this.colNameText, dataIndex: 'name'},
|
|
|
|
|
{id: 'displayName', header: this.colDisplayNameText, dataIndex: 'displayName', width: 250},
|
|
|
|
|
{id: 'mail', header: this.colMailText, dataIndex: 'mail', renderer: this.renderMailto, width: 200},
|
|
|
|
|
{id: 'admin', header: this.colAdminText, dataIndex: 'admin', renderer: this.renderCheckbox, width: 50},
|
|
|
|
|
{id: 'creationDate', header: this.colCreationDateText, dataIndex: 'creationDate'},
|
|
|
|
|
{id: 'lastModified', header: this.colLastModifiedText, dataIndex: 'lastModified'},
|
|
|
|
|
{id: 'type', header: this.colTypeText, dataIndex: 'type', width: 80}
|
2010-11-07 19:47:58 +01:00
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
|
store: userStore,
|
2010-11-08 20:10:20 +01:00
|
|
|
colModel: userColModel
|
2010-11-07 19:47:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
|
|
|
|
Sonia.user.Grid.superclass.initComponent.apply(this, arguments);
|
|
|
|
|
},
|
|
|
|
|
|
2010-11-08 20:10:20 +01:00
|
|
|
selectItem: function(item){
|
2010-11-13 11:54:51 +01:00
|
|
|
if ( debug ){
|
|
|
|
|
console.debug( item.name + ' selected' );
|
|
|
|
|
}
|
|
|
|
|
var panel = new Sonia.user.FormPanel({
|
|
|
|
|
item: item,
|
|
|
|
|
region: 'south',
|
2011-03-05 13:26:58 +01:00
|
|
|
title: this.titleText,
|
2010-11-13 11:54:51 +01:00
|
|
|
padding: 5,
|
|
|
|
|
onUpdate: {
|
|
|
|
|
fn: this.reload,
|
|
|
|
|
scope: this
|
|
|
|
|
},
|
|
|
|
|
onCreate: {
|
|
|
|
|
fn: this.reload,
|
|
|
|
|
scope: this
|
|
|
|
|
}
|
|
|
|
|
});
|
2010-12-05 17:46:26 +01:00
|
|
|
if ( item.type == 'xml' ){
|
|
|
|
|
panel.getForm().setValues([
|
|
|
|
|
{id: 'password', value: dummyPassword},
|
|
|
|
|
{id: 'password-confirm', value: dummyPassword}
|
|
|
|
|
]);
|
|
|
|
|
}
|
2010-11-29 21:18:22 +01:00
|
|
|
Sonia.user.setEditPanel(panel);
|
2010-11-07 19:47:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// register xtype
|
2010-11-08 20:10:20 +01:00
|
|
|
Ext.reg('userGrid', Sonia.user.Grid);
|
2010-11-10 18:37:41 +01:00
|
|
|
|
2010-11-13 11:54:51 +01:00
|
|
|
// passord validator
|
2010-11-13 11:12:14 +01:00
|
|
|
Ext.apply(Ext.form.VTypes, {
|
|
|
|
|
password: function(val, field) {
|
|
|
|
|
if (field.initialPassField) {
|
|
|
|
|
var pwd = Ext.getCmp(field.initialPassField);
|
|
|
|
|
return (val == pwd.getValue());
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
passwordText: 'The passwords entered do not match!'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2010-11-10 18:37:41 +01:00
|
|
|
// UserFormPanel
|
|
|
|
|
Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
|
|
|
|
|
|
2011-03-05 13:26:58 +01:00
|
|
|
nameText: 'Name',
|
|
|
|
|
displayNameText: 'Display name',
|
|
|
|
|
mailText: 'Mail',
|
|
|
|
|
passwordText: 'Password',
|
|
|
|
|
adminText: 'Administrator',
|
|
|
|
|
errorTitleText: 'Error',
|
|
|
|
|
updateErrorMsgText: 'User update failed',
|
|
|
|
|
createErrorMsgText: 'User creation failed',
|
2011-03-07 19:38:59 +01:00
|
|
|
passwordMinLengthText: 'Password must be at least 6 characters long',
|
|
|
|
|
|
|
|
|
|
// help
|
2011-03-10 16:29:20 +01:00
|
|
|
usernameHelpText: 'The unique name of the user.',
|
|
|
|
|
displayNameHelpText: 'The display name of the user.',
|
|
|
|
|
mailHelpText: 'The email address of the user.',
|
|
|
|
|
passwordHelpText: 'The plain text password of the user.',
|
2011-03-07 19:38:59 +01:00
|
|
|
passwordConfirmHelpText: 'Repeat the password for validation.',
|
|
|
|
|
adminHelpText: 'An administrator is able to create, modify and delete repositories, groups and users.',
|
2011-03-05 13:26:58 +01:00
|
|
|
|
2010-11-10 18:37:41 +01:00
|
|
|
initComponent: function(){
|
|
|
|
|
|
2010-12-05 17:46:26 +01:00
|
|
|
var items = [{
|
2011-03-05 13:26:58 +01:00
|
|
|
fieldLabel: this.nameText,
|
2010-12-05 17:46:26 +01:00
|
|
|
name: 'name',
|
|
|
|
|
allowBlank: false,
|
2011-03-07 19:38:59 +01:00
|
|
|
readOnly: this.item != null,
|
|
|
|
|
helpText: this.usernameHelpText
|
2010-12-05 17:46:26 +01:00
|
|
|
},{
|
2011-03-05 13:26:58 +01:00
|
|
|
fieldLabel: this.displayNameText,
|
2010-12-05 17:46:26 +01:00
|
|
|
name: 'displayName',
|
2011-03-07 19:38:59 +01:00
|
|
|
allowBlank: false,
|
|
|
|
|
helpText: this.displayNameHelpText
|
2010-12-05 17:46:26 +01:00
|
|
|
},{
|
2011-03-05 13:26:58 +01:00
|
|
|
fieldLabel: this.mailText,
|
2010-12-05 17:46:26 +01:00
|
|
|
name: 'mail',
|
2011-01-02 12:41:19 +01:00
|
|
|
allowBlank: true,
|
2011-03-07 19:38:59 +01:00
|
|
|
vtype: 'email',
|
|
|
|
|
helpText: this.mailHelpText
|
2010-12-05 17:46:26 +01:00
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
if ( this.item == null || this.item.type == 'xml' ){
|
|
|
|
|
items.push({
|
2011-03-05 13:26:58 +01:00
|
|
|
fieldLabel: this.passwordText,
|
2010-11-13 11:12:14 +01:00
|
|
|
id: 'pwd',
|
2010-11-10 18:37:41 +01:00
|
|
|
name: 'password',
|
2010-11-13 11:12:14 +01:00
|
|
|
inputType: 'password',
|
|
|
|
|
minLength: 6,
|
|
|
|
|
maxLength: 32,
|
2011-03-07 19:38:59 +01:00
|
|
|
minLengthText: this.passwordMinLengthText,
|
|
|
|
|
helpText: this.passwordHelpText
|
2010-11-10 18:37:41 +01:00
|
|
|
},{
|
2010-11-13 11:54:51 +01:00
|
|
|
name: 'password-confirm',
|
2010-11-13 11:12:14 +01:00
|
|
|
inputType: 'password',
|
|
|
|
|
minLength: 6,
|
|
|
|
|
maxLength: 32,
|
2011-03-05 13:26:58 +01:00
|
|
|
minLengthText: this.passwordMinLengthText,
|
2010-11-13 11:12:14 +01:00
|
|
|
vtype: 'password',
|
2011-03-07 19:38:59 +01:00
|
|
|
initialPassField: 'pwd',
|
|
|
|
|
helpText: this.passwordConfirmHelpText
|
2010-12-05 17:46:26 +01:00
|
|
|
});
|
|
|
|
|
}
|
2010-11-10 18:37:41 +01:00
|
|
|
|
2010-12-05 17:46:26 +01:00
|
|
|
items.push({
|
2011-03-05 13:26:58 +01:00
|
|
|
fieldLabel: this.adminText,
|
2010-12-05 17:46:26 +01:00
|
|
|
name: 'admin',
|
2011-03-07 19:38:59 +01:00
|
|
|
xtype: 'checkbox',
|
|
|
|
|
helpText: this.adminHelpText
|
2010-12-05 17:46:26 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Ext.apply(this, Ext.apply(this.initialConfig, {items: items}));
|
2010-11-10 18:37:41 +01:00
|
|
|
Sonia.user.FormPanel.superclass.initComponent.apply(this, arguments);
|
|
|
|
|
},
|
|
|
|
|
|
2010-12-30 13:51:13 +01:00
|
|
|
fixRequest: function(user){
|
|
|
|
|
delete user['password-confirm'];
|
|
|
|
|
},
|
|
|
|
|
|
2010-11-10 18:37:41 +01:00
|
|
|
update: function(item){
|
2010-11-13 11:54:51 +01:00
|
|
|
|
|
|
|
|
item = Ext.apply( this.item, item );
|
|
|
|
|
if ( debug ){
|
|
|
|
|
console.debug( 'update user: ' + item.name );
|
|
|
|
|
}
|
2010-12-30 13:51:13 +01:00
|
|
|
this.fixRequest(item);
|
2010-11-13 11:54:51 +01:00
|
|
|
var url = restUrl + 'users/' + item.name + '.json';
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: url,
|
|
|
|
|
jsonData: item,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
scope: this,
|
|
|
|
|
success: function(){
|
|
|
|
|
if ( debug ){
|
|
|
|
|
console.debug('update success');
|
|
|
|
|
}
|
|
|
|
|
this.execCallback(this.onUpdate, item);
|
|
|
|
|
},
|
|
|
|
|
failure: function(){
|
2010-12-19 15:13:45 +01:00
|
|
|
Ext.MessageBox.show({
|
2011-03-05 13:26:58 +01:00
|
|
|
title: this.errorTitleText,
|
|
|
|
|
msg: this.updateErrorMsgText,
|
2010-12-19 15:13:45 +01:00
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
icon:Ext.MessageBox.ERROR
|
|
|
|
|
});
|
2010-11-13 11:54:51 +01:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2010-11-10 18:37:41 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
create: function(user){
|
|
|
|
|
if ( debug ){
|
|
|
|
|
console.debug( 'create user: ' + user.name );
|
|
|
|
|
}
|
2010-12-30 13:51:13 +01:00
|
|
|
this.fixRequest(user);
|
2010-11-10 18:37:41 +01:00
|
|
|
// set user type
|
|
|
|
|
user.type = 'xml';
|
|
|
|
|
var url = restUrl + 'users.json';
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: url,
|
|
|
|
|
jsonData: user,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
scope: this,
|
|
|
|
|
success: function(){
|
|
|
|
|
if ( debug ){
|
|
|
|
|
console.debug('create success');
|
|
|
|
|
}
|
|
|
|
|
this.getForm().reset();
|
|
|
|
|
this.execCallback(this.onCreate, user);
|
|
|
|
|
},
|
|
|
|
|
failure: function(){
|
2010-12-19 15:13:45 +01:00
|
|
|
Ext.MessageBox.show({
|
2011-03-05 13:26:58 +01:00
|
|
|
title: this.errorTitleText,
|
|
|
|
|
msg: this.createErrorMsgText,
|
2010-12-19 15:13:45 +01:00
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
icon:Ext.MessageBox.ERROR
|
|
|
|
|
});
|
2010-11-10 18:37:41 +01:00
|
|
|
}
|
|
|
|
|
});
|
2010-11-29 21:18:22 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cancel: function(){
|
|
|
|
|
Sonia.user.setEditPanel( Sonia.user.DefaultPanel );
|
2010-11-10 18:37:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// register xtype
|
|
|
|
|
Ext.reg('userForm', Sonia.user.FormPanel);
|
|
|
|
|
|
|
|
|
|
// UserPanel
|
|
|
|
|
Sonia.user.Panel = Ext.extend(Ext.Panel, {
|
|
|
|
|
|
2011-03-05 13:26:58 +01:00
|
|
|
addText: 'Add',
|
|
|
|
|
removeText: 'Remove',
|
|
|
|
|
reloadText: 'Reload',
|
|
|
|
|
titleText: 'User Form',
|
|
|
|
|
emptyText: 'Add or select an User',
|
|
|
|
|
removeTitleText: 'Remove User',
|
|
|
|
|
removeMsgText: 'Remove User "{0}"?',
|
|
|
|
|
errorTitleText: 'Error',
|
|
|
|
|
errorMsgText: 'User deletion failed',
|
|
|
|
|
|
2010-11-10 18:37:41 +01:00
|
|
|
initComponent: function(){
|
|
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
|
layout: 'border',
|
|
|
|
|
hideMode: 'offsets',
|
|
|
|
|
bodyCssClass: 'x-panel-mc',
|
|
|
|
|
enableTabScroll: true,
|
|
|
|
|
region:'center',
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
tbar: [
|
2011-03-05 13:26:58 +01:00
|
|
|
{xtype: 'tbbutton', text: this.addText, scope: this, handler: this.showAddPanel},
|
|
|
|
|
{xtype: 'tbbutton', text: this.removeText, scope: this, handler: this.removeUser},
|
2010-11-10 18:37:41 +01:00
|
|
|
'-',
|
2011-03-05 13:26:58 +01:00
|
|
|
{xtype: 'tbbutton', text: this.reloadText, scope: this, handler: this.reload}
|
2010-11-10 18:37:41 +01:00
|
|
|
],
|
|
|
|
|
items: [{
|
|
|
|
|
id: 'userGrid',
|
|
|
|
|
xtype: 'userGrid',
|
|
|
|
|
region: 'center'
|
|
|
|
|
},{
|
|
|
|
|
id: 'userEditPanel',
|
|
|
|
|
layout: 'fit',
|
|
|
|
|
items: [{
|
|
|
|
|
region: 'south',
|
|
|
|
|
title: 'User Form',
|
|
|
|
|
xtype: 'panel',
|
|
|
|
|
padding: 5,
|
2011-03-05 13:26:58 +01:00
|
|
|
html: this.emptyText
|
2010-11-10 18:37:41 +01:00
|
|
|
}],
|
|
|
|
|
height: 250,
|
|
|
|
|
split: true,
|
|
|
|
|
border: false,
|
|
|
|
|
region: 'south'
|
|
|
|
|
}]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
|
|
|
|
Sonia.user.Panel.superclass.initComponent.apply(this, arguments);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
showAddPanel: function(){
|
|
|
|
|
var editPanel = Ext.getCmp('userEditPanel');
|
|
|
|
|
editPanel.removeAll();
|
|
|
|
|
var panel = new Sonia.user.FormPanel({
|
|
|
|
|
region: 'south',
|
2011-03-05 13:26:58 +01:00
|
|
|
title: this.titleText,
|
2010-11-10 18:37:41 +01:00
|
|
|
padding: 5,
|
|
|
|
|
onUpdate: {
|
|
|
|
|
fn: this.reload,
|
|
|
|
|
scope: this
|
|
|
|
|
},
|
|
|
|
|
onCreate: {
|
|
|
|
|
fn: this.reload,
|
|
|
|
|
scope: this
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
editPanel.add(panel);
|
|
|
|
|
editPanel.doLayout();
|
|
|
|
|
},
|
2010-11-13 11:54:51 +01:00
|
|
|
|
2010-11-29 21:18:22 +01:00
|
|
|
resetPanel: function(){
|
|
|
|
|
Sonia.user.setEditPanel( Sonia.user.DefaultPanel );
|
2010-11-13 11:54:51 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
removeUser: function(){
|
|
|
|
|
|
|
|
|
|
var grid = Ext.getCmp('userGrid');
|
|
|
|
|
var selected = grid.getSelectionModel().getSelected();
|
|
|
|
|
if ( selected ){
|
|
|
|
|
var item = selected.data;
|
|
|
|
|
var url = restUrl + 'users/' + item.name + '.json';
|
|
|
|
|
|
|
|
|
|
Ext.MessageBox.show({
|
2011-03-05 13:26:58 +01:00
|
|
|
title: this.removeTitleText,
|
|
|
|
|
msg: String.format(this.removeMsgText, item.name),
|
2010-11-13 11:54:51 +01:00
|
|
|
buttons: Ext.MessageBox.OKCANCEL,
|
|
|
|
|
icon: Ext.MessageBox.QUESTION,
|
|
|
|
|
fn: function(result){
|
|
|
|
|
if ( result == 'ok' ){
|
|
|
|
|
|
|
|
|
|
if ( debug ){
|
|
|
|
|
console.debug( 'remove user ' + item.name );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: url,
|
|
|
|
|
method: 'DELETE',
|
|
|
|
|
scope: this,
|
|
|
|
|
success: function(){
|
|
|
|
|
this.reload();
|
|
|
|
|
this.resetPanel();
|
|
|
|
|
},
|
|
|
|
|
failure: function(){
|
2010-12-19 15:13:45 +01:00
|
|
|
Ext.MessageBox.show({
|
2011-03-05 13:26:58 +01:00
|
|
|
title: this.errorTitleText,
|
|
|
|
|
msg: this.errorMsgText,
|
2010-12-19 15:13:45 +01:00
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
icon:Ext.MessageBox.ERROR
|
|
|
|
|
});
|
2010-11-13 11:54:51 +01:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
scope: this
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else if ( debug ){
|
2011-01-04 17:50:00 +01:00
|
|
|
console.debug( 'no user selected' );
|
2010-11-13 11:54:51 +01:00
|
|
|
}
|
2010-11-10 18:37:41 +01:00
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
reload: function(){
|
2010-11-13 11:54:51 +01:00
|
|
|
Ext.getCmp('userGrid').reload();
|
2010-11-10 18:37:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// register xtype
|
|
|
|
|
Ext.reg('userPanel', Sonia.user.Panel);
|