1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '001-Pman.Tab.AdminContactsGroup',
12 module : Pman.Tab.AdminContactsGroup,
14 parent : Pman.Tab.AdminContactsManager,
15 name : "Pman.Tab.AdminContactsGroup",
21 Pman.Tab.AdminContactsGroup = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
43 activate : function() {
46 _this.grid.footer.onClick('first');
57 //_this.dialog = Pman.Dialog.FILL_IN
58 if (_this.panel.active) {
59 this.footer.onClick('first');
62 rowdblclick : function (_self, rowIndex, e)
64 if (!_this.dialog) return;
65 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
66 _this.grid.footer.onClick('first');
69 dragover : function (_self, dd, targetId, e)
74 autoExpandColumn : 'name',
82 beforeload : function (_self, o)
84 o.params = o.params || {};
87 load : function (_self, records, options)
89 var sm = _this.grid.getSelectionModel();
90 if (!sm.getSelections().length) {
93 Pman.Tab.AdminContacts.grid.footer.onClick('first');
97 sortInfo : { field : 'name', direction: 'ASC' },
102 url : baseURL + '/Roo/Groups.php'
107 totalProperty : 'total',
132 'name': 'leader_office_id',
136 'name': 'leader_name',
140 'name': 'leader_phone',
144 'name': 'leader_fax',
148 'name': 'leader_email',
152 'name': 'leader_company_id',
156 'name': 'leader_role',
160 'name': 'leader_active',
164 'name': 'leader_remarks',
168 'name': 'leader_passwd',
172 'name': 'leader_owner_id',
176 'name': 'leader_lang',
180 'name': 'leader_no_reset_sent',
184 'name': 'leader_action_type',
188 'name': 'leader_project_id',
201 text : "Manage Groups",
212 if (!_this.dialog) return;
213 _this.dialog.show( { id : 0 } , function() {
214 _this.grid.ds.load({});
218 cls : 'x-btn-text-icon',
220 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
228 var s = _this.grid.getSelectionModel().getSelections();
229 if (!s.length || (s.length > 1)) {
230 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
233 if (!_this.dialog) return;
234 _this.dialog.show(s[0].data, function() {
235 _this.grid.ds.load({});
240 cls : 'x-btn-text-icon',
242 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
250 Pman.genericDelete(_this, 'Groups');
253 cls : 'x-btn-text-icon',
255 icon : rootURL + '/Pman/templates/images/trash.gif'
265 click : function (_self, e)
267 _this.grid.ds.load({});
279 xtype: 'ColumnModel',
284 renderer : function(v,x,r) {
285 if (r.data.id == -1) {
286 return '<b>' + "Not in a Group" + '</b>';
288 if ((r.data.id == 0) && (_this.type == 0)) {
289 return '<b>' + "All Staff (Default Permissions)" + '</b>';
291 if ((r.data.id == 0) && (_this.type == 2)) {
292 return '<b>' + "Everybody" + '</b>';
294 if (r.data.id == 0) {
295 return '<b>' + "All Staff" + '</b>';
297 if (v == 'Administrators') {
298 return '<b>' + "Adminstrators" + '</b>';
301 return v + ' (' + r.data.leader_name + ')';
309 xtype: 'RowSelectionModel',
312 afterselectionchange : function (_self)
314 Pman.Tab.AdminContacts.footer.onClick('first');
321 this.layout = this.panel.layout;