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.AdminPermMembers',
12 module : Pman.Tab.AdminPermMembers,
14 parent : Pman.Tab.AdminPermManager,
15 name : "Pman.Tab.AdminPermMembers",
21 Pman.Tab.AdminPermMembers = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
37 activate : function() {
40 _this.grid.footer.onClick('first');
59 _this.dialog = Pman.Dialog.PersonEdit;
62 //_this.dialog = Pman.Dialog.FILL_IN
63 if (_this.panel.active) {
64 this.footer.onClick('first');
67 rowdblclick : function (_self, rowIndex, e)
69 if (!_this.dialog) return;
70 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
71 _this.grid.footer.onClick('first');
74 cellclick : function (_self, rowIndex, columnIndex, e)
77 var di = this.colModel.getDataIndex(columnIndex);
82 var rec = _this.grid.ds.getAt(rowIndex);
84 rec.set('active', rec.data.active ? 0 : 1);
90 autoExpandColumn : 'name',
98 beforeload : function (_self, o)
101 // technically we may allow non-owner's to be in the group..
102 // need to work out how that will work...
105 //o.params['company_id_comptype'] = 'OWNER';
106 o.params['query[search]'] = _this.searchBox.getValue();
108 if (!_this.activeButton) {return; false;}
111 o.params.active = _this.activeButton.pressed ? 0 : 1;
112 if (!Pman.Tab.AdminPermManager) {
117 if (Pman.Tab.AdminPermManager && Pman.Tab.AdminPermManager.grid) {
118 var tms = Pman.Tab.AdminPermManager.grid.getSelectionModel().getSelected();
123 o.params['query[in_group]'] = tms.data.id;
124 o.params['query[type]'] = 0; // group type..
127 //o.params['query[name]'] = _this.searchBox.getValue();
131 update : function (_self, record, operation)
133 if (operation != 'commit') {
136 // only used to change active status.
139 url : baseURL + '/Roo/Person.php',
143 active: record.data.active
146 success : function() {
149 _this.grid.ds.remove(record);
154 Roo.MessageBox.alert("Error", "saving failed", function() {
155 _this.grid.footer.onClick('first');
162 sortInfo : { field : 'name', direction: 'ASC' },
167 url : baseURL + '/Roo/Person.php'
172 totalProperty : 'total',
201 'name': 'company_id',
229 'name': 'no_reset_sent',
233 'name': 'action_type',
237 'name': 'project_id',
241 'name': 'office_id_id',
245 'name': 'office_id_company_id',
249 'name': 'office_id_name',
253 'name': 'office_id_address',
257 'name': 'office_id_phone',
261 'name': 'office_id_fax',
265 'name': 'office_id_email',
269 'name': 'office_id_role',
273 'name': 'company_id_code',
277 'name': 'company_id_name',
281 'name': 'company_id_remarks',
285 'name': 'company_id_owner_id',
289 'name': 'company_id_address',
293 'name': 'company_id_tel',
297 'name': 'company_id_fax',
301 'name': 'company_id_email',
305 'name': 'company_id_id',
309 'name': 'company_id_isOwner',
313 'name': 'company_id_logo_id',
317 'name': 'company_id_background_color',
321 'name': 'company_id_comptype',
325 'name': 'company_id_url',
329 'name': 'company_id_main_office_id',
333 'name': 'company_id_created_by',
337 'name': 'company_id_created_dt',
341 'name': 'company_id_updated_by',
345 'name': 'company_id_updated_dt',
349 'name': 'company_id_passwd',
353 'name': 'project_id_id',
357 'name': 'project_id_name',
361 'name': 'project_id_remarks',
365 'name': 'project_id_owner_id',
369 'name': 'project_id_code',
373 'name': 'project_id_active',
377 'name': 'project_id_type',
381 'name': 'project_id_client_id',
385 'name': 'project_id_team_id',
389 'name': 'project_id_file_location',
393 'name': 'project_id_open_date',
397 'name': 'project_id_open_by',
401 'name': 'project_id_close_date',
405 'name': 'project_id_countries',
409 'name': 'project_id_languages',
413 'name': 'project_id_agency_id',
417 'name': 'owner_id_id',
421 'name': 'owner_id_office_id',
425 'name': 'owner_id_name',
429 'name': 'owner_id_phone',
433 'name': 'owner_id_fax',
437 'name': 'owner_id_email',
441 'name': 'owner_id_company_id',
445 'name': 'owner_id_role',
449 'name': 'owner_id_active',
453 'name': 'owner_id_remarks',
457 'name': 'owner_id_passwd',
461 'name': 'owner_id_owner_id',
465 'name': 'owner_id_lang',
469 'name': 'owner_id_no_reset_sent',
473 'name': 'owner_id_action_type',
477 'name': 'owner_id_project_id',
484 xtype: 'PagingToolbar',
488 displayMsg : 'Displaying Person{0} - {1} of {2}',
489 emptyMsg : 'No Person found',
494 text : "Drag person to add or remove from group"
509 _this.dialog.show( { id : 0 } , function() {
510 _this.grid.footer.onClick('first');
514 cls : 'x-btn-text-icon',
516 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
525 Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
526 _this.grid.footer.onClick('first');
530 cls : 'x-btn-text-icon',
532 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
540 var s = _this.grid.getSelectionModel().getSelections();
541 if (!s.length || (s.length > 1)) {
542 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
546 _this.dialog.show(s[0].data, function() {
547 _this.grid.footer.onClick('first');
552 cls : 'x-btn-text-icon',
554 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
569 render : function (_self)
571 _this.searchBox = _self;
573 show : function (_self,e)
575 if (e.getCharCode() != 13) {
578 _this.grid.footer.onClick('first');
580 specialkey : function (_self, e)
582 if (e.getKey() == 13) {
583 _this.grid.footer.onClick('first');
592 click : function (_self, e)
594 _this.grid.footer.onClick('first');
598 icon : rootURL + '/Pman/templates/images/search.gif'
604 click : function (_self, e)
606 _this.searchBox.setValue('');
607 _this.grid.footer.onClick('first');
611 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
621 toggle : function (_self, pressed)
623 _this.grid.footer.onClick('first');
624 this.setText(pressed ? "Show Active" : "Show Removed");
628 render : function (_self)
630 _this.activeButton = _self;
634 text : "Show Removed"
640 xtype: 'ColumnModel',
642 dataIndex : 'project_id_code',
647 renderer : function(v,x,r) {
648 return String.format('<span qtip="{0}">{1}</span>',
649 r.data.project_id_name,
654 xtype: 'ColumnModel',
656 dataIndex : 'company_id_comptype',
660 renderer : function(v,x,r) {
661 if (r.data.office_id) {
662 return String.format('{0} - {1}', v, r.data.office_id_name);
664 return String.format('{0}', v);
668 xtype: 'ColumnModel',
670 dataIndex : 'company_id_name',
674 renderer : function(v,x,r) {
675 if (r.data.office_id) {
676 return String.format('{0} - {1}', v, r.data.office_id_name);
678 return String.format('{0}', v);
682 xtype: 'ColumnModel',
688 renderer : function(v) { return String.format('{0}', v); }
691 xtype: 'ColumnModel',
696 renderer : function(v) { return String.format('{0}', v); }
699 xtype: 'ColumnModel',
704 renderer : function(v) { return String.format('{0}', v); }
707 xtype: 'ColumnModel',
712 renderer : function(v) { return String.format('{0}', v); }
715 xtype: 'ColumnModel',
721 renderer : function(v) {
722 return (v.length && v.indexOf('@') > 0 ) ?
723 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
727 xtype: 'ColumnModel',
729 dataIndex : 'active',
732 renderer : function(v) {
733 var state = v> 0 ? '-checked' : '';
735 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
742 this.layout = this.panel.layout;