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();
100 if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {
101 var tms = Pman.Tab.ContactsGroup.grid.getLeftSelections();
104 o.params['query[in_group]'] = tms[0].data.id;
105 o.params['query[type]'] = 2; // group type..
108 //o.params['query[name]'] = _this.searchBox.getValue();
112 update : function (_self, record, operation)
114 if (operation != 'commit') {
117 // only used to change active status.
120 url : baseURL + '/Roo/Person.php',
124 active: record.data.active
127 success : function() {
132 Roo.MessageBox.alert("Error", "saving failed", function() {
133 _this.grid.footer.onClick('first');
140 sortInfo : { field : 'name', direction: 'ASC' },
145 url : baseURL + '/Roo/Person.php'
150 totalProperty : 'total',
179 'name': 'company_id',
207 'name': 'no_reset_sent',
211 'name': 'action_type',
215 'name': 'project_id',
219 'name': 'office_id_id',
223 'name': 'office_id_company_id',
227 'name': 'office_id_name',
231 'name': 'office_id_address',
235 'name': 'office_id_phone',
239 'name': 'office_id_fax',
243 'name': 'office_id_email',
247 'name': 'office_id_role',
251 'name': 'company_id_code',
255 'name': 'company_id_name',
259 'name': 'company_id_remarks',
263 'name': 'company_id_owner_id',
267 'name': 'company_id_address',
271 'name': 'company_id_tel',
275 'name': 'company_id_fax',
279 'name': 'company_id_email',
283 'name': 'company_id_id',
287 'name': 'company_id_isOwner',
291 'name': 'company_id_logo_id',
295 'name': 'company_id_background_color',
299 'name': 'company_id_comptype',
303 'name': 'company_id_url',
307 'name': 'company_id_main_office_id',
311 'name': 'company_id_created_by',
315 'name': 'company_id_created_dt',
319 'name': 'company_id_updated_by',
323 'name': 'company_id_updated_dt',
327 'name': 'company_id_passwd',
331 'name': 'project_id_id',
335 'name': 'project_id_name',
339 'name': 'project_id_remarks',
343 'name': 'project_id_owner_id',
347 'name': 'project_id_code',
351 'name': 'project_id_active',
355 'name': 'project_id_type',
359 'name': 'project_id_client_id',
363 'name': 'project_id_team_id',
367 'name': 'project_id_file_location',
371 'name': 'project_id_open_date',
375 'name': 'project_id_open_by',
379 'name': 'project_id_close_date',
383 'name': 'project_id_countries',
387 'name': 'project_id_languages',
391 'name': 'project_id_agency_id',
395 'name': 'owner_id_id',
399 'name': 'owner_id_office_id',
403 'name': 'owner_id_name',
407 'name': 'owner_id_phone',
411 'name': 'owner_id_fax',
415 'name': 'owner_id_email',
419 'name': 'owner_id_company_id',
423 'name': 'owner_id_role',
427 'name': 'owner_id_active',
431 'name': 'owner_id_remarks',
435 'name': 'owner_id_passwd',
439 'name': 'owner_id_owner_id',
443 'name': 'owner_id_lang',
447 'name': 'owner_id_no_reset_sent',
451 'name': 'owner_id_action_type',
455 'name': 'owner_id_project_id',
462 xtype: 'PagingToolbar',
466 displayMsg : 'Displaying Person{0} - {1} of {2}',
467 emptyMsg : 'No Person found',
472 text : "Drag person to add or remove from group"
487 Pman.Dialog.PersonEdit.dialog.show( { id : 0 } , function() {
488 _this.grid.footer.onClick('first');
492 cls : 'x-btn-text-icon',
494 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
503 Pman.Dialog.PersonBulkAdd.dialog.show( { id : 0 } , function() {
504 _this.grid.footer.onClick('first');
508 cls : 'x-btn-text-icon',
510 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
518 var s = _this.grid.getSelectionModel().getSelections();
519 if (!s.length || (s.length > 1)) {
520 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
524 Pman.Dialog.PersonEdit.dialog.show(s[0].data, function() {
525 _this.grid.footer.onClick('first');
530 cls : 'x-btn-text-icon',
532 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
547 render : function (_self)
549 _this.searchBox = _self;
551 show : function (_self,e)
553 if (e.getCharCode() != 13) {
556 _this.grid.footer.onClick('first');
564 click : function (_self, e)
566 _this.grid.footer.onClick('first');
570 icon : rootURL + '/Pman/templates/images/search.gif'
576 click : function (_self, e)
578 _this.searchBox.setValue('');
579 _this.grid.footer.onClick('first');
583 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
593 text : "Show Removed"
599 xtype: 'ColumnModel',
601 dataIndex : 'project_id_code',
604 renderer : function(v,x,r) {
605 return String.format('<span qtip="{0}">{1}</span>',
606 r.data.project_id_name,
611 xtype: 'ColumnModel',
613 dataIndex : 'company_id_comptype',
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);
624 xtype: 'ColumnModel',
626 dataIndex : 'company_id_name',
629 renderer : function(v,x,r) {
630 if (r.data.office_id) {
631 return String.format('{0} - {1}', v, r.data.office_id_name);
633 return String.format('{0}', v);
637 xtype: 'ColumnModel',
642 renderer : function(v) { return String.format('{0}', v); }
645 xtype: 'ColumnModel',
650 renderer : function(v) { return String.format('{0}', v); }
653 xtype: 'ColumnModel',
658 renderer : function(v) { return String.format('{0}', v); }
661 xtype: 'ColumnModel',
666 renderer : function(v) { return String.format('{0}', v); }
669 xtype: 'ColumnModel',
674 renderer : function(v) {
675 return (v.length && v.indexOf('@') > 0 ) ?
676 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
680 xtype: 'ColumnModel',
682 dataIndex : 'active',
685 renderer : function(v) {
686 var state = v> 0 ? '-checked' : '';
688 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
695 this.layout = this.panel.layout;