1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.AdminOffice = new Roo.XComponent({
6 part : ["Admin","Office"],
7 order : '001-Pman.Tab.AdminOffice',
9 parent : 'Pman.Tab.AdminCompanies',
10 name : "Pman.Tab.AdminOffice",
21 activate : function() {
24 _this.grid.footer.onClick('first');
33 title : "Offices / Departments / Sub-Companies",
41 _this.dialog =Pman.Dialog.Office;
42 if (_this.panel.active) {
43 this.footer.onClick('first');
46 rowdblclick : function (_self, rowIndex, e)
48 if (!_this.dialog) return;
49 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
50 _this.grid.footer.onClick('first');
54 autoExpandColumn : 'name',
60 beforeload : function (_self, o)
63 var sm = Pman.Tab.AdminCompanies.grid.getSelectionModel();
64 sm = sm.getSelected();
65 if (!sm || !sm.data.id) {
70 o.params.company_id = sm.data.id ;
79 sortInfo : { field : 'name', direction: 'ASC' },
84 url : baseURL + '/Roo/Office.php'
89 totalProperty : 'total',
126 'name': 'company_id_code',
130 'name': 'company_id_name',
134 'name': 'company_id_remarks',
138 'name': 'company_id_owner_id',
142 'name': 'company_id_address',
146 'name': 'company_id_tel',
150 'name': 'company_id_fax',
154 'name': 'company_id_email',
158 'name': 'company_id_id',
162 'name': 'company_id_isOwner',
166 'name': 'company_id_logo_id',
170 'name': 'company_id_background_color',
174 'name': 'company_id_comptype',
178 'name': 'company_id_url',
182 'name': 'company_id_main_office_id',
186 'name': 'company_id_created_by',
190 'name': 'company_id_created_dt',
194 'name': 'company_id_updated_by',
198 'name': 'company_id_updated_dt',
202 'name': 'company_id_passwd',
206 'name': 'company_id_dispatch_port',
210 'name': 'company_id_province',
214 'name': 'company_id_country',
221 xtype: 'PagingToolbar',
225 displayMsg : "Displaying Office{0} - {1} of {2}",
226 emptyMsg : "No Office found"
238 if (!_this.dialog) return;
240 var cdata = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data;
243 company_name : cdata.name,
244 company_id : cdata.id,
245 address : cdata.address,
250 _this.grid.footer.onClick('first');
254 cls : 'x-btn-text-icon',
256 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
264 var s = _this.grid.getSelectionModel().getSelections();
265 if (!s.length || (s.length > 1)) {
266 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
269 if (!_this.dialog) return;
270 s[0].data.company_name = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data.name;
271 _this.dialog.show(s[0].data, function() {
272 _this.grid.footer.onClick('first');
277 cls : 'x-btn-text-icon',
279 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
285 cls : 'x-btn-text-icon',
286 icon : rootURL + '/Pman/templates/images/trash.gif',
290 Pman.genericDelete(_this, 'Office');
298 xtype: 'ColumnModel',
301 header : 'Name / Department / Sub Comp.',
304 renderer : function(v) { return String.format('{0}', v); }
307 xtype: 'ColumnModel',
312 renderer : function(v) { return String.format('{0}', v); }
315 xtype: 'ColumnModel',
320 renderer : function(v) { return String.format('{0}', v); }
323 xtype: 'ColumnModel',
328 renderer : function (v) {
329 return (v.length && v.indexOf('@') > 0 ) ?
330 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
335 xtype: 'ColumnModel',
337 dataIndex : 'address',
340 renderer : function(v) { return String.format('{0}', v); }