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');
95 beforeload : function (_self, o)
97 o.params = o.params || {};
98 o.params['query[name]'] = _this.searchBox.getValue();
102 sortInfo : { field : 'name', direction: 'ASC' },
107 load : function (This, o, arg)
113 url : baseURL + '/Roo/Companies.php'
118 totalProperty : 'total',
167 'name': 'background_color',
179 'name': 'main_office_id',
183 'name': 'created_by',
187 'name': 'created_dt',
189 'dateFormat': 'Y-m-d'
192 'name': 'updated_by',
196 'name': 'updated_dt',
198 'dateFormat': 'Y-m-d'
205 'name': 'dispatch_port',
217 'name': 'logo_id_id',
221 'name': 'logo_id_filename',
225 'name': 'logo_id_ontable',
229 'name': 'logo_id_onid',
233 'name': 'logo_id_mimetype',
237 'name': 'logo_id_width',
241 'name': 'logo_id_height',
245 'name': 'logo_id_filesize',
249 'name': 'logo_id_displayorder',
253 'name': 'logo_id_language',
257 'name': 'logo_id_parent_image_id',
261 'name': 'logo_id_created',
265 'name': 'logo_id_imgtype',
269 'name': 'logo_id_linkurl',
273 'name': 'logo_id_descript',
277 'name': 'logo_id_title',
281 'name': 'owner_id_id',
285 'name': 'owner_id_office_id',
289 'name': 'owner_id_name',
293 'name': 'owner_id_phone',
297 'name': 'owner_id_fax',
301 'name': 'owner_id_email',
305 'name': 'owner_id_company_id',
309 'name': 'owner_id_role',
313 'name': 'owner_id_active',
317 'name': 'owner_id_remarks',
321 'name': 'owner_id_passwd',
325 'name': 'owner_id_owner_id',
329 'name': 'owner_id_lang',
333 'name': 'owner_id_no_reset_sent',
337 'name': 'owner_id_action_type',
341 'name': 'owner_id_project_id',
345 'name': 'owner_id_deleted_by',
349 'name': 'owner_id_deleted_dt',
353 'name': 'main_office_id_id',
357 'name': 'main_office_id_company_id',
361 'name': 'main_office_id_name',
365 'name': 'main_office_id_address',
369 'name': 'main_office_id_phone',
373 'name': 'main_office_id_fax',
377 'name': 'main_office_id_email',
381 'name': 'main_office_id_role',
388 xtype: 'PagingToolbar',
392 displayMsg : 'Displaying Companies{0} - {1} of {2}',
393 emptyMsg : 'No Companies found'
403 show : function (_self)
405 _this.searchBox = _self;
407 specialkey : function (_self, e)
409 if (e.getKey() == 13) {
410 _this.grid.footer.onClick( 'first' );
419 click : function (_self, e)
421 _this.grid.footer.onClick('first');
425 icon : rootURL + '/Pman/templates/images/search.gif'
431 click : function (_self, e)
433 _this.searchBox.setValue('');
434 _this.grid.footer.onClick('first');
438 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
448 cls : 'x-btn-text-icon',
449 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
453 if (!_this.dialog) return;
454 _this.dialog.show( { id : 0 } , function() {
455 _this.grid.footer.onClick('first');
466 var s = _this.grid.getSelectionModel().getSelections();
467 if (!s.length || (s.length > 1)) {
468 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
471 if (!_this.dialog) return;
472 _this.dialog.show(s[0].data, function() {
473 _this.grid.footer.onClick('first');
478 cls : 'x-btn-text-icon',
480 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
486 cls : 'x-btn-text-icon',
487 icon : rootURL + '/Pman/templates/images/trash.gif',
491 Pman.genericDelete(_this, 'Companies');
499 xtype: 'ColumnModel',
501 dataIndex : 'comptype',
505 renderer : function (v,x ,r) {
506 return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
510 xtype: 'ColumnModel',
516 renderer : function(v) { return String.format('{0}', v); }
519 xtype: 'ColumnModel',
525 renderer : function(v,x,r) {
526 return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);
530 xtype: 'ColumnModel',
535 renderer : function(v) { return String.format('{0}', v); }
538 xtype: 'ColumnModel',
543 renderer : function(v) { return String.format('{0}', v); }
546 xtype: 'ColumnModel',
552 renderer : function (v) {
553 return (v.length && v.indexOf('@') > 0 ) ?
554 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
559 xtype: 'ColumnModel',
561 dataIndex : 'address',
565 renderer : function(v) { return String.format('{0}', v); }
568 xtype: 'ColumnModel',
572 dataIndex : 'remarks',
573 renderer : function(v) { return String.format('{0}', v); }
580 xtype: 'LayoutRegion',
584 xtype: 'LayoutRegion',
589 this.layout = this.panel.layout;