Ext.namespace("PMS.FNTabGROUPS"); PMS.FNTabGROUPS = function(myTabName, TabText){ function WindowNewGroup(){ var myformpanelwindows12 = new Ext.FormPanel({ frame:true, labelAlign: 'right', bodyStyle:'padding:5px', width: 300, height:180, waitMsgTarget: true, layout: 'form', items: [ {name: 'groupname', xtype:'textfield', fieldLabel: 'CODE'}, {name: 'grouptext', xtype:'textfield', fieldLabel: 'NAME' }, {name: 'groupcomment', xtype:'textfield', fieldLabel: 'Comment'}, new Ext.form.Checkbox({ fieldLabel: 'Group active', name:'groupactive'})] }); // Create Window Property of Group var myfunction = function(){ myformpanelwindows12.form.submit({ url:'modules/main/js/groupadd-newgroup.php', waitMsg:'Saving ...', success: function (form, action) { win2.close(); Ext.getCmp("listgroups").getStore().load();}, failure:function(form, action) { var SucParams = Ext.decode(action.response.responseText); Ext.MessageBox.alert('ERRORS', SucParams['errors']['strmsg']);} }); }; var win2 = new Ext.Window({ width:300, height:200, autoCreate : true, title:"New Group ", resizable:false, constrain:true, constrainHeader:true, minimizable : false, maximizable : false, stateful: false, shim:true, buttonAlign:"center", autoScrool:true, modal:true, plain:true, footer:true, closable:true, items: myformpanelwindows12, buttons: [{ text:'Add',handler: myfunction }, { text: 'Cancel', handler: function(){ win2.hide();} }], buttonAlign: 'center' }); win2.show(this); }; // Function for double click Groups grid rows function WindowGroup(grid, rowIndex, columnIndex, e){ Ext.namespace('Ext.AccessUsers'); Ext.AccessUsers.MYPROFILE = new Array(); Ext.AccessUsers.MYPROFILE[0] = ['------','No access'];Ext.AccessUsers.MYPROFILE[1] = ['R-R-R-','Read only'];Ext.AccessUsers.MYPROFILE[2] = ['RWRWRW','Full access'];Ext.AccessUsers.USERS = new Array(); Ext.AccessUsers.USERS[0] = ['------','No access'];Ext.AccessUsers.USERS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.USERS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.GROUPS = new Array(); Ext.AccessUsers.GROUPS[0] = ['------','No access'];Ext.AccessUsers.GROUPS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.GROUPS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.MODULES = new Array(); Ext.AccessUsers.MODULES[0] = ['------','No access'];Ext.AccessUsers.MODULES[1] = ['R-R-R-','Read only'];Ext.AccessUsers.MODULES[2] = ['RWRWRW','Full access'];Ext.AccessUsers.VARIABLES = new Array(); Ext.AccessUsers.VARIABLES[0] = ['------','No access'];Ext.AccessUsers.VARIABLES[1] = ['R-R-R-','Read only'];Ext.AccessUsers.VARIABLES[2] = ['RWRWRW','Full access'];Ext.AccessUsers.SYSNEWS = new Array(); Ext.AccessUsers.SYSNEWS[0] = ['------','No access'];Ext.AccessUsers.SYSNEWS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.SYSNEWS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.REMINDER = new Array(); Ext.AccessUsers.REMINDER[0] = ['------','No access'];Ext.AccessUsers.REMINDER[1] = ['RW----','Private info access'];Ext.AccessUsers.REMINDER[2] = ['RWRWRW','Full access'];Ext.AccessUsers.PROJECTS = new Array(); Ext.AccessUsers.PROJECTS[0] = ['------','No access'];Ext.AccessUsers.PROJECTS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.PROJECTS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.OWNERS = new Array(); Ext.AccessUsers.OWNERS[0] = ['------','No access'];Ext.AccessUsers.OWNERS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.OWNERS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.PROPERTY = new Array(); Ext.AccessUsers.PROPERTY[0] = ['------','No access'];Ext.AccessUsers.PROPERTY[1] = ['R-R-R-','Read only'];Ext.AccessUsers.PROPERTY[2] = ['RWRWRW','Full access'];Ext.AccessUsers.MARKETPROPERTY = new Array(); Ext.AccessUsers.MARKETPROPERTY[0] = ['------','No access'];Ext.AccessUsers.MARKETPROPERTY[1] = ['R-R-R-','Read only'];Ext.AccessUsers.MARKETPROPERTY[2] = ['RWRWRW','Full access'];Ext.AccessUsers.UNITS = new Array(); Ext.AccessUsers.UNITS[0] = ['------','No access'];Ext.AccessUsers.UNITS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.UNITS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.TEMPLATES = new Array(); Ext.AccessUsers.TEMPLATES[0] = ['------','No access'];Ext.AccessUsers.TEMPLATES[1] = ['R-R-R-','Read only'];Ext.AccessUsers.TEMPLATES[2] = ['RWRWRW','Full access'];Ext.AccessUsers.PAYMENTTERMS = new Array(); Ext.AccessUsers.PAYMENTTERMS[0] = ['------','No access'];Ext.AccessUsers.PAYMENTTERMS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.PAYMENTTERMS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.PRICELIST = new Array(); Ext.AccessUsers.PRICELIST[0] = ['------','No access'];Ext.AccessUsers.PRICELIST[1] = ['R-R-R-','Read only'];Ext.AccessUsers.PRICELIST[2] = ['RWRWRW','Full access'];Ext.AccessUsers.INVENTORY = new Array(); Ext.AccessUsers.INVENTORY[0] = ['------','No access'];Ext.AccessUsers.INVENTORY[1] = ['R-R-R-','Read only'];Ext.AccessUsers.INVENTORY[2] = ['RWRWRW','Full access'];Ext.AccessUsers.MARKETUNITS = new Array(); Ext.AccessUsers.MARKETUNITS[0] = ['------','No access'];Ext.AccessUsers.MARKETUNITS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.MARKETUNITS[2] = ['RWR-R-','Private info access'];Ext.AccessUsers.MARKETUNITS[3] = ['RWRWRW','Full access'];Ext.AccessUsers.SALESFORCE = new Array(); Ext.AccessUsers.SALESFORCE[0] = ['------','No access'];Ext.AccessUsers.SALESFORCE[1] = ['R-R-R-','Read only'];Ext.AccessUsers.SALESFORCE[2] = ['RWRWRW','Full access'];Ext.AccessUsers.LEADS = new Array(); Ext.AccessUsers.LEADS[0] = ['------','No access'];Ext.AccessUsers.LEADS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.LEADS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.CLIENTS = new Array(); Ext.AccessUsers.CLIENTS[0] = ['------','No access'];Ext.AccessUsers.CLIENTS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.CLIENTS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.SALECONTRACT = new Array(); Ext.AccessUsers.SALECONTRACT[0] = ['------','No access'];Ext.AccessUsers.SALECONTRACT[1] = ['R-R-R-','Read only'];Ext.AccessUsers.SALECONTRACT[2] = ['RWRWRW','Full access'];Ext.AccessUsers.RENTCONTRACT = new Array(); Ext.AccessUsers.RENTCONTRACT[0] = ['------','No access'];Ext.AccessUsers.RENTCONTRACT[1] = ['R-R-R-','Read only'];Ext.AccessUsers.RENTCONTRACT[2] = ['RWRWRW','Full access'];Ext.AccessUsers.BANNERS = new Array(); Ext.AccessUsers.BANNERS[0] = ['------','No access'];Ext.AccessUsers.BANNERS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.BANNERS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.SECTIONS = new Array(); Ext.AccessUsers.SECTIONS[0] = ['------','No access'];Ext.AccessUsers.SECTIONS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.SECTIONS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.ACCSCHEDULES = new Array(); Ext.AccessUsers.ACCSCHEDULES[0] = ['------','No access'];Ext.AccessUsers.ACCSCHEDULES[1] = ['R-R-R-','Read only'];Ext.AccessUsers.ACCSCHEDULES[2] = ['RWRWRW','Full access'];Ext.AccessUsers.BANKRECEIPTS = new Array(); Ext.AccessUsers.BANKRECEIPTS[0] = ['------','No access'];Ext.AccessUsers.BANKRECEIPTS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.BANKRECEIPTS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.SALESINVOICES = new Array(); Ext.AccessUsers.SALESINVOICES[0] = ['------','No access'];Ext.AccessUsers.SALESINVOICES[1] = ['R-R-R-','Read only'];Ext.AccessUsers.SALESINVOICES[2] = ['RWRWRW','Full access'];Ext.AccessUsers.PURCHASEVOUCHERS = new Array(); Ext.AccessUsers.PURCHASEVOUCHERS[0] = ['------','No access'];Ext.AccessUsers.PURCHASEVOUCHERS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.PURCHASEVOUCHERS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.LEDGER = new Array(); Ext.AccessUsers.LEDGER[0] = ['------','No access'];Ext.AccessUsers.LEDGER[1] = ['R-R-R-','Read only'];Ext.AccessUsers.LEDGER[2] = ['RWRWRW','Full access'];Ext.AccessUsers.VENDORS = new Array(); Ext.AccessUsers.VENDORS[0] = ['------','No access'];Ext.AccessUsers.VENDORS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.VENDORS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.UNITOWNERS = new Array(); Ext.AccessUsers.UNITOWNERS[0] = ['------','No access'];Ext.AccessUsers.UNITOWNERS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.UNITOWNERS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.WORKORDERS = new Array(); Ext.AccessUsers.WORKORDERS[0] = ['------','No access'];Ext.AccessUsers.WORKORDERS[1] = ['R-R-R-','Read only'];Ext.AccessUsers.WORKORDERS[2] = ['RWRWRW','Full access'];Ext.AccessUsers.CORRMANAGER = new Array(); Ext.AccessUsers.CORRMANAGER[0] = ['------','No access'];Ext.AccessUsers.CORRMANAGER[1] = ['R-R-R-','Read only'];Ext.AccessUsers.CORRMANAGER[2] = ['RWRWRW','Full access'];var myAceesItems = new Array(); myAceesItems[0] = new Ext.form.ComboBox({ fieldLabel: 'MYPROFILE', hiddenName:'accessMYPROFILE', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.MYPROFILE}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[1] = new Ext.form.ComboBox({ fieldLabel: 'Users', hiddenName:'accessUSERS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.USERS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[2] = new Ext.form.ComboBox({ fieldLabel: 'Groups', hiddenName:'accessGROUPS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.GROUPS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[3] = new Ext.form.ComboBox({ fieldLabel: 'Modules', hiddenName:'accessMODULES', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.MODULES}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[4] = new Ext.form.ComboBox({ fieldLabel: 'VARIABLES', hiddenName:'accessVARIABLES', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.VARIABLES}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[5] = new Ext.form.ComboBox({ fieldLabel: 'SYSNEWS', hiddenName:'accessSYSNEWS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.SYSNEWS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[6] = new Ext.form.ComboBox({ fieldLabel: 'REMINDER', hiddenName:'accessREMINDER', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.REMINDER}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[7] = new Ext.form.ComboBox({ fieldLabel: 'PROJECTS', hiddenName:'accessPROJECTS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.PROJECTS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[8] = new Ext.form.ComboBox({ fieldLabel: 'OWNERS', hiddenName:'accessOWNERS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.OWNERS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[9] = new Ext.form.ComboBox({ fieldLabel: 'PROPERTY', hiddenName:'accessPROPERTY', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.PROPERTY}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[10] = new Ext.form.ComboBox({ fieldLabel: 'MARKETPROPERTY', hiddenName:'accessMARKETPROPERTY', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.MARKETPROPERTY}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[11] = new Ext.form.ComboBox({ fieldLabel: 'UNITS', hiddenName:'accessUNITS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.UNITS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[12] = new Ext.form.ComboBox({ fieldLabel: 'TEMPLATES', hiddenName:'accessTEMPLATES', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.TEMPLATES}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[13] = new Ext.form.ComboBox({ fieldLabel: 'PAYMENTTERMS', hiddenName:'accessPAYMENTTERMS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.PAYMENTTERMS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[14] = new Ext.form.ComboBox({ fieldLabel: 'PRICELIST', hiddenName:'accessPRICELIST', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.PRICELIST}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[15] = new Ext.form.ComboBox({ fieldLabel: 'INVENTORY', hiddenName:'accessINVENTORY', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.INVENTORY}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[16] = new Ext.form.ComboBox({ fieldLabel: 'MARKETUNITS', hiddenName:'accessMARKETUNITS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.MARKETUNITS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[17] = new Ext.form.ComboBox({ fieldLabel: 'SALESFORCE', hiddenName:'accessSALESFORCE', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.SALESFORCE}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[18] = new Ext.form.ComboBox({ fieldLabel: 'LEADS', hiddenName:'accessLEADS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.LEADS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[19] = new Ext.form.ComboBox({ fieldLabel: 'CLIENTS', hiddenName:'accessCLIENTS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.CLIENTS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[20] = new Ext.form.ComboBox({ fieldLabel: 'SALECONTRACT', hiddenName:'accessSALECONTRACT', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.SALECONTRACT}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[21] = new Ext.form.ComboBox({ fieldLabel: 'RENTCONTRACT', hiddenName:'accessRENTCONTRACT', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.RENTCONTRACT}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[22] = new Ext.form.ComboBox({ fieldLabel: 'BANNERS', hiddenName:'accessBANNERS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.BANNERS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[23] = new Ext.form.ComboBox({ fieldLabel: 'SECTIONS', hiddenName:'accessSECTIONS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.SECTIONS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[24] = new Ext.form.ComboBox({ fieldLabel: 'ACCSCHEDULES', hiddenName:'accessACCSCHEDULES', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.ACCSCHEDULES}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[25] = new Ext.form.ComboBox({ fieldLabel: 'BANKRECEIPTS', hiddenName:'accessBANKRECEIPTS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.BANKRECEIPTS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[26] = new Ext.form.ComboBox({ fieldLabel: 'SALESINVOICES', hiddenName:'accessSALESINVOICES', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.SALESINVOICES}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[27] = new Ext.form.ComboBox({ fieldLabel: 'PURCHASEVOUCHERS', hiddenName:'accessPURCHASEVOUCHERS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.PURCHASEVOUCHERS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[28] = new Ext.form.ComboBox({ fieldLabel: 'LEDGER', hiddenName:'accessLEDGER', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.LEDGER}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[29] = new Ext.form.ComboBox({ fieldLabel: 'VENDORS', hiddenName:'accessVENDORS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.VENDORS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[30] = new Ext.form.ComboBox({ fieldLabel: 'UNITOWNERS', hiddenName:'accessUNITOWNERS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.UNITOWNERS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[31] = new Ext.form.ComboBox({ fieldLabel: 'WORKORDERS', hiddenName:'accessWORKORDERS', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.WORKORDERS}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); myAceesItems[32] = new Ext.form.ComboBox({ fieldLabel: 'CORRMANAGER', hiddenName:'accessCORRMANAGER', store: new Ext.data.SimpleStore({ fields: ['abbr', 'state'], data : Ext.AccessUsers.CORRMANAGER}), width:160, listWidth:160, valueField:'abbr', displayField:'state', readOnly:true, mode: 'local', triggerAction: 'all', emptyText:'Select access value ...', selectOnFocus:true}); var SelectedRecord = grid.getStore().getAt(rowIndex); var SelectedGroupID = SelectedRecord.get("id"); var MyStore = new Ext.data.JsonStore({ autoLoad: true, baseParams: {idgroup: SelectedGroupID}, url: 'modules/main/js/groupget-users.php', root: 'users', fields: ['id', 'username', 'firstname', 'lastname', 'active']}); // Create Form of property of Group for window var myformpanelwindows = new Ext.FormPanel({ frame:true, labelAlign: 'right', bodyStyle:'padding:5px', width: 'auto', height:'auto', waitMsgTarget: true, baseParams:{groupid: SelectedGroupID}, items: [{ layout:'column', border:false, resizable:false, width: 480, height:60, items:[{ layout: 'form', columnWidth:.5, border:false, items: [ {name: 'groupid', xtype:'textfield', fieldLabel: 'ID', disabled:true}, {name: 'groupname', xtype:'textfield', fieldLabel: 'CODE'}] },{ columnWidth:.5, layout: 'form', border:false, items: [ {name: 'grouptext', xtype:'textfield', fieldLabel: 'NAME'}, new Ext.form.Checkbox({ fieldLabel: 'Group active', name:'groupactive'})] }] },{ xtype:'tabpanel', activeTab: 0, height:250, width: 'auto', deferredRender:false, enableTabScroll:3, items:[{ title:' Info ', layout:'form', defaults: {width: 230}, defaultType: 'textfield', frame:true, border:false, iconCls:'nav', labelWidth:150, items: [ {fieldLabel: 'Registration date', name: 'groupcdate', disabled:true }, {fieldLabel: 'Author', name: 'groupcaut', disabled:true }, {fieldLabel: 'Last Update', name: 'groupudate', disabled:true }, {fieldLabel: 'Update author', name: 'groupuaut', disabled:true }] },{ layout:'column', title:' Access ', frame:true, iconCls:'nav', height:230, items:[{ columnWidth:1.0, layout:'form', border:false, autoScroll:true, labelWidth:150, height:200, items: myAceesItems }] },{ title:' Members ', layout:'form', defaults: {width: 450}, frame:true, border:false, iconCls:'nav', items: [ new Ext.grid.GridPanel({ xtype:'grid', store: MyStore, border:true, frame:true, id: 'mygroupusers', cm: new Ext.grid.ColumnModel([ new Ext.grid.CheckboxSelectionModel(), {id:'id',header: "ID", width: 50, sortable: true, dataIndex: 'id'}, {header: "User Name", width: 100, sortable: true, dataIndex: 'username'}, {header: "First Name", width: 100, sortable: true, dataIndex: 'firstname'}, {header: "Last Name", width: 100, sortable: true, dataIndex: 'lastname'} ]), sm: new Ext.grid.CheckboxSelectionModel(), viewConfig: { forceFit:true}, width:450, height:170, tbar:[{ text:'Add user(s) ', tooltip:'Add user to group', iconCls:'add', handler: function(){ var MyStore1 = new Ext.data.JsonStore({ autoLoad: true, baseParams: {idgroup: SelectedGroupID}, url: 'modules/main/js/groupget-allusers.php', root: 'users', fields: ['id', 'username', 'firstname', 'lastname', 'active']}); var mygridpanelwindows = new Ext.grid.GridPanel({ xtype:'grid', store: MyStore1, border:true, frame:true, id: 'mygroupuserslist', cm: new Ext.grid.ColumnModel([ new Ext.grid.CheckboxSelectionModel(), {id:'id',header: "ID", width: 50, sortable: true, dataIndex: 'id'}, {header: "User Name", width: 100, sortable: true, dataIndex: 'username'}, {header: "First Name", width: 100, sortable: true, dataIndex: 'firstname'}, {header: "Last Name", width: 100, sortable: true, dataIndex: 'lastname'} ]), sm: new Ext.grid.CheckboxSelectionModel(), viewConfig: { forceFit:true}, width:390, height:370 }); var win1 = new Ext.Window({ width:400, height:400, autoCreate : true, title:"Group Property ", resizable:false, constrain:true, constrainHeader:true, minimizable : false, maximizable : false, stateful: false, shim:true, buttonAlign:"center", autoScrool:true, modal:true, plain:true, footer:true, closable:true, items: mygridpanelwindows, iconCls:'nav', buttons: [ { text:'Add user(s)', handler: function(){ var gridCmpSel = Ext.getCmp('mygroupuserslist'); if(gridCmpSel.getSelectionModel().hasSelection()){ var selectionsList = gridCmpSel.getSelectionModel().getSelections(); var selectedUsersId = ""; for(var i = 0;i0) { var rres=RegCheck1.getAt(0).get('suscess'); if (!rres=='ok') { Ext.MessageBox.show({ title: 'TITLE', msg: RegCheck1.getAt(0).get('text'), buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO}); }else{ MyStore.load(); } } }); RegCheck1.load(); win1.hide(); } } }, { text: 'Cancel', handler: function(){ win1.hide(); } }], buttonAlign: 'center'}); win1.show(this); MyStore1.load(); } }, '-', { text:'Remove user(s)', tooltip:'Remove selected user(s) from group', iconCls:'remove', handler: function(){ var gridCmp = Ext.getCmp('mygroupusers'); if(gridCmp.getSelectionModel().hasSelection()){ var selectionsList = gridCmp.getSelectionModel().getSelections(); var selectedUsersId = ""; var selectedUsersText = ""; for(var i = 0;i0) { var rres=RegCheck1.getAt(0).get('suscess'); if (!rres=='ok') { Ext.MessageBox.show({ title: 'TITLE', msg: RegCheck1.getAt(0).get('text'), buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO}); }else{ MyStore.load(); } } }); RegCheck1.load(); } ); }else{ Ext.MessageBox.show({ title: 'Warning ... ', msg: "No selected item(s) ", buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.WARNING}); } } }], listeners: { } }) ] },{ title:' Comment ', layout:'fit', frame:true, border:false, iconCls:'nav', items: { xtype:'textarea', name:'groupcomment', fieldLabel:'Comment'} }] }] }); var FNCSaveGroup = function(){ myformpanelwindows.form.submit({ url:'modules/main/js/groupsave-group.php', // PHP waitMsg:'Saving Data...', success: function (form, action) { win.close(); Ext.getCmp('listgroups').getStore().load(); }, failure:function(form, action) { var SucParams = Ext.decode(action.response.responseText); Ext.MessageBox.alert('ERRORS', SucParams['errors']['strmsg']); } }); }; // Create Window Property of Group var win = new Ext.Window({ width:519, height:410, autoCreate : true, title:"Group Property ", resizable:false, constrain:true, constrainHeader:true, minimizable : false, maximizable : false, stateful: false, shim:true, buttonAlign:"center", autoScrool:true, modal:true, plain:true, footer:true, closable:true, items: myformpanelwindows, buttons: [ { text:'Save', handler: FNCSaveGroup }, { text: 'Close', handler: function(){ win.hide();} }], buttonAlign: 'center' }); win.show(this); myformpanelwindows.getForm().load({url:'modules/main/js/groupget-group.php', waitMsg:'Loading ... ', success:function(form, action) { }, failure:function(form, action) { Ext.MessageBox.alert('Message', action.response.responseText); win.hide(); } }); }; function DelGroup(idGroup){ var RegCheck2 = new Ext.data.JsonStore({ url: 'modules/main/js/grouprem-groups.php', baseParams: { selGroups: idGroup}, root: 'data', totalProperty: 'count', fields: ['suscess', 'text'] }); RegCheck2.on('load',function(){ if (RegCheck2.getTotalCount()>0) { var rres=RegCheck2.getAt(0).get('suscess'); if (rres=='rok') { Ext.MessageBox.show({ title: 'WARNING', msg: RegCheck2.getAt(0).get('text'), buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.WARNING}); } Ext.getCmp('listgroups').getStore().load(); } }); RegCheck2.load(); }; var MyStore = new Ext.data.JsonStore({ url: 'modules/main/js/groupget-groups.php', root: 'groups', fields: ['id', 'name', 'text', 'comment', 'active', 'status']}); t = new Ext.Panel({ id: myTabName, title: ' ' + TabText, iconCls:'globalmodule', autoScroll:true, listeners: { activate: handleActivate }, closable:true, layout:'fit', items: [{ xtype:'grid', id: 'listgroups', title:'List Groups ', store: MyStore, cm: new Ext.grid.ColumnModel([ new Ext.grid.CheckboxSelectionModel(), {id:'id',header: "ID", width: 25, sortable: true, dataIndex: 'id'}, {header: "Code", width: 100, sortable: true, dataIndex: 'name'}, {header: "Name", width: 200, sortable: true, dataIndex: 'text'}, {header: "Status", width: 100, sortable: true, dataIndex: 'status'}, {header: "Comment", width: 150, sortable: true, dataIndex: 'comment'} ]), sm: new Ext.grid.CheckboxSelectionModel(), viewConfig: { forceFit:true}, width: 'auto', height:CMS.TabItemHeight, loadMask: true, tbar:[ { text:'Add Group', tooltip:'Add a new group', iconCls:'add', handler: WindowNewGroup}, '-', { text:'Edit group', tooltip:'Edit the selected group', iconCls:'option', handler: function(){ var mygrid = Ext.getCmp('listgroups'); if(mygrid.getSelectionModel().hasSelection()){ var selectionsList = mygrid.getSelectionModel().getSelections(); var selectedURecord = selectionsList[0]; selectedUsersId = selectedURecord.get('id'); myrowIndex = mygrid.getStore().indexOf(selectedURecord); mygrid.getSelectionModel().clearSelections(); mygrid.getSelectionModel().selectRow(myrowIndex); mygrid.fireEvent("celldblclick", mygrid, myrowIndex,0,null); }else{ Ext.MessageBox.show({ title: 'TITLE', msg: "No selected item", buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO}); } }},'-', { text:'Delete Group(s)', tooltip:'Delete the selected groups', iconCls:'remove', handler: function(){ var gridCmpSel = Ext.getCmp('listgroups'); if(gridCmpSel.getSelectionModel().hasSelection()){ var selectionsList = gridCmpSel.getSelectionModel().getSelections(); var selectedGroupdId = ""; var selectedGroupText = ""; for(var i = 0;i