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 : '030-Pman.Tab.AdminCompanies',
12 module : Pman.Tab.AdminCompanies,
14 parent : Pman.Tab.Admin,
15 name : "Pman.Tab.AdminCompanies",
21 Pman.Tab.AdminCompanies = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
34 xtype: 'NestedLayoutPanel',
38 xtype: 'BorderLayout',
45 activate : function() {
48 _this.grid.footer.onClick('first');
56 tableName : 'Companies',
65 _this.dialog = Pman.Dialog.Companies;
66 if (_this.panel.active) {
67 this.footer.onClick('first');
70 rowdblclick : function (_self, rowIndex, e)
72 if (!_this.dialog) return;
73 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
74 _this.grid.footer.onClick('first');
77 rowclick : function (_self, rowIndex, e)
79 try { Pman.Tab.AdminOffice.paging.onClick('refresh'); } catch(e) {}
82 autoExpandColumn : 'name',
88 load : function (_self, records, options)
91 Pman.Tab.Office.grid.footer.onClick('refresh');
96 sortInfo : { field : 'code', direction: 'ASC' },
101 load : function (This, o, arg)
107 url : baseURL + '/Roo/Companies.php'
112 totalProperty : 'total',
161 'name': 'background_color',
173 'name': 'main_office_id',
177 'name': 'created_by',
181 'name': 'created_dt',
183 'dateFormat': 'Y-m-d'
186 'name': 'updated_by',
190 'name': 'updated_dt',
192 'dateFormat': 'Y-m-d'
199 'name': 'dispatch_port',
211 'name': 'logo_id_id',
215 'name': 'logo_id_filename',
219 'name': 'logo_id_ontable',
223 'name': 'logo_id_onid',
227 'name': 'logo_id_mimetype',
231 'name': 'logo_id_width',
235 'name': 'logo_id_height',
239 'name': 'logo_id_filesize',
243 'name': 'logo_id_displayorder',
247 'name': 'logo_id_language',
251 'name': 'logo_id_parent_image_id',
255 'name': 'logo_id_created',
259 'name': 'logo_id_imgtype',
263 'name': 'logo_id_linkurl',
267 'name': 'logo_id_descript',
271 'name': 'logo_id_title',
275 'name': 'owner_id_id',
279 'name': 'owner_id_office_id',
283 'name': 'owner_id_name',
287 'name': 'owner_id_phone',
291 'name': 'owner_id_fax',
295 'name': 'owner_id_email',
299 'name': 'owner_id_company_id',
303 'name': 'owner_id_role',
307 'name': 'owner_id_active',
311 'name': 'owner_id_remarks',
315 'name': 'owner_id_passwd',
319 'name': 'owner_id_owner_id',
323 'name': 'owner_id_lang',
327 'name': 'owner_id_no_reset_sent',
331 'name': 'owner_id_action_type',
335 'name': 'owner_id_project_id',
339 'name': 'owner_id_deleted_by',
343 'name': 'owner_id_deleted_dt',
347 'name': 'main_office_id_id',
351 'name': 'main_office_id_company_id',
355 'name': 'main_office_id_name',
359 'name': 'main_office_id_address',
363 'name': 'main_office_id_phone',
367 'name': 'main_office_id_fax',
371 'name': 'main_office_id_email',
375 'name': 'main_office_id_role',
382 xtype: 'PagingToolbar',
386 displayMsg : 'Displaying Companies{0} - {1} of {2}',
387 emptyMsg : 'No Companies found'
397 show : function (_self)
399 _this.searchBox = _self;
407 click : function (_self, e)
409 _this.grid.footer.onClick('first');
413 icon : rootURL + '/Pman/templates/images/search.gif'
419 click : function (_self, e)
421 _this.searchBox.setValue('');
422 _this.grid.footer.onClick('first');
426 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
436 cls : 'x-btn-text-icon',
437 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
441 if (!_this.dialog) return;
442 _this.dialog.show( { id : 0 } , function() {
443 _this.grid.footer.onClick('first');
454 var s = _this.grid.getSelectionModel().getSelections();
455 if (!s.length || (s.length > 1)) {
456 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
459 if (!_this.dialog) return;
460 _this.dialog.show(s[0].data, function() {
461 _this.grid.footer.onClick('first');
466 cls : 'x-btn-text-icon',
468 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
474 cls : 'x-btn-text-icon',
475 icon : rootURL + '/Pman/templates/images/trash.gif',
479 Pman.genericDelete(_this, 'Companies');
487 xtype: 'ColumnModel',
489 dataIndex : 'comptype',
493 renderer : function (v,x ,r) {
494 return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
498 xtype: 'ColumnModel',
503 renderer : function(v) { return String.format('{0}', v); }
506 xtype: 'ColumnModel',
511 renderer : function(v,x,r) {
512 return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);
516 xtype: 'ColumnModel',
521 renderer : function(v) { return String.format('{0}', v); }
524 xtype: 'ColumnModel',
529 renderer : function(v) { return String.format('{0}', v); }
532 xtype: 'ColumnModel',
537 renderer : function (v) {
538 return (v.length && v.indexOf('@') > 0 ) ?
539 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
544 xtype: 'ColumnModel',
548 dataIndex : 'address',
549 renderer : function(v) { return String.format('{0}', v); }
552 xtype: 'ColumnModel',
556 dataIndex : 'remarks',
557 renderer : function(v) { return String.format('{0}', v); }
564 xtype: 'LayoutRegion',
568 xtype: 'LayoutRegion',
573 this.layout = this.panel.layout;