From 6dd42856ee40166f73fb8f8b1a72c59a9c143331 Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 19 Feb 2019 13:51:54 +0800 Subject: [PATCH] Fix #5702 - Supplier contact details - extra fields --- Pman.Dialog.AdminGeoCityEdit.bjs | 232 +++++++ Pman.Dialog.AdminGeoCityEdit.js | 358 ++++++++++ Pman.Dialog.AdminGeoDivisionEdit.bjs | 161 +++++ Pman.Dialog.AdminGeoDivisionEdit.js | 254 ++++++++ Pman.Tab.AdminGeoLocations.bjs | 520 +++++++++++++++ Pman.Tab.AdminGeoLocations.js | 931 +++++++++++++++++++++++++++ 6 files changed, 2456 insertions(+) create mode 100644 Pman.Dialog.AdminGeoCityEdit.bjs create mode 100644 Pman.Dialog.AdminGeoCityEdit.js create mode 100644 Pman.Dialog.AdminGeoDivisionEdit.bjs create mode 100644 Pman.Dialog.AdminGeoDivisionEdit.js create mode 100644 Pman.Tab.AdminGeoLocations.bjs create mode 100644 Pman.Tab.AdminGeoLocations.js diff --git a/Pman.Dialog.AdminGeoCityEdit.bjs b/Pman.Dialog.AdminGeoCityEdit.bjs new file mode 100644 index 0000000..801842a --- /dev/null +++ b/Pman.Dialog.AdminGeoCityEdit.bjs @@ -0,0 +1,232 @@ +{ + "name" : "Pman.Dialog.AdminGeoCityEdit", + "parent" : "", + "title" : "", + "path" : "/home/edward/gitlive/Pman.Admin/Pman.Dialog.AdminGeoCityEdit.bjs", + "permname" : "", + "modOrder" : "001", + "strings" : { + "59716c97497eb9694541f7c3d37b1a4d" : "Country", + "3c1df4260ce594cb5594696461087f2f" : "Select Country", + "43ccafccb532cc57c20bc05a36aad7b7" : "Add / Edit City", + "4a39a1ff7adda1ac731be5bf500d0812" : "Select Division", + "45c10605e0a492fbe7a3eac258cd1e81" : "Time Zone", + "1243daf593fa297e07ab03bf06d925af" : "Searching...", + "ea4788705e6873b424c65e91c2846b19" : "Cancel", + "25f75488c91cb6c3bab92672e479619f" : "Postal Code", + "49ee3087348e8d44e1feda1917443987" : "Name", + "c9cc8cce247e49bae79f15173ce97354" : "Save", + "3025cdaab2deb0bb2cd642449e570833" : "Division" + }, + "named_strings" : { + "country_name_qtip" : "3c1df4260ce594cb5594696461087f2f", + "division_id_name_qtip" : "4a39a1ff7adda1ac731be5bf500d0812", + "time_zone_fieldLabel" : "45c10605e0a492fbe7a3eac258cd1e81", + "country_name_emptyText" : "3c1df4260ce594cb5594696461087f2f", + "postal_code_fieldLabel" : "25f75488c91cb6c3bab92672e479619f", + "name_fieldLabel" : "49ee3087348e8d44e1feda1917443987", + "country_name_loadingText" : "1243daf593fa297e07ab03bf06d925af", + "division_id_name_emptyText" : "4a39a1ff7adda1ac731be5bf500d0812", + "division_id_name_fieldLabel" : "3025cdaab2deb0bb2cd642449e570833", + "division_id_name_loadingText" : "1243daf593fa297e07ab03bf06d925af", + "country_name_fieldLabel" : "59716c97497eb9694541f7c3d37b1a4d" + }, + "items" : [ + { + "modal" : true, + "collapsible" : false, + "title" : "Add / Edit City", + "xtype" : "LayoutDialog", + "width" : 400, + "$ xns" : "Roo", + "closable" : false, + "resizable" : false, + "height" : 250, + "items" : [ + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" + }, + { + "region" : "center", + "xtype" : "ContentPanel", + "$ xns" : "Roo", + "items" : [ + { + "listeners" : { + "|actioncomplete" : "function(_self, action)\n{\n if (action.type == 'setdata') {\n \n if(_this.data.id) {\n this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n }\n return;\n }\n if (action.type == 'load') {\n \n _this.dialog.el.unmask();\n \n _this.data = action.result.data;\n \n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n}\n", + "|rendered" : "function (form)\n{\n _this.form= form;\n}\n" + }, + "$ url" : "baseURL + '/Roo/geoip_city.php'", + "style" : "margin:10px;", + "method" : "POST", + "xtype" : "Form", + "labelWidth" : 100, + "$ xns" : "Roo.form", + "items" : [ + { + "Boolean allowBlank" : false, + "fieldLabel" : "Name", + "xtype" : "TextField", + "width" : 200, + "$ xns" : "Roo.form", + "name" : "name" + }, + { + "fieldLabel" : "Postal Code", + "xtype" : "TextField", + "width" : 200, + "$ xns" : "Roo.form", + "name" : "postal_code" + }, + { + "fieldLabel" : "Time Zone", + "xtype" : "TextField", + "width" : 200, + "$ xns" : "Roo.form", + "name" : "time_zone" + }, + { + "alwaysQuery" : true, + "listWidth" : 400, + "triggerAction" : "all", + "fieldLabel" : "Country", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "lval", + "emptyText" : "Select Country", + "hiddenName" : "country", + "minChars" : 2, + "valueField" : "lkey", + "xtype" : "ComboBox", + "allowBlank" : false, + "typeAhead" : true, + "editable" : true, + "width" : 200, + "$ xns" : "Roo.form", + "name" : "country_name", + "qtip" : "Select Country", + "queryParam" : "query[name]", + "tpl" : "
{lval}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.ltype = 'c',\n o.params.inlang = 'en';\n o.is_active = 1;\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ direction : 'ASC', field: 'lval' }", + "$ xns" : "Roo.data", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/i18n.php'", + "xtype" : "HttpProxy", + "method" : "GET", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n \"name\":\"id\",\n \"type\":\"int\"\n },\n {\n \"name\":\"code\",\n \"type\":\"string\"\n },\n {\n \"name\":\"name\",\n \"type\":\"string\"\n },\n {\n \"name\":\"country\",\n \"type\":\"string\"\n },\n {\n \"name\":\"country_name\",\n \"type\":\"string\"\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + }, + { + "listeners" : { + "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n var country = _this.form.findField('country').getValue();\n \n if(!country.length) {\n Roo.MessageBox.alert('Error', 'Please select a country');\n return false;\n }\n}" + }, + "alwaysQuery" : true, + "listWidth" : 400, + "triggerAction" : "all", + "fieldLabel" : "Division", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "name", + "emptyText" : "Select Division", + "hiddenName" : "division_id", + "minChars" : 2, + "valueField" : "id", + "xtype" : "ComboBox", + "typeAhead" : true, + "editable" : true, + "width" : 200, + "$ xns" : "Roo.form", + "name" : "division_id_name", + "qtip" : "Select Division", + "queryParam" : "query[name]", + "tpl" : "
{name}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n \n var country = _this.form.findField('country').getValue();\n \n if(!country.length) {\n return false;\n }\n \n o.params.country = country;\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ direction : 'ASC', field: 'name' }", + "$ xns" : "Roo.data", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/geoip_division.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n \"name\":\"id\",\n \"type\":\"int\"\n },\n {\n \"name\":\"name\",\n \"type\":\"string\"\n },\n {\n \"name\":\"country\",\n \"type\":\"string\"\n },\n {\n \"name\":\"country_name\",\n \"type\":\"string\"\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + }, + { + "xtype" : "Hidden", + "$ xns" : "Roo.form", + "name" : "id" + } + ] + } + ] + }, + { + "listeners" : { + "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}" + }, + "text" : "Cancel", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + }, + { + "listeners" : { + "click" : "function (_self, e)\n{\n _this.form.doAction(\"submit\");\n}" + }, + "text" : "Save", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + } + ] + } + ] +} \ No newline at end of file diff --git a/Pman.Dialog.AdminGeoCityEdit.js b/Pman.Dialog.AdminGeoCityEdit.js new file mode 100644 index 0000000..b4d9093 --- /dev/null +++ b/Pman.Dialog.AdminGeoCityEdit.js @@ -0,0 +1,358 @@ +//