1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminPermMembers = new Roo.XComponent({
8 part : ["old", "AdminPermMembers" ],
9 order : '001-Pman.Tab.AdminPermMembers',
11 parent : 'Pman.Tab.AdminPermManager',
12 name : "Pman.Tab.AdminPermMembers",
24 url : baseURL + '/Roo/Person.php',
89 'name': 'no_reset_sent',
93 'name': 'action_type',
101 'name': 'office_id_id',
105 'name': 'office_id_company_id',
109 'name': 'office_id_name',
113 'name': 'office_id_address',
117 'name': 'office_id_phone',
121 'name': 'office_id_fax',
125 'name': 'office_id_email',
129 'name': 'office_id_role',
133 'name': 'company_id_code',
137 'name': 'company_id_name',
141 'name': 'company_id_remarks',
145 'name': 'company_id_owner_id',
149 'name': 'company_id_address',
153 'name': 'company_id_tel',
157 'name': 'company_id_fax',
161 'name': 'company_id_email',
165 'name': 'company_id_id',
169 'name': 'company_id_isOwner',
173 'name': 'company_id_logo_id',
177 'name': 'company_id_background_color',
181 'name': 'company_id_comptype',
185 'name': 'company_id_url',
189 'name': 'company_id_main_office_id',
193 'name': 'company_id_created_by',
197 'name': 'company_id_created_dt',
201 'name': 'company_id_updated_by',
205 'name': 'company_id_updated_dt',
209 'name': 'company_id_passwd',
213 'name': 'project_id_id',
217 'name': 'project_id_name',
221 'name': 'project_id_remarks',
225 'name': 'project_id_owner_id',
229 'name': 'project_id_code',
233 'name': 'project_id_active',
237 'name': 'project_id_type',
241 'name': 'project_id_client_id',
245 'name': 'project_id_team_id',
249 'name': 'project_id_file_location',
253 'name': 'project_id_open_date',
257 'name': 'project_id_open_by',
261 'name': 'project_id_close_date',
265 'name': 'project_id_countries',
269 'name': 'project_id_languages',
273 'name': 'project_id_agency_id',
277 'name': 'owner_id_id',
281 'name': 'owner_id_office_id',
285 'name': 'owner_id_name',
289 'name': 'owner_id_phone',
293 'name': 'owner_id_fax',
297 'name': 'owner_id_email',
301 'name': 'owner_id_company_id',
305 'name': 'owner_id_role',
309 'name': 'owner_id_active',
313 'name': 'owner_id_remarks',
317 'name': 'owner_id_passwd',
321 'name': 'owner_id_owner_id',
325 'name': 'owner_id_lang',
329 'name': 'owner_id_no_reset_sent',
333 'name': 'owner_id_action_type',
337 'name': 'owner_id_project_id',
341 totalProperty : 'total'
346 sortInfo : { field : 'name', direction: 'ASC' },
349 update : function (_self, record, operation)
351 if (operation != 'commit') {
354 // only used to change active status.
357 url : baseURL + '/Roo/Person.php',
361 active: record.data.active
364 success : function() {
367 _this.grid.ds.remove(record);
372 Roo.MessageBox.alert("Error", "saving failed", function() {
373 _this.grid.footer.onClick('first');
378 beforeload : function (_self, o)
381 // technically we may allow non-owner's to be in the group..
382 // need to work out how that will work...
385 //o.params['company_id_comptype'] = 'OWNER';
386 o.params['query[search]'] = _this.searchBox.getValue();
388 if (!_this.activeButton) {return; false;}
391 o.params.active = _this.activeButton.pressed ? 0 : 1;
392 if (!Pman.Tab.AdminPermManager) {
397 if (Pman.Tab.AdminPermManager && Pman.Tab.AdminPermManager.grid) {
398 var tms = Pman.Tab.AdminPermManager.grid.getSelectionModel().getSelected();
403 o.params['query[in_group]'] = tms.data.id;
404 o.params['query[type]'] = 0; // group type..
407 //o.params['query[name]'] = _this.searchBox.getValue();
420 xtype : 'PagingToolbar',
421 emptyMsg : "No Person found",
424 displayMsg : "Displaying Person{0} - {1} of {2}",
427 '|xns' : 'Roo.Toolbar',
428 text : "Drag person to add or remove from group",
441 '|xns' : 'Roo.Toolbar',
444 cls : 'x-btn-text-icon',
445 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
451 _this.dialog.show( { id : 0 } , function() {
452 _this.grid.footer.onClick('first');
458 '|xns' : 'Roo.Toolbar',
461 cls : 'x-btn-text-icon',
462 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
468 Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
469 _this.grid.footer.onClick('first');
475 '|xns' : 'Roo.Toolbar',
478 cls : 'x-btn-text-icon',
479 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
484 var s = _this.grid.getSelectionModel().getSelections();
485 if (!s.length || (s.length > 1)) {
486 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
490 _this.dialog.show(s[0].data, function() {
491 _this.grid.footer.onClick('first');
498 '|xns' : 'Roo.Toolbar',
503 '|xns' : 'Roo.Toolbar',
513 specialkey : function (_self, e)
515 if (e.getKey() == 13) {
516 _this.grid.footer.onClick('first');
519 show : function (_self,e)
521 if (e.getCharCode() != 13) {
524 _this.grid.footer.onClick('first');
526 render : function (_self)
528 _this.searchBox = _self;
533 '|xns' : 'Roo.Toolbar',
536 icon : rootURL + '/Pman/templates/images/search.gif',
539 click : function (_self, e)
541 _this.grid.footer.onClick('first');
546 '|xns' : 'Roo.Toolbar',
549 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
552 click : function (_self, e)
554 _this.searchBox.setValue('');
555 _this.grid.footer.onClick('first');
560 '|xns' : 'Roo.Toolbar',
565 '|xns' : 'Roo.Toolbar',
566 text : "Show Removed",
571 toggle : function (_self, pressed)
573 _this.grid.footer.onClick('first');
574 this.setText(pressed ? "Show Active" : "Show Removed");
578 render : function (_self)
580 _this.activeButton = _self;
588 autoExpandColumn : 'name',
598 xtype : 'ColumnModel',
602 renderer : function(v,x,r) {
603 return String.format('<span qtip="{0}">{1}</span>',
604 r.data.project_id_name,
608 dataIndex : 'project_id_code'
612 xtype : 'ColumnModel',
616 renderer : function(v,x,r) {
617 if (r.data.office_id) {
618 return String.format('{0} - {1}', v, r.data.office_id_name);
620 return String.format('{0}', v);
623 dataIndex : 'company_id_comptype'
627 xtype : 'ColumnModel',
631 renderer : function(v,x,r) {
632 if (r.data.office_id) {
633 return String.format('{0} - {1}', v, r.data.office_id_name);
635 return String.format('{0}', v);
638 dataIndex : 'company_id_name'
642 xtype : 'ColumnModel',
646 renderer : function(v) { return String.format('{0}', v); },
652 xtype : 'ColumnModel',
655 renderer : function(v) { return String.format('{0}', v); },
661 xtype : 'ColumnModel',
664 renderer : function(v) { return String.format('{0}', v); },
670 xtype : 'ColumnModel',
673 renderer : function(v) { return String.format('{0}', v); },
679 xtype : 'ColumnModel',
683 renderer : function(v) {
684 return (v.length && v.indexOf('@') > 0 ) ?
685 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
692 xtype : 'ColumnModel',
695 renderer : function(v) {
696 var state = v> 0 ? '-checked' : '';
698 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
706 rowdblclick : function (_self, rowIndex, e)
708 if (!_this.dialog) return;
709 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
710 _this.grid.footer.onClick('first');
713 cellclick : function (_self, rowIndex, columnIndex, e)
716 var di = this.colModel.getDataIndex(columnIndex);
717 if (di != 'active') {
721 var rec = _this.grid.ds.getAt(rowIndex);
723 rec.set('active', rec.data.active ? 0 : 1);
732 _this.dialog = Pman.Dialog.PersonEdit;
735 //_this.dialog = Pman.Dialog.FILL_IN
736 if (_this.panel.active) {
737 this.footer.onClick('first');
755 tableName : 'Person',
757 activate : function() {
760 _this.grid.footer.onClick('first');