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.AdminGeoLocations = new Roo.XComponent({
10 'f2b734f9d29a7b036a5f26b229f1e918' :"Geographic Locations",
11 '59716c97497eb9694541f7c3d37b1a4d' :"Country",
12 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
13 'fc6f97505d89fe9277965c126744647a' :"No Companies found",
14 '7dce122004969d56ae2e0245cb754d35' :"Edit",
15 '646f95b46cdc6ae59dd9f2e86bf3b598' :"Displaying Country {0} - {1} of {2}",
16 '7faaef9675ee0e8280a243a290569359' :"No. Provinces",
17 'bbf2182dd4040fabc2b5433c32fd60f4' :"Province / District",
18 '05a43538cbc752df5428fe0a71192d09' :"No. Cities",
19 '155ca6a755e25c15ad7ce45e2f638f10' :"Displaying Companies{0} - {1} of {2}",
20 '57d056ed0984166336b7879c2af3657f' :"City",
21 'c6b5d0bb9a0c3f077863fdaef9773f7c' :"Province",
22 '31311feefd4f3253ed255d109da1480b' :"No Country found",
23 '42e3bd04a7339573df51e33a0e4e8969' :"Search Province",
24 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
25 '49ee3087348e8d44e1feda1917443987' :"Name",
26 '90fd8a29b37d805cf75af6a3809bca87' :"Search City",
27 '08b523137281088adf3cb1883c8e5627' :"Search Country",
28 '36dc0beb80c36193ac81b4f94e915e36' :"Country Name"
31 part : ["Admin", "GeoLocations" ],
32 order : '100-Pman.Tab.AdminGeoLocations',
34 parent : 'Pman.Tab.Admin',
35 name : "unnamed module",
38 _tree : function(_data)
43 xtype : 'NestedLayoutPanel',
46 title : _this._strings['f2b734f9d29a7b036a5f26b229f1e918'] /* Geographic Locations */,
50 xtype : 'BorderLayout',
54 xtype : 'LayoutRegion',
59 xtype : 'LayoutRegion',
66 xtype : 'LayoutRegion',
79 title : _this._strings['59716c97497eb9694541f7c3d37b1a4d'] /* Country */,
81 activate : function() {
83 _this.country_panel = this;
84 if (_this.country_grid) {
85 _this.country_grid.footer.onClick('first');
93 autoExpandColumn : 'lval',
98 _this.country_grid = this;
100 if (_this.country_panel.active) {
101 this.footer.onClick('first');
108 xtype : 'PagingToolbar',
110 displayMsg : _this._strings['646f95b46cdc6ae59dd9f2e86bf3b598'] /* Displaying Country {0} - {1} of {2} */,
111 emptyMsg : _this._strings['31311feefd4f3253ed255d109da1480b'] /* No Country found */,
123 emptyText : _this._strings['08b523137281088adf3cb1883c8e5627'] /* Search Country */,
125 render : function (_self)
127 _this.country_searchBox = _self;
129 specialkey : function (_self, e)
131 if (e.getKey() == 13) {
132 _this.country_grid.footer.onClick('first');
142 icon : rootURL + '/Pman/templates/images/search.gif',
144 click : function (_self, e)
146 _this.country_grid.footer.onClick('first');
150 '|xns' : 'Roo.Toolbar'
155 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
157 click : function (_self, e)
159 _this.country_searchBox.setValue('');
160 _this.country_grid.footer.onClick('first');
164 '|xns' : 'Roo.Toolbar'
171 sortInfo : { field: 'lval', direction: 'ASC' },
173 beforeload : function (_self, options)
175 options.params = options.params || {};
177 options.params.ltype = 'c',
178 options.params.inlang = 'en';
179 options.is_active = 1;
181 options.params['query[name]'] = _this.country_searchBox.getValue();
183 options.params._with_geoip_count = 1;
185 load : function (_self, records, options)
187 _this.province_grid.footer.onClick('first');
195 url : baseURL + '/Roo/i18n.php',
200 xtype : 'JsonReader',
227 'name': 'no_of_division',
231 'name': 'no_of_city',
237 totalProperty : 'total',
243 xtype : 'RowSelectionModel',
246 afterselectionchange : function (_self)
248 _this.province_grid.footer.onClick('first');
256 xtype : 'ColumnModel',
258 header : _this._strings['36dc0beb80c36193ac81b4f94e915e36'] /* Country Name */,
259 renderer : function(v)
261 return String.format('{0}', v ? v : '');
269 xtype : 'ColumnModel',
271 dataIndex : 'no_of_division',
272 header : _this._strings['7faaef9675ee0e8280a243a290569359'] /* No. Provinces */,
273 renderer : function(v)
275 return String.format('{0}', v ? v : '');
283 xtype : 'ColumnModel',
285 dataIndex : 'no_of_city',
286 header : _this._strings['05a43538cbc752df5428fe0a71192d09'] /* No. Cities */,
287 renderer : function(v)
289 return String.format('{0}', v ? v : '');
304 tableName : 'geoip_division',
305 title : _this._strings['c6b5d0bb9a0c3f077863fdaef9773f7c'] /* Province */,
307 activate : function() {
308 _this.province_panel = this;
309 if (_this.province_grid) {
310 _this.province_grid.footer.onClick('first');
318 autoExpandColumn : 'name',
323 _this.province_grid = this;
325 if (_this.province_panel.active) {
326 this.footer.onClick('first');
329 rowdblclick : function (_self, rowIndex, e)
331 var s = _this.province_grid.getDataSource().getAt(rowIndex);
333 Pman.Dialog.AdminGeoDivisionEdit.show({
336 _this.province_grid.footer.onClick('refresh');
343 xtype : 'PagingToolbar',
345 displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
346 emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
358 emptyText : _this._strings['42e3bd04a7339573df51e33a0e4e8969'] /* Search Province */,
360 render : function (_self)
362 _this.province_searchBox = _self;
364 specialkey : function (_self, e)
366 if (e.getKey() == 13) {
367 _this.province_grid.footer.onClick('first');
377 icon : rootURL + '/Pman/templates/images/search.gif',
379 click : function (_self, e)
381 _this.provincegrid.footer.onClick('first');
385 '|xns' : 'Roo.Toolbar'
390 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
392 click : function (_self, e)
394 _this.province_searchBox.setValue('');
395 _this.province_grid.footer.onClick('first');
399 '|xns' : 'Roo.Toolbar'
404 '|xns' : 'Roo.Toolbar'
408 cls : 'x-btn-text-icon',
409 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
410 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
414 var country = _this.country_grid.getSelectionModel().getSelected();
416 Pman.Dialog.AdminGeoDivisionEdit.show({
418 country : (country) ? country.data.lkey : '',
419 country_name : (country) ? country.data.lval : ''
421 _this.country_grid.footer.onClick('refresh');
427 '|xns' : 'Roo.Toolbar'
431 cls : 'x-btn-text-icon',
432 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
433 text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
437 var s = _this.province_grid.getSelectionModel().getSelected();
440 Roo.MessageBox.alert("Error", "Select a Row");
444 Pman.Dialog.AdminGeoDivisionEdit.show({
447 _this.province_grid.footer.onClick('refresh');
453 '|xns' : 'Roo.Toolbar'
457 cls : 'x-btn-text-icon',
458 icon : rootURL + '/Pman/templates/images/trash.gif',
459 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
463 var s = _this.province_grid.getSelectionModel().getSelected();
466 Roo.MessageBox.alert("Error", "Select a Row");
470 Roo.MessageBox.confirm(
472 "Are you sure want to delete this division",
479 url : baseURL + '/Roo/geoip_division',
483 success : function() {
484 _this.country_grid.footer.onClick('refresh');
492 '|xns' : 'Roo.Toolbar'
499 sortInfo : { field: 'name', direction: 'ASC' },
501 beforeload : function (_self, options)
503 options.params = options.params || {};
505 var country = _this.country_grid.getSelectionModel().getSelected();
512 options.params.country = country.data.lkey;
514 options.params['query[name]'] = _this.province_searchBox.getValue();
516 options.params._with_geoip_count = 1;
518 load : function (_self, records, options)
520 _this.city_grid.footer.onClick('first');
528 url : baseURL + '/Roo/geoip_division.php',
533 xtype : 'JsonReader',
552 'name': 'country_name',
556 'name': 'no_of_city',
562 totalProperty : 'total',
568 xtype : 'RowSelectionModel',
571 afterselectionchange : function (_self)
573 _this.city_grid.footer.onClick('first');
581 xtype : 'ColumnModel',
583 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
584 renderer : function(v)
586 return String.format('{0}', v ? v : '');
594 xtype : 'ColumnModel',
596 dataIndex : 'no_of_city',
597 header : _this._strings['05a43538cbc752df5428fe0a71192d09'] /* No. Cities */,
598 renderer : function(v)
600 return String.format('{0}', v ? v : '');
615 tableName : 'geoip_city',
616 title : _this._strings['57d056ed0984166336b7879c2af3657f'] /* City */,
618 activate : function() {
620 _this.city_panel = this;
621 if (_this.city_grid) {
622 _this.city_grid.footer.onClick('first');
630 autoExpandColumn : 'name',
635 _this.city_grid = this;
637 if (_this.city_panel.active) {
638 this.footer.onClick('first');
641 rowdblclick : function (_self, rowIndex, e)
643 var s = _this.city_grid.getDataSource().getAt(rowIndex);
645 Pman.Dialog.AdminGeoCityEdit.show({
648 _this.city_grid.footer.onClick('refresh');
656 xtype : 'PagingToolbar',
658 displayMsg : _this._strings['646f95b46cdc6ae59dd9f2e86bf3b598'] /* Displaying Country {0} - {1} of {2} */,
659 emptyMsg : _this._strings['31311feefd4f3253ed255d109da1480b'] /* No Country found */,
671 emptyText : _this._strings['90fd8a29b37d805cf75af6a3809bca87'] /* Search City */,
673 render : function (_self)
675 _this.city_searchBox = _self;
677 specialkey : function (_self, e)
679 if (e.getKey() == 13) {
680 _this.city_grid.footer.onClick('first');
690 icon : rootURL + '/Pman/templates/images/search.gif',
692 click : function (_self, e)
694 _this.country_grid.footer.onClick('first');
698 '|xns' : 'Roo.Toolbar'
703 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
705 click : function (_self, e)
707 _this.country_searchBox.setValue('');
708 _this.country_grid.footer.onClick('first');
712 '|xns' : 'Roo.Toolbar'
717 '|xns' : 'Roo.Toolbar'
721 cls : 'x-btn-text-icon',
722 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
723 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
727 var country = _this.country_grid.getSelectionModel().getSelected();
729 var province = _this.province_grid.getSelectionModel().getSelected();
731 Pman.Dialog.AdminGeoCityEdit.show({
733 country : (country) ? country.data.lkey : '',
734 country_name : (country) ? country.data.lval : '',
735 division_id : (province) ? province.data.id : '',
736 division_id_name : (province) ? province.data.name : ''
738 _this.country_grid.footer.onClick('refresh');
744 '|xns' : 'Roo.Toolbar'
748 cls : 'x-btn-text-icon',
749 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
750 text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
754 var s = _this.city_grid.getSelectionModel().getSelections();
756 if (!s.length || s.length > 1) {
757 Roo.MessageBox.alert("Error", "Select a single city");
761 Pman.Dialog.AdminGeoCityEdit.show({
764 _this.city_grid.footer.onClick('refresh');
770 '|xns' : 'Roo.Toolbar'
774 cls : 'x-btn-text-icon',
775 icon : rootURL + '/Pman/templates/images/trash.gif',
776 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
780 var s = _this.city_grid.getSelectionModel().getSelections();
783 Roo.MessageBox.alert("Error", "Select city to delete");
789 Roo.each(s, function(v, k){
793 Roo.MessageBox.confirm(
795 "Are you sure want to delete the selected city",
802 url : baseURL + '/Roo/geoip_city',
804 _delete : ids.join(',')
806 success : function() {
807 _this.country_grid.footer.onClick('refresh');
815 '|xns' : 'Roo.Toolbar'
822 sortInfo : { field: 'name', direction: 'ASC' },
824 beforeload : function (_self, options)
826 options.params = options.params || {};
828 var country = _this.country_grid.getSelectionModel().getSelected();
835 options.params.country = country.data.lkey;
837 var province = _this.province_grid.getSelectionModel().getSelected();
840 options.params.division_id = province.data.id
843 options.params['query[name]'] = _this.city_searchBox.getValue();
851 url : baseURL + '/Roo/geoip_city.php',
856 xtype : 'JsonReader',
871 'name': 'country_name',
875 'name': 'division_id',
879 'name': 'division_id_name',
883 'name': 'postal_code',
893 totalProperty : 'total',
900 xtype : 'ColumnModel',
902 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
903 renderer : function(v)
905 return String.format('{0}', v ? v : '');
913 xtype : 'ColumnModel',
914 dataIndex : 'division_id_name',
915 header : _this._strings['bbf2182dd4040fabc2b5433c32fd60f4'] /* Province / District */,
916 renderer : function(v)
918 return String.format('{0}', v ? v : '');