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');
58 //_this.dialog = Pman.Dialog.FILL_IN
59 if (_this.panel.active) {
60 this.footer.onClick('first');
63 rowdblclick : function (_self, rowIndex, e)
65 if (!_this.dialog) return;
66 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
67 _this.grid.footer.onClick('first');
70 cellclick : function (_self, rowIndex, columnIndex, e)
73 var di = this.colModel.getDataIndex(columnIndex);
78 var rec = _this.grid.ds.getAt(rowIndex);
80 rec.set('active', rec.data.active ? 0 : 1);
86 autoExpandColumn : 'name',
94 beforeload : function (_self, o)
97 o.params['!company_id_comptype'] = 'OWNER';
98 o.params['query[search]'] = _this.searchBox.getValue();
100 if (!_this.activeButton) {return; false;}
103 o.params.active = _this.activeButton.pressed ? 0 : 1;
105 if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {
106 var tms = Pman.Tab.ContactsGroup.grid.getLeftSelections();
109 o.params['query[in_group]'] = tms[0].data.id;
110 o.params['query[type]'] = 2; // group type..
113 //o.params['query[name]'] = _this.searchBox.getValue();
117 update : function (_self, record, operation)
119 if (operation != 'commit') {
122 // only used to change active status.
125 url : baseURL + '/Roo/Person.php',
129 active: record.data.active
132 success : function() {
135 _this.grid.ds.remove(record);
140 Roo.MessageBox.alert("Error", "saving failed", function() {
141 _this.grid.footer.onClick('first');
148 sortInfo : { field : 'name', direction: 'ASC' },
153 url : baseURL + '/Roo/Person.php'
158 totalProperty : 'total',
187 'name': 'company_id',
215 'name': 'no_reset_sent',
219 'name': 'action_type',
223 'name': 'project_id',
227 'name': 'office_id_id',
231 'name': 'office_id_company_id',
235 'name': 'office_id_name',
239 'name': 'office_id_address',
243 'name': 'office_id_phone',
247 'name': 'office_id_fax',
251 'name': 'office_id_email',
255 'name': 'office_id_role',
259 'name': 'company_id_code',
263 'name': 'company_id_name',
267 'name': 'company_id_remarks',
271 'name': 'company_id_owner_id',
275 'name': 'company_id_address',
279 'name': 'company_id_tel',
283 'name': 'company_id_fax',
287 'name': 'company_id_email',
291 'name': 'company_id_id',
295 'name': 'company_id_isOwner',
299 'name': 'company_id_logo_id',
303 'name': 'company_id_background_color',
307 'name': 'company_id_comptype',
311 'name': 'company_id_url',
315 'name': 'company_id_main_office_id',
319 'name': 'company_id_created_by',
323 'name': 'company_id_created_dt',
327 'name': 'company_id_updated_by',
331 'name': 'company_id_updated_dt',
335 'name': 'company_id_passwd',
339 'name': 'project_id_id',
343 'name': 'project_id_name',
347 'name': 'project_id_remarks',
351 'name': 'project_id_owner_id',
355 'name': 'project_id_code',
359 'name': 'project_id_active',
363 'name': 'project_id_type',
367 'name': 'project_id_client_id',
371 'name': 'project_id_team_id',
375 'name': 'project_id_file_location',
379 'name': 'project_id_open_date',
383 'name': 'project_id_open_by',
387 'name': 'project_id_close_date',
391 'name': 'project_id_countries',
395 'name': 'project_id_languages',
399 'name': 'project_id_agency_id',
403 'name': 'owner_id_id',
407 'name': 'owner_id_office_id',
411 'name': 'owner_id_name',
415 'name': 'owner_id_phone',
419 'name': 'owner_id_fax',
423 'name': 'owner_id_email',
427 'name': 'owner_id_company_id',
431 'name': 'owner_id_role',
435 'name': 'owner_id_active',
439 'name': 'owner_id_remarks',
443 'name': 'owner_id_passwd',
447 'name': 'owner_id_owner_id',
451 'name': 'owner_id_lang',
455 'name': 'owner_id_no_reset_sent',
459 'name': 'owner_id_action_type',
463 'name': 'owner_id_project_id',
470 xtype: 'PagingToolbar',
474 displayMsg : 'Displaying Person{0} - {1} of {2}',
475 emptyMsg : 'No Person found',
480 text : "Drag person to add or remove from group"
495 Pman.Dialog.PersonEdit.dialog.show( { id : 0 } , function() {
496 _this.grid.footer.onClick('first');
500 cls : 'x-btn-text-icon',
502 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
511 Pman.Dialog.PersonBulkAdd.dialog.show( { id : 0 } , function() {
512 _this.grid.footer.onClick('first');
516 cls : 'x-btn-text-icon',
518 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
526 var s = _this.grid.getSelectionModel().getSelections();
527 if (!s.length || (s.length > 1)) {
528 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
532 Pman.Dialog.PersonEdit.dialog.show(s[0].data, function() {
533 _this.grid.footer.onClick('first');
538 cls : 'x-btn-text-icon',
540 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
555 render : function (_self)
557 _this.searchBox = _self;
559 show : function (_self,e)
561 if (e.getCharCode() != 13) {
564 _this.grid.footer.onClick('first');
572 click : function (_self, e)
574 _this.grid.footer.onClick('first');
578 icon : rootURL + '/Pman/templates/images/search.gif'
584 click : function (_self, e)
586 _this.searchBox.setValue('');
587 _this.grid.footer.onClick('first');
591 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
601 toggle : function (_self, pressed)
603 _this.grid.footer.onClick('first');
604 this.setText(pressed ? "Show Active" : "Show Removed");
608 render : function (_self)
610 _this.activeButton = _self;
614 text : "Show Removed"
620 xtype: 'ColumnModel',
622 dataIndex : 'project_id_code',
627 renderer : function(v,x,r) {
628 return String.format('<span qtip="{0}">{1}</span>',
629 r.data.project_id_name,
634 xtype: 'ColumnModel',
636 dataIndex : 'company_id_comptype',
640 renderer : function(v,x,r) {
641 if (r.data.office_id) {
642 return String.format('{0} - {1}', v, r.data.office_id_name);
644 return String.format('{0}', v);
648 xtype: 'ColumnModel',
650 dataIndex : 'company_id_name',
654 renderer : function(v,x,r) {
655 if (r.data.office_id) {
656 return String.format('{0} - {1}', v, r.data.office_id_name);
658 return String.format('{0}', v);
662 xtype: 'ColumnModel',
667 renderer : function(v) { return String.format('{0}', v); }
670 xtype: 'ColumnModel',
675 renderer : function(v) { return String.format('{0}', v); }
678 xtype: 'ColumnModel',
683 renderer : function(v) { return String.format('{0}', v); }
686 xtype: 'ColumnModel',
691 renderer : function(v) { return String.format('{0}', v); }
694 xtype: 'ColumnModel',
699 renderer : function(v) {
700 return (v.length && v.indexOf('@') > 0 ) ?
701 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
705 xtype: 'ColumnModel',
707 dataIndex : 'active',
710 renderer : function(v) {
711 var state = v> 0 ? '-checked' : '';
713 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
720 this.layout = this.panel.layout;