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.AdminContacts',
12 module : Pman.Tab.AdminContacts,
14 parent : Pman.Tab.AdminContactsManager,
15 name : "Pman.Tab.AdminContacts",
17 permname: 'Core.Person'
21 Pman.Tab.AdminContacts = 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 o.params['!company_id_comptype'] = 'OWNER';
102 o.params['query[search]'] = _this.searchBox.getValue();
104 if (!_this.activeButton) {return; false;}
107 o.params.active = _this.activeButton.pressed ? 0 : 1;
108 if (!Pman.Tab.AdminContactsGroup) {
113 if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {
114 var tms = Pman.Tab.AdminContactsGroup.grid.getSelectionModel().getSelected();
119 o.params['query[in_group]'] = tms.data.id;
120 o.params['query[type]'] = 2; // group type..
123 //o.params['query[name]'] = _this.searchBox.getValue();
127 update : function (_self, record, operation)
129 if (operation != 'commit') {
132 // only used to change active status.
135 url : baseURL + '/Roo/Person.php',
139 active: record.data.active
142 success : function() {
145 _this.grid.ds.remove(record);
150 Roo.MessageBox.alert("Error", "saving failed", function() {
151 _this.grid.footer.onClick('first');
158 sortInfo : { field : 'name', direction: 'ASC' },
163 url : baseURL + '/Roo/Person.php'
168 totalProperty : 'total',
197 'name': 'company_id',
225 'name': 'no_reset_sent',
229 'name': 'action_type',
233 'name': 'project_id',
237 'name': 'office_id_id',
241 'name': 'office_id_company_id',
245 'name': 'office_id_name',
249 'name': 'office_id_address',
253 'name': 'office_id_phone',
257 'name': 'office_id_fax',
261 'name': 'office_id_email',
265 'name': 'office_id_role',
269 'name': 'company_id_code',
273 'name': 'company_id_name',
277 'name': 'company_id_remarks',
281 'name': 'company_id_owner_id',
285 'name': 'company_id_address',
289 'name': 'company_id_tel',
293 'name': 'company_id_fax',
297 'name': 'company_id_email',
301 'name': 'company_id_id',
305 'name': 'company_id_isOwner',
309 'name': 'company_id_logo_id',
313 'name': 'company_id_background_color',
317 'name': 'company_id_comptype',
321 'name': 'company_id_url',
325 'name': 'company_id_main_office_id',
329 'name': 'company_id_created_by',
333 'name': 'company_id_created_dt',
337 'name': 'company_id_updated_by',
341 'name': 'company_id_updated_dt',
345 'name': 'company_id_passwd',
349 'name': 'project_id_id',
353 'name': 'project_id_name',
357 'name': 'project_id_remarks',
361 'name': 'project_id_owner_id',
365 'name': 'project_id_code',
369 'name': 'project_id_active',
373 'name': 'project_id_type',
377 'name': 'project_id_client_id',
381 'name': 'project_id_team_id',
385 'name': 'project_id_file_location',
389 'name': 'project_id_open_date',
393 'name': 'project_id_open_by',
397 'name': 'project_id_close_date',
401 'name': 'project_id_countries',
405 'name': 'project_id_languages',
409 'name': 'project_id_agency_id',
413 'name': 'owner_id_id',
417 'name': 'owner_id_office_id',
421 'name': 'owner_id_name',
425 'name': 'owner_id_phone',
429 'name': 'owner_id_fax',
433 'name': 'owner_id_email',
437 'name': 'owner_id_company_id',
441 'name': 'owner_id_role',
445 'name': 'owner_id_active',
449 'name': 'owner_id_remarks',
453 'name': 'owner_id_passwd',
457 'name': 'owner_id_owner_id',
461 'name': 'owner_id_lang',
465 'name': 'owner_id_no_reset_sent',
469 'name': 'owner_id_action_type',
473 'name': 'owner_id_project_id',
480 xtype: 'PagingToolbar',
484 displayMsg : 'Displaying Person{0} - {1} of {2}',
485 emptyMsg : 'No Person found',
490 text : "Drag person to add or remove from group"
505 _this.dialog.show( { id : 0 } , function() {
506 _this.grid.footer.onClick('first');
510 cls : 'x-btn-text-icon',
512 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
521 Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
522 _this.grid.footer.onClick('first');
526 cls : 'x-btn-text-icon',
528 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
536 var s = _this.grid.getSelectionModel().getSelections();
537 if (!s.length || (s.length > 1)) {
538 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
542 _this.dialog.show(s[0].data, function() {
543 _this.grid.footer.onClick('first');
548 cls : 'x-btn-text-icon',
550 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
565 render : function (_self)
567 _this.searchBox = _self;
569 show : function (_self,e)
571 if (e.getCharCode() != 13) {
574 _this.grid.footer.onClick('first');
576 specialkey : function (_self, e)
578 if (e.getKey() == 13) {
579 _this.grid.footer.onClick('first');
588 click : function (_self, e)
590 _this.grid.footer.onClick('first');
594 icon : rootURL + '/Pman/templates/images/search.gif'
600 click : function (_self, e)
602 _this.searchBox.setValue('');
603 _this.grid.footer.onClick('first');
607 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
617 toggle : function (_self, pressed)
619 _this.grid.footer.onClick('first');
620 this.setText(pressed ? "Show Active" : "Show Removed");
624 render : function (_self)
626 _this.activeButton = _self;
630 text : "Show Removed"
636 xtype: 'ColumnModel',
638 dataIndex : 'project_id_code',
643 renderer : function(v,x,r) {
644 return String.format('<span qtip="{0}">{1}</span>',
645 r.data.project_id_name,
650 xtype: 'ColumnModel',
652 dataIndex : 'company_id_comptype',
656 renderer : function(v,x,r) {
657 if (r.data.office_id) {
658 return String.format('{0} - {1}', v, r.data.office_id_name);
660 return String.format('{0}', v);
664 xtype: 'ColumnModel',
666 dataIndex : 'company_id_name',
670 renderer : function(v,x,r) {
671 if (r.data.office_id) {
672 return String.format('{0} - {1}', v, r.data.office_id_name);
674 return String.format('{0}', v);
678 xtype: 'ColumnModel',
684 renderer : function(v) { return String.format('{0}', v); }
687 xtype: 'ColumnModel',
692 renderer : function(v) { return String.format('{0}', v); }
695 xtype: 'ColumnModel',
700 renderer : function(v) { return String.format('{0}', v); }
703 xtype: 'ColumnModel',
708 renderer : function(v) { return String.format('{0}', v); }
711 xtype: 'ColumnModel',
717 renderer : function(v) {
718 return (v.length && v.indexOf('@') > 0 ) ?
719 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
723 xtype: 'ColumnModel',
725 dataIndex : 'active',
728 renderer : function(v) {
729 var state = v> 0 ? '-checked' : '';
731 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
738 this.layout = this.panel.layout;