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.showActive) {return; false;}
103 o.params.status = _this.showActive.toggled ? 1 : 0;
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() {
137 Roo.MessageBox.alert("Error", "saving failed", function() {
138 _this.grid.footer.onClick('first');
145 sortInfo : { field : 'name', direction: 'ASC' },
150 url : baseURL + '/Roo/Person.php'
155 totalProperty : 'total',
184 'name': 'company_id',
212 'name': 'no_reset_sent',
216 'name': 'action_type',
220 'name': 'project_id',
224 'name': 'office_id_id',
228 'name': 'office_id_company_id',
232 'name': 'office_id_name',
236 'name': 'office_id_address',
240 'name': 'office_id_phone',
244 'name': 'office_id_fax',
248 'name': 'office_id_email',
252 'name': 'office_id_role',
256 'name': 'company_id_code',
260 'name': 'company_id_name',
264 'name': 'company_id_remarks',
268 'name': 'company_id_owner_id',
272 'name': 'company_id_address',
276 'name': 'company_id_tel',
280 'name': 'company_id_fax',
284 'name': 'company_id_email',
288 'name': 'company_id_id',
292 'name': 'company_id_isOwner',
296 'name': 'company_id_logo_id',
300 'name': 'company_id_background_color',
304 'name': 'company_id_comptype',
308 'name': 'company_id_url',
312 'name': 'company_id_main_office_id',
316 'name': 'company_id_created_by',
320 'name': 'company_id_created_dt',
324 'name': 'company_id_updated_by',
328 'name': 'company_id_updated_dt',
332 'name': 'company_id_passwd',
336 'name': 'project_id_id',
340 'name': 'project_id_name',
344 'name': 'project_id_remarks',
348 'name': 'project_id_owner_id',
352 'name': 'project_id_code',
356 'name': 'project_id_active',
360 'name': 'project_id_type',
364 'name': 'project_id_client_id',
368 'name': 'project_id_team_id',
372 'name': 'project_id_file_location',
376 'name': 'project_id_open_date',
380 'name': 'project_id_open_by',
384 'name': 'project_id_close_date',
388 'name': 'project_id_countries',
392 'name': 'project_id_languages',
396 'name': 'project_id_agency_id',
400 'name': 'owner_id_id',
404 'name': 'owner_id_office_id',
408 'name': 'owner_id_name',
412 'name': 'owner_id_phone',
416 'name': 'owner_id_fax',
420 'name': 'owner_id_email',
424 'name': 'owner_id_company_id',
428 'name': 'owner_id_role',
432 'name': 'owner_id_active',
436 'name': 'owner_id_remarks',
440 'name': 'owner_id_passwd',
444 'name': 'owner_id_owner_id',
448 'name': 'owner_id_lang',
452 'name': 'owner_id_no_reset_sent',
456 'name': 'owner_id_action_type',
460 'name': 'owner_id_project_id',
467 xtype: 'PagingToolbar',
471 displayMsg : 'Displaying Person{0} - {1} of {2}',
472 emptyMsg : 'No Person found',
477 text : "Drag person to add or remove from group"
492 Pman.Dialog.PersonEdit.dialog.show( { id : 0 } , function() {
493 _this.grid.footer.onClick('first');
497 cls : 'x-btn-text-icon',
499 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
508 Pman.Dialog.PersonBulkAdd.dialog.show( { id : 0 } , function() {
509 _this.grid.footer.onClick('first');
513 cls : 'x-btn-text-icon',
515 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
523 var s = _this.grid.getSelectionModel().getSelections();
524 if (!s.length || (s.length > 1)) {
525 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
529 Pman.Dialog.PersonEdit.dialog.show(s[0].data, function() {
530 _this.grid.footer.onClick('first');
535 cls : 'x-btn-text-icon',
537 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
552 render : function (_self)
554 _this.searchBox = _self;
556 show : function (_self,e)
558 if (e.getCharCode() != 13) {
561 _this.grid.footer.onClick('first');
569 click : function (_self, e)
571 _this.grid.footer.onClick('first');
575 icon : rootURL + '/Pman/templates/images/search.gif'
581 click : function (_self, e)
583 _this.searchBox.setValue('');
584 _this.grid.footer.onClick('first');
588 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
598 toggle : function (_self, pressed)
600 _this.grid.footer.onClick('first');
601 this.setText(pressed ? "Hide Removed" : "Show Removed");
605 render : function (_self)
607 _this.activeButton = _self;
611 text : "Show Removed"
617 xtype: 'ColumnModel',
619 dataIndex : 'project_id_code',
622 renderer : function(v,x,r) {
623 return String.format('<span qtip="{0}">{1}</span>',
624 r.data.project_id_name,
630 xtype: 'ColumnModel',
632 dataIndex : 'company_id_comptype',
635 renderer : function(v,x,r) {
636 if (r.data.office_id) {
637 return String.format('{0} - {1}', v, r.data.office_id_name);
639 return String.format('{0}', v);
643 xtype: 'ColumnModel',
645 dataIndex : 'company_id_name',
648 renderer : function(v,x,r) {
649 if (r.data.office_id) {
650 return String.format('{0} - {1}', v, r.data.office_id_name);
652 return String.format('{0}', v);
656 xtype: 'ColumnModel',
661 renderer : function(v) { return String.format('{0}', v); }
664 xtype: 'ColumnModel',
669 renderer : function(v) { return String.format('{0}', v); }
672 xtype: 'ColumnModel',
677 renderer : function(v) { return String.format('{0}', v); }
680 xtype: 'ColumnModel',
685 renderer : function(v) { return String.format('{0}', v); }
688 xtype: 'ColumnModel',
693 renderer : function(v) {
694 return (v.length && v.indexOf('@') > 0 ) ?
695 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
699 xtype: 'ColumnModel',
701 dataIndex : 'active',
704 renderer : function(v) {
705 var state = v> 0 ? '-checked' : '';
707 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
714 this.layout = this.panel.layout;