1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminOffice = new Roo.XComponent({
10 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
11 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
12 '14820f8c54725a56438e99f6bd57dfa3' :"Displaying Office{0} - {1} of {2}",
13 '7dce122004969d56ae2e0245cb754d35' :"Edit",
14 '7407f706267593de473324b2c07ef2fc' :"Offices / Departments / Sub-Companies",
15 '217574e21514de41ec31aaf5ddadb2c3' :"No Office found",
16 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
17 'a8fa7984f57a42bb41143f3d7665bd36' :"Name / Department / Sub Comp.",
18 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
19 'dd7bf230fde8d4836917806aff6a6b27' :"Address",
20 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
23 part : ["Admin", "Office" ],
24 order : '001-Pman.Tab.AdminOffice',
26 parent : 'Pman.Tab.AdminCompanies',
27 name : "Pman.Tab.AdminOffice",
41 title : _this._strings['7407f706267593de473324b2c07ef2fc'] /* Offices / Departments / Sub-Companies */,
43 activate : function() {
46 _this.grid.footer.onClick('first');
54 autoExpandColumn : 'name',
60 _this.dialog =Pman.Dialog.Office;
61 if (_this.panel.active) {
62 this.footer.onClick('first');
65 rowdblclick : function (_self, rowIndex, e)
70 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
71 _this.grid.footer.onClick('first');
78 xtype : 'PagingToolbar',
80 displayMsg : _this._strings['14820f8c54725a56438e99f6bd57dfa3'] /* Displaying Office{0} - {1} of {2} */,
81 emptyMsg : _this._strings['217574e21514de41ec31aaf5ddadb2c3'] /* No Office found */,
93 cls : 'x-btn-text-icon',
94 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
95 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
102 var sd = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected();
104 Roo.MessageBox.alert("Error", "Select an company to add an office to");
108 _this. dialog.show( {
110 company_name : cdata.name,
111 company_id : cdata.id,
112 address : cdata.address,
117 _this.grid.footer.onClick('first');
122 '|xns' : 'Roo.Toolbar'
126 cls : 'x-btn-text-icon',
127 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
128 text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
132 var s = _this.grid.getSelectionModel().getSelections();
133 if (!s.length || (s.length > 1)) {
134 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
140 s[0].data.company_name = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data.name;
141 _this.dialog.show(s[0].data, function() {
142 _this.grid.footer.onClick('first');
148 '|xns' : 'Roo.Toolbar'
152 cls : 'x-btn-text-icon',
153 icon : rootURL + '/Pman/templates/images/trash.gif',
154 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
158 Pman.genericDelete(_this, 'Office');
162 '|xns' : 'Roo.Toolbar'
169 sortInfo : { field : 'name', direction: 'ASC' },
171 beforeload : function (_self, o)
174 var sm = Pman.Tab.AdminCompanies.grid.getSelectionModel();
175 sm = sm.getSelected();
176 if (!sm || !sm.data.id) {
181 o.params.company_id = sm.data.id ;
194 url : baseURL + '/Roo/Office.php',
199 xtype : 'JsonReader',
206 'name': 'company_id',
234 'name': 'company_id_code',
238 'name': 'company_id_name',
242 'name': 'company_id_remarks',
246 'name': 'company_id_owner_id',
250 'name': 'company_id_address',
254 'name': 'company_id_tel',
258 'name': 'company_id_fax',
262 'name': 'company_id_email',
266 'name': 'company_id_id',
270 'name': 'company_id_isOwner',
274 'name': 'company_id_logo_id',
278 'name': 'company_id_background_color',
282 'name': 'company_id_comptype',
286 'name': 'company_id_url',
290 'name': 'company_id_main_office_id',
294 'name': 'company_id_created_by',
298 'name': 'company_id_created_dt',
302 'name': 'company_id_updated_by',
306 'name': 'company_id_updated_dt',
310 'name': 'company_id_passwd',
314 'name': 'company_id_dispatch_port',
318 'name': 'company_id_province',
322 'name': 'company_id_country',
328 totalProperty : 'total',
335 xtype : 'ColumnModel',
337 header : _this._strings['a8fa7984f57a42bb41143f3d7665bd36'] /* Name / Department / Sub Comp. */,
338 renderer : function(v) { return String.format('{0}', v); },
345 xtype : 'ColumnModel',
347 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
348 renderer : function(v) { return String.format('{0}', v); },
354 xtype : 'ColumnModel',
356 header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
357 renderer : function(v) { return String.format('{0}', v); },
363 xtype : 'ColumnModel',
365 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
366 renderer : function (v) {
367 return (v.length && v.indexOf('@') > 0 ) ?
368 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
376 xtype : 'ColumnModel',
377 dataIndex : 'address',
378 header : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
379 renderer : function(v) { return String.format('{0}', v); },