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.AdminCompanies',
12 module : Pman.Tab.AdminCompanies,
15 name : "unnamed module",
21 Pman.Tab.AdminCompanies = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
39 tableName : 'Companies',
43 activate : function() {
46 _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');
70 autoExpandColumn : 'name',
76 load : function (_self, records, options)
79 Pman.Tab.Office.grid.footer.onClick('refresh');
84 sortInfo : { field : 'code', direction: 'ASC' },
89 load : function (This, o, arg)
95 url : baseURL + '/Roo/Companies.php'
100 totalProperty : 'total',
149 'name': 'background_color',
161 'name': 'main_office_id',
165 'name': 'created_by',
169 'name': 'created_dt',
171 'dateFormat': 'Y-m-d'
174 'name': 'updated_by',
178 'name': 'updated_dt',
180 'dateFormat': 'Y-m-d'
187 'name': 'dispatch_port',
199 'name': 'logo_id_id',
203 'name': 'logo_id_filename',
207 'name': 'logo_id_ontable',
211 'name': 'logo_id_onid',
215 'name': 'logo_id_mimetype',
219 'name': 'logo_id_width',
223 'name': 'logo_id_height',
227 'name': 'logo_id_filesize',
231 'name': 'logo_id_displayorder',
235 'name': 'logo_id_language',
239 'name': 'logo_id_parent_image_id',
243 'name': 'logo_id_created',
247 'name': 'logo_id_imgtype',
251 'name': 'logo_id_linkurl',
255 'name': 'logo_id_descript',
259 'name': 'logo_id_title',
263 'name': 'owner_id_id',
267 'name': 'owner_id_office_id',
271 'name': 'owner_id_name',
275 'name': 'owner_id_phone',
279 'name': 'owner_id_fax',
283 'name': 'owner_id_email',
287 'name': 'owner_id_company_id',
291 'name': 'owner_id_role',
295 'name': 'owner_id_active',
299 'name': 'owner_id_remarks',
303 'name': 'owner_id_passwd',
307 'name': 'owner_id_owner_id',
311 'name': 'owner_id_lang',
315 'name': 'owner_id_no_reset_sent',
319 'name': 'owner_id_action_type',
323 'name': 'owner_id_project_id',
327 'name': 'owner_id_deleted_by',
331 'name': 'owner_id_deleted_dt',
335 'name': 'main_office_id_id',
339 'name': 'main_office_id_company_id',
343 'name': 'main_office_id_name',
347 'name': 'main_office_id_address',
351 'name': 'main_office_id_phone',
355 'name': 'main_office_id_fax',
359 'name': 'main_office_id_email',
363 'name': 'main_office_id_role',
370 xtype: 'PagingToolbar',
374 displayMsg : 'Displaying Companies{0} - {1} of {2}',
375 emptyMsg : 'No Companies found'
385 cls : 'x-btn-text-icon',
386 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
390 if (!_this.dialog) return;
391 _this.dialog.show( { id : 0 } , function() {
392 _this.grid.footer.onClick('first');
401 cls : 'x-btn-text-icon',
402 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
406 var s = _this.grid.getSelectionModel().getSelections();
407 if (!s.length || (s.length > 1)) {
408 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
411 if (!_this.dialog) return;
412 _this.dialog.show(s[0].data, function() {
413 _this.grid.footer.onClick('first');
423 cls : 'x-btn-text-icon',
424 icon : rootURL + '/Pman/templates/images/trash.gif',
428 Pman.genericDelete(_this, 'Companies');
436 xtype: 'ColumnModel',
438 dataIndex : 'comptype',
442 renderer : function (v,x ,r) {
443 return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
447 xtype: 'ColumnModel',
452 renderer : function(v) { return String.format('{0}', v); }
455 xtype: 'ColumnModel',
460 renderer : function(v,x,r) {
461 return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);
465 xtype: 'ColumnModel',
470 renderer : function(v) { return String.format('{0}', v); }
473 xtype: 'ColumnModel',
478 renderer : function(v) { return String.format('{0}', v); }
481 xtype: 'ColumnModel',
486 renderer : function (v) {
487 return (v.length && v.indexOf('@') > 0 ) ?
488 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
493 xtype: 'ColumnModel',
497 dataIndex : 'address',
498 renderer : function(v) { return String.format('{0}', v); }
501 xtype: 'ColumnModel',
505 dataIndex : 'remarks',
506 renderer : function(v) { return String.format('{0}', v); }
509 xtype: 'ColumnModel',
514 renderer : function(v) { return String.format('{0}', v); }
517 xtype: 'ColumnModel',
522 renderer : function(v) { return String.format('{0}', v); }
525 xtype: 'ColumnModel',
530 renderer : function(v) { return String.format('{0}', v); }
533 xtype: 'ColumnModel',
537 dataIndex : 'isOwner',
538 renderer : function(v) { return String.format('{0}', v); }
541 xtype: 'ColumnModel',
545 dataIndex : 'logo_id',
546 renderer : function(v) { return String.format('{0}', v); }
549 xtype: 'ColumnModel',
551 header : 'Background color',
553 dataIndex : 'background_color',
554 renderer : function(v) { return String.format('{0}', v); }
557 xtype: 'ColumnModel',
561 dataIndex : 'comptype',
562 renderer : function(v) { return String.format('{0}', v); }
565 xtype: 'ColumnModel',
570 renderer : function(v) { return String.format('{0}', v); }
573 xtype: 'ColumnModel',
575 header : 'Main office',
577 dataIndex : 'main_office_id',
578 renderer : function(v) { return String.format('{0}', v); }
581 xtype: 'ColumnModel',
583 header : 'Created by',
585 dataIndex : 'created_by',
586 renderer : function(v) { return String.format('{0}', v); }
589 xtype: 'ColumnModel',
591 header : 'Created dt',
593 dataIndex : 'created_dt',
594 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
597 xtype: 'ColumnModel',
599 header : 'Updated by',
601 dataIndex : 'updated_by',
602 renderer : function(v) { return String.format('{0}', v); }
605 xtype: 'ColumnModel',
607 header : 'Updated dt',
609 dataIndex : 'updated_dt',
610 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
613 xtype: 'ColumnModel',
617 dataIndex : 'passwd',
618 renderer : function(v) { return String.format('{0}', v); }
621 xtype: 'ColumnModel',
623 header : 'Dispatch port',
625 dataIndex : 'dispatch_port',
626 renderer : function(v) { return String.format('{0}', v); }
629 xtype: 'ColumnModel',
633 dataIndex : 'province',
634 renderer : function(v) { return String.format('{0}', v); }
637 xtype: 'ColumnModel',
641 dataIndex : 'country',
642 renderer : function(v) { return String.format('{0}', v); }
647 this.layout = this.panel.layout;