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');
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 cellclick : function (_self, rowIndex, columnIndex, e)
72 var di = this.colModel.getDataIndex(columnIndex);
77 var rec = _this.grid.ds.getAt(rowIndex);
79 rec.set('active', rec.data.active ? 0 : 1);
85 autoExpandColumn : 'name',
93 beforeload : function (_self, o)
96 o.params['!company_id_comptype'] = 'OWNER';
97 o.params['query[search]'] = _this.searchBox.getValue();
99 if (!_this.showActive) {return; false;}
102 o.params.status = _this.showActive.toggled ? 1 : 0;
104 if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {
105 var tms = Pman.Tab.ContactsGroup.grid.getLeftSelections();
108 o.params['query[in_group]'] = tms[0].data.id;
109 o.params['query[type]'] = 2; // group type..
112 //o.params['query[name]'] = _this.searchBox.getValue();
116 update : function (_self, record, operation)
118 if (operation != 'commit') {
121 // only used to change active status.
124 url : baseURL + '/Roo/Person.php',
128 active: record.data.active
131 success : function() {
136 Roo.MessageBox.alert("Error", "saving failed", function() {
137 _this.grid.footer.onClick('first');
144 sortInfo : { field : 'name', direction: 'ASC' },
149 url : baseURL + '/Roo/Person.php'
154 totalProperty : 'total',
183 'name': 'company_id',
211 'name': 'no_reset_sent',
215 'name': 'action_type',
219 'name': 'project_id',
223 'name': 'office_id_id',
227 'name': 'office_id_company_id',
231 'name': 'office_id_name',
235 'name': 'office_id_address',
239 'name': 'office_id_phone',
243 'name': 'office_id_fax',
247 'name': 'office_id_email',
251 'name': 'office_id_role',
255 'name': 'company_id_code',
259 'name': 'company_id_name',
263 'name': 'company_id_remarks',
267 'name': 'company_id_owner_id',
271 'name': 'company_id_address',
275 'name': 'company_id_tel',
279 'name': 'company_id_fax',
283 'name': 'company_id_email',
287 'name': 'company_id_id',
291 'name': 'company_id_isOwner',
295 'name': 'company_id_logo_id',
299 'name': 'company_id_background_color',
303 'name': 'company_id_comptype',
307 'name': 'company_id_url',
311 'name': 'company_id_main_office_id',
315 'name': 'company_id_created_by',
319 'name': 'company_id_created_dt',
323 'name': 'company_id_updated_by',
327 'name': 'company_id_updated_dt',
331 'name': 'company_id_passwd',
335 'name': 'project_id_id',
339 'name': 'project_id_name',
343 'name': 'project_id_remarks',
347 'name': 'project_id_owner_id',
351 'name': 'project_id_code',
355 'name': 'project_id_active',
359 'name': 'project_id_type',
363 'name': 'project_id_client_id',
367 'name': 'project_id_team_id',
371 'name': 'project_id_file_location',
375 'name': 'project_id_open_date',
379 'name': 'project_id_open_by',
383 'name': 'project_id_close_date',
387 'name': 'project_id_countries',
391 'name': 'project_id_languages',
395 'name': 'project_id_agency_id',
399 'name': 'owner_id_id',
403 'name': 'owner_id_office_id',
407 'name': 'owner_id_name',
411 'name': 'owner_id_phone',
415 'name': 'owner_id_fax',
419 'name': 'owner_id_email',
423 'name': 'owner_id_company_id',
427 'name': 'owner_id_role',
431 'name': 'owner_id_active',
435 'name': 'owner_id_remarks',
439 'name': 'owner_id_passwd',
443 'name': 'owner_id_owner_id',
447 'name': 'owner_id_lang',
451 'name': 'owner_id_no_reset_sent',
455 'name': 'owner_id_action_type',
459 'name': 'owner_id_project_id',
466 xtype: 'PagingToolbar',
470 displayMsg : 'Displaying Person{0} - {1} of {2}',
471 emptyMsg : 'No Person found',
476 text : "Drag person to add or remove from group"
491 Pman.Dialog.PersonEdit.dialog.show( { id : 0 } , function() {
492 _this.grid.footer.onClick('first');
496 cls : 'x-btn-text-icon',
498 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
507 Pman.Dialog.PersonBulkAdd.dialog.show( { id : 0 } , function() {
508 _this.grid.footer.onClick('first');
512 cls : 'x-btn-text-icon',
514 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
522 var s = _this.grid.getSelectionModel().getSelections();
523 if (!s.length || (s.length > 1)) {
524 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
528 Pman.Dialog.PersonEdit.dialog.show(s[0].data, function() {
529 _this.grid.footer.onClick('first');
534 cls : 'x-btn-text-icon',
536 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
551 render : function (_self)
553 _this.searchBox = _self;
555 show : function (_self,e)
557 if (e.getCharCode() != 13) {
560 _this.grid.footer.onClick('first');
568 click : function (_self, e)
570 _this.grid.footer.onClick('first');
574 icon : rootURL + '/Pman/templates/images/search.gif'
580 click : function (_self, e)
582 _this.searchBox.setValue('');
583 _this.grid.footer.onClick('first');
587 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
597 text : "Show Removed"
603 xtype: 'ColumnModel',
605 dataIndex : 'project_id_code',
608 renderer : function(v,x,r) {
609 return String.format('<span qtip="{0}">{1}</span>',
610 r.data.project_id_name,
615 xtype: 'ColumnModel',
617 dataIndex : 'company_id_comptype',
620 renderer : function(v,x,r) {
621 if (r.data.office_id) {
622 return String.format('{0} - {1}', v, r.data.office_id_name);
624 return String.format('{0}', v);
628 xtype: 'ColumnModel',
630 dataIndex : 'company_id_name',
633 renderer : function(v,x,r) {
634 if (r.data.office_id) {
635 return String.format('{0} - {1}', v, r.data.office_id_name);
637 return String.format('{0}', v);
641 xtype: 'ColumnModel',
646 renderer : function(v) { return String.format('{0}', v); }
649 xtype: 'ColumnModel',
654 renderer : function(v) { return String.format('{0}', v); }
657 xtype: 'ColumnModel',
662 renderer : function(v) { return String.format('{0}', v); }
665 xtype: 'ColumnModel',
670 renderer : function(v) { return String.format('{0}', v); }
673 xtype: 'ColumnModel',
678 renderer : function(v) {
679 return (v.length && v.indexOf('@') > 0 ) ?
680 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
684 xtype: 'ColumnModel',
686 dataIndex : 'active',
689 renderer : function(v) {
690 var state = v> 0 ? '-checked' : '';
692 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
699 this.layout = this.panel.layout;