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',
39 xtype: 'BorderLayout',
46 activate : function() {
49 _this.grid.footer.onClick('first');
57 tableName : 'Companies',
66 _this.dialog = Pman.Dialog.Companies;
67 if (_this.panel.active) {
68 this.footer.onClick('first');
71 rowdblclick : function (_self, rowIndex, e)
73 if (!_this.dialog) return;
74 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
75 _this.grid.footer.onClick('first');
78 rowclick : function (_self, rowIndex, e)
80 try { Pman.Tab.AdminOffice.paging.onClick('refresh'); } catch(e) {}
83 autoExpandColumn : 'name',
89 load : function (_self, records, options)
92 Pman.Tab.AdminOffice.grid.footer.onClick('refresh');
97 sortInfo : { field : 'name', direction: 'ASC' },
102 load : function (This, o, arg)
108 url : baseURL + '/Roo/Companies.php'
113 totalProperty : 'total',
162 'name': 'background_color',
174 'name': 'main_office_id',
178 'name': 'created_by',
182 'name': 'created_dt',
184 'dateFormat': 'Y-m-d'
187 'name': 'updated_by',
191 'name': 'updated_dt',
193 'dateFormat': 'Y-m-d'
200 'name': 'dispatch_port',
212 'name': 'logo_id_id',
216 'name': 'logo_id_filename',
220 'name': 'logo_id_ontable',
224 'name': 'logo_id_onid',
228 'name': 'logo_id_mimetype',
232 'name': 'logo_id_width',
236 'name': 'logo_id_height',
240 'name': 'logo_id_filesize',
244 'name': 'logo_id_displayorder',
248 'name': 'logo_id_language',
252 'name': 'logo_id_parent_image_id',
256 'name': 'logo_id_created',
260 'name': 'logo_id_imgtype',
264 'name': 'logo_id_linkurl',
268 'name': 'logo_id_descript',
272 'name': 'logo_id_title',
276 'name': 'owner_id_id',
280 'name': 'owner_id_office_id',
284 'name': 'owner_id_name',
288 'name': 'owner_id_phone',
292 'name': 'owner_id_fax',
296 'name': 'owner_id_email',
300 'name': 'owner_id_company_id',
304 'name': 'owner_id_role',
308 'name': 'owner_id_active',
312 'name': 'owner_id_remarks',
316 'name': 'owner_id_passwd',
320 'name': 'owner_id_owner_id',
324 'name': 'owner_id_lang',
328 'name': 'owner_id_no_reset_sent',
332 'name': 'owner_id_action_type',
336 'name': 'owner_id_project_id',
340 'name': 'owner_id_deleted_by',
344 'name': 'owner_id_deleted_dt',
348 'name': 'main_office_id_id',
352 'name': 'main_office_id_company_id',
356 'name': 'main_office_id_name',
360 'name': 'main_office_id_address',
364 'name': 'main_office_id_phone',
368 'name': 'main_office_id_fax',
372 'name': 'main_office_id_email',
376 'name': 'main_office_id_role',
383 xtype: 'PagingToolbar',
387 displayMsg : 'Displaying Companies{0} - {1} of {2}',
388 emptyMsg : 'No Companies found'
398 show : function (_self)
400 _this.searchBox = _self;
408 click : function (_self, e)
410 _this.grid.footer.onClick('first');
414 icon : rootURL + '/Pman/templates/images/search.gif'
420 click : function (_self, e)
422 _this.searchBox.setValue('');
423 _this.grid.footer.onClick('first');
427 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
437 cls : 'x-btn-text-icon',
438 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
442 if (!_this.dialog) return;
443 _this.dialog.show( { id : 0 } , function() {
444 _this.grid.footer.onClick('first');
455 var s = _this.grid.getSelectionModel().getSelections();
456 if (!s.length || (s.length > 1)) {
457 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
460 if (!_this.dialog) return;
461 _this.dialog.show(s[0].data, function() {
462 _this.grid.footer.onClick('first');
467 cls : 'x-btn-text-icon',
469 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
475 cls : 'x-btn-text-icon',
476 icon : rootURL + '/Pman/templates/images/trash.gif',
480 Pman.genericDelete(_this, 'Companies');
488 xtype: 'ColumnModel',
490 dataIndex : 'comptype',
494 renderer : function (v,x ,r) {
495 return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
499 xtype: 'ColumnModel',
505 renderer : function(v) { return String.format('{0}', v); }
508 xtype: 'ColumnModel',
514 renderer : function(v,x,r) {
515 return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);
519 xtype: 'ColumnModel',
524 renderer : function(v) { return String.format('{0}', v); }
527 xtype: 'ColumnModel',
532 renderer : function(v) { return String.format('{0}', v); }
535 xtype: 'ColumnModel',
541 renderer : function (v) {
542 return (v.length && v.indexOf('@') > 0 ) ?
543 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
548 xtype: 'ColumnModel',
550 dataIndex : 'address',
554 renderer : function(v) { return String.format('{0}', v); }
557 xtype: 'ColumnModel',
561 dataIndex : 'remarks',
562 renderer : function(v) { return String.format('{0}', v); }
569 xtype: 'LayoutRegion',
573 xtype: 'LayoutRegion',
578 this.layout = this.panel.layout;