/**
*
* generic person list - used by perms. and staff lists.
+ *
+ * -- this is probably depreciated now..
*
*/
Pman.Tab.PersonList = function(config)
{
- Ext.apply(this, config);
+ Roo.apply(this, config);
}
Pman.Tab.PersonList.prototype = {
// teams!?!
alert('person list not configured');
return false;
+ /*
var tms = _this.getLeftSelections();
if (tms.length) {
o.params['query[type]'] = this.type; // group type..
o.params['query[person_internal_only_all]'] = 1;
o.params['query[person_inactive]'] = this.showInActive ? 0 : 1;
+ */
},
}
this.parentLayout = parentLayout;
- this.layout = new Ext.BorderLayout(
+ this.layout = new Roo.BorderLayout(
parentLayout.getEl().createChild({tag:'div'}),
{
center: {
- autoScroll:true,
+ autoScroll:false,
hideTabs: true
}
}
- this.tab = parentLayout.add(region, new Ext.NestedLayoutPanel(
- this.layout, {title: this.title, background: true, controller : this}));
+ this.tab = parentLayout.add(region,
+ new Roo.NestedLayoutPanel(
+ this.layout, {
+ title: this.title,
+ background: true,
+ controller : this
+ }));
this.tab.on('activate', function() {
_this.delayedCreate();
this.layout.beginUpdate();
var frm = this.layout.getRegion('center').getEl().createChild({tag:'div'});
- //this.grid = new Ext.grid.EditorGrid(frm, {
- this.grid = new Ext.grid.Grid(frm, {
+ //this.grid = new Roo.grid.EditorGrid(frm, {
+ this.grid = new Roo.grid.Grid(frm, {
ddGroup: 'groupDD',
//enableDrag: true,
enableDrag: true,
id: this.id + '-grid',
- ds: new Ext.data.Store({
+ ds: new Roo.data.Store({
// load using HTTP
- proxy: new Ext.data.HttpProxy({
- url: baseURL + '/Roo/Person.html',
+ proxy: new Roo.data.HttpProxy({
+ url: baseURL + '/Roo/core_person',
method: 'GET'
}),
- reader: Pman.Readers.Person,
+ reader: new Roo.data.JsonReader({}, []),
remoteSort: true,
listeners : {
// only used to change active status.
new Pman.Request({
- url : baseURL + '/Roo/Person.php',
+ url : baseURL + '/Roo/core_person',
method :'POST',
params : {
id : record.data.id,
field: 'name', direction: 'ASC'
}
}),
- cm: new Ext.grid.ColumnModel(
+ cm: new Roo.grid.ColumnModel(
this.columns()
),
- autoExpandColumn: _this.id + '-name' , // fixme!!!!
+ autoExpandColumn: 'name', // fixme!!!!
clicksToEdit : 1,
loadMask: true,
rec.set('active', rec.data.active ? 0 : 1);
rec.commit();
-
-
+
+ var el = Roo.select('.x-grid-row-selected').item(3);
+ el.addClass('x-grid-row-fadeout');
+ el.on('transitionend',function(){
+ _this.grid.ds.remove(rec);
+ },this,{single:true});
}
});
- this.panel = this.layout.add('center', new Ext.GridPanel(this.grid , {
+ this.panel = this.layout.add('center', new Roo.GridPanel(this.grid , {
fitToframe: true,
- fitContainer: true,
+ fitContainer: true,
+ //background : false,
id: this.id,
title: this.title || "Staff",
controller : this
var gridFoot = this.grid.getView().getFooterPanel(true);
- this.paging = new Ext.PagingToolbar(gridFoot, this.grid.getDataSource(), {
+ this.paging = new Roo.PagingToolbar(gridFoot, this.grid.getDataSource(), {
pageSize: 25,
displayInfo: true,
displayMsg: "Displaying " + (this.itemDisplayName || "Staff") + " {0} - {1} of {2}",
var grid = this.grid;
- this.toolbar = new Ext.Toolbar(this.grid.getView().getHeaderPanel(true));
+ this.toolbar = new Roo.Toolbar(this.grid.getView().getHeaderPanel(true));
var tb = this.toolbar;
//}
- this.searchBox = new Ext.form.TextField({
+ this.searchBox = new Roo.form.TextField({
name: 'search',
width:135,
listeners : {
{
text: "Add",
cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
+ icon: Roo.rootURL + 'images/default/dd/drop-add.gif',
hidden : !dg || (_this.newDefaults() === false) || !Pman.hasPerm(this.permName, 'A'),
handler : function(){
dg.show( _this.newDefaults(), refreshPager );
{ ///... for contacts stuff...
text: "Bulk Add",
cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
+ icon: Roo.rootURL + 'images/default/dd/drop-add.gif',
hidden : !this.bulkAdd() || !Pman.hasPerm(this.permName, 'A'),
handler : function(){
{
text: "Edit",
cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/tree/leaf.gif',
+ icon: Roo.rootURL + 'images/default/tree/leaf.gif',
hidden : !dg || !Pman.hasPerm(this.permName, 'E'),
handler : function(){
var s = grid.getSelectionModel().getSelections();
if (!s.length || (s.length > 1)) {
- Ext.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+ Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
return;
}
dg.show( s[0].data,refreshPager);
var s = grid.getSelectionModel().getSelections();
if (!s.length ) {
- Ext.MessageBox.alert("Error", "Select People Row");
+ Roo.MessageBox.alert("Error", "Select People Row");
return;
}
var r = [];
grid.getView().mainWrap.mask("Sending");
- Ext.Ajax.request({
- url: baseURL + '/Roo/Person.html',
+ Roo.Ajax.request({
+ url: baseURL + '/Roo/core_person',
method: 'GET',
params: {
_toggleActive : r.join(',')
var res = Pman.processResponse(resp);
grid.getView().mainWrap.unmask();
if (!res.success) {
- Ext.MessageBox.alert("Error", res.errorMsg ? res.errorMsg : "Error Sending");
+ Roo.MessageBox.alert("Error", res.errorMsg ? res.errorMsg : "Error Sending");
return;
}
refreshPager();
},
failure: function(act) {
grid.getView().mainWrap.unmask();
- Ext.MessageBox.alert("Error", "Error Sending");
+ Roo.MessageBox.alert("Error", "Error Sending");
}
});
{
text: "Delete",
cls: 'x-btn-text-icon',
- hidden : !Pman.hasPerm('Core.Person', 'D'),
+ hidden : !Pman.hasPerm(_this.permName, 'D'),
icon: rootURL + '/Pman/templates/images/trash.gif',
handler : function(){
Pman.genericDelete(_this, 'Person');
refreshPager();
}
},
- '->',
+ '-',
{
-
+ xtype : 'Button',
+ xns : Roo.Toolbar,
text: "Switch to Selected User",
- hidden : !Pman.hasPerm('Core.Person', 'D'),
+ hidden : _this.permName != 'Core.Staff' || !Pman.hasPerm('Core.Staff', 'E'),
listeners : {
click : function () {
var s = grid.getSelectionModel().getSelections();
if (s.length != 1) {
- Ext.MessageBox.alert("Error", "Select a Person");
+ Roo.MessageBox.alert("Error", "Select a Person");
return;
}
-
+ new Pman.Request({
+ url : baseURL+ '/Login.php',
+ params :{
+ 'switch' : s[0].data.id
+ },
+
+ method : 'GET',
+ success : function() {
+ document.location = baseURL + '?ts=' + Math.random();
+
+ },
+ failure : function(d) {
+ Roo.log(d);
+ Roo.MessageBox.alert("Error", d);
+ }
+ });
+
+
}
}
- },
+ }
);
c_name : function(cfg) {
cfg = cfg || {};
return Roo.apply({
- id : this.id + '-name',
+ // id : (this.id + '-name').toLowerCase(),
header : "Name",
dataIndex : 'name',
sortable : true,
- width : 150
+ renderer : function(v,p,r) {
+ if(r.data.active != 1){
+ return String.format('<div style="text-decoration:line-through">{0}</div>', v);
+ }
+ return String.format('{0}', v);
+ }
+ // width : 150
}, cfg);
},
c_company_id_comptype : function(cfg) {
var state = v> 0 ? '-checked' : '';
- return '<img class="x-grid-check-icon' + state + '" src="' + Ext.BLANK_IMAGE_URL + '"/>';
+ return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
}