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');
53 autoExpandColumn : 'code',
59 //_this.dialog = Pman.Dialog.FILL_IN
60 if (_this.panel.active) {
61 this.footer.onClick('first');
64 rowdblclick : function (_self, rowIndex, e)
66 if (!_this.dialog) return;
67 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
68 _this.grid.footer.onClick('first');
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',
441 renderer : function(v) { return String.format('{0}', v); }
444 xtype: 'ColumnModel',
448 dataIndex : 'comptype',
449 renderer : function(v) { return String.format('{0}', v); }
452 xtype: 'ColumnModel',
457 renderer : function(v) { return String.format('{0}', v); }
460 xtype: 'ColumnModel',
464 dataIndex : 'remarks',
465 renderer : function(v) { return String.format('{0}', v); }
468 xtype: 'ColumnModel',
472 dataIndex : 'owner_id',
473 renderer : function(v) { return String.format('{0}', v); }
476 xtype: 'ColumnModel',
480 dataIndex : 'address',
481 renderer : function(v) { return String.format('{0}', v); }
484 xtype: 'ColumnModel',
489 renderer : function(v) { return String.format('{0}', v); }
492 xtype: 'ColumnModel',
497 renderer : function(v) { return String.format('{0}', v); }
500 xtype: 'ColumnModel',
505 renderer : function(v) { return String.format('{0}', v); }
508 xtype: 'ColumnModel',
513 renderer : function(v) { return String.format('{0}', v); }
516 xtype: 'ColumnModel',
520 dataIndex : 'isOwner',
521 renderer : function(v) { return String.format('{0}', v); }
524 xtype: 'ColumnModel',
528 dataIndex : 'logo_id',
529 renderer : function(v) { return String.format('{0}', v); }
532 xtype: 'ColumnModel',
534 header : 'Background color',
536 dataIndex : 'background_color',
537 renderer : function(v) { return String.format('{0}', v); }
540 xtype: 'ColumnModel',
544 dataIndex : 'comptype',
545 renderer : function(v) { return String.format('{0}', v); }
548 xtype: 'ColumnModel',
553 renderer : function(v) { return String.format('{0}', v); }
556 xtype: 'ColumnModel',
558 header : 'Main office',
560 dataIndex : 'main_office_id',
561 renderer : function(v) { return String.format('{0}', v); }
564 xtype: 'ColumnModel',
566 header : 'Created by',
568 dataIndex : 'created_by',
569 renderer : function(v) { return String.format('{0}', v); }
572 xtype: 'ColumnModel',
574 header : 'Created dt',
576 dataIndex : 'created_dt',
577 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
580 xtype: 'ColumnModel',
582 header : 'Updated by',
584 dataIndex : 'updated_by',
585 renderer : function(v) { return String.format('{0}', v); }
588 xtype: 'ColumnModel',
590 header : 'Updated dt',
592 dataIndex : 'updated_dt',
593 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
596 xtype: 'ColumnModel',
600 dataIndex : 'passwd',
601 renderer : function(v) { return String.format('{0}', v); }
604 xtype: 'ColumnModel',
606 header : 'Dispatch port',
608 dataIndex : 'dispatch_port',
609 renderer : function(v) { return String.format('{0}', v); }
612 xtype: 'ColumnModel',
616 dataIndex : 'province',
617 renderer : function(v) { return String.format('{0}', v); }
620 xtype: 'ColumnModel',
624 dataIndex : 'country',
625 renderer : function(v) { return String.format('{0}', v); }
630 this.layout = this.panel.layout;