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.AdminOffice',
12 module : Pman.Tab.AdminOffice,
14 parent : Pman.Tab.AdminCompanies,
15 name : "Pman.Tab.AdminOffice",
21 Pman.Tab.AdminOffice = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
37 activate : function() {
40 _this.grid.footer.onClick('first');
49 title : "Offices / Departments / Sub-Companies",
53 autoExpandColumn : 'name',
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 beforeload : function (_self, o)
79 var sm = Pman.Tab.AdminCompanies.grid.getSelectionModel();
80 sm = sm.getSelected();
81 if (!sm || !sm.data.id) {
86 o.params.company_id = sm.data.id ;
94 sortInfo : { field : 'name', direction: 'ASC' },
99 url : baseURL + '/Roo/Office.php'
104 totalProperty : 'total',
113 'name': 'company_id',
141 'name': 'company_id_code',
145 'name': 'company_id_name',
149 'name': 'company_id_remarks',
153 'name': 'company_id_owner_id',
157 'name': 'company_id_address',
161 'name': 'company_id_tel',
165 'name': 'company_id_fax',
169 'name': 'company_id_email',
173 'name': 'company_id_id',
177 'name': 'company_id_isOwner',
181 'name': 'company_id_logo_id',
185 'name': 'company_id_background_color',
189 'name': 'company_id_comptype',
193 'name': 'company_id_url',
197 'name': 'company_id_main_office_id',
201 'name': 'company_id_created_by',
205 'name': 'company_id_created_dt',
209 'name': 'company_id_updated_by',
213 'name': 'company_id_updated_dt',
217 'name': 'company_id_passwd',
221 'name': 'company_id_dispatch_port',
225 'name': 'company_id_province',
229 'name': 'company_id_country',
236 xtype: 'PagingToolbar',
240 displayMsg : 'Displaying Office{0} - {1} of {2}',
241 emptyMsg : 'No Office found'
251 cls : 'x-btn-text-icon',
252 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
256 if (!_this.dialog) return;
257 _this.dialog.show( { id : 0 } , function() {
258 _this.grid.footer.onClick('first');
267 cls : 'x-btn-text-icon',
268 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
272 var s = _this.grid.getSelectionModel().getSelections();
273 if (!s.length || (s.length > 1)) {
274 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
277 if (!_this.dialog) return;
278 _this.dialog.show(s[0].data, function() {
279 _this.grid.footer.onClick('first');
289 cls : 'x-btn-text-icon',
290 icon : rootURL + '/Pman/templates/images/trash.gif',
294 Pman.genericDelete(_this, 'Office');
302 xtype: 'ColumnModel',
305 header : 'Name / Department / Sub Comp.',
308 renderer : function(v) { return String.format('{0}', v); }
311 xtype: 'ColumnModel',
316 renderer : function(v) { return String.format('{0}', v); }
319 xtype: 'ColumnModel',
324 renderer : function(v) { return String.format('{0}', v); }
327 xtype: 'ColumnModel',
332 renderer : function (v) {
333 return (v.length && v.indexOf('@') > 0 ) ?
334 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
339 xtype: 'ColumnModel',
341 dataIndex : 'address',
344 renderer : function(v) { return String.format('{0}', v); }
349 this.layout = this.panel.layout;