PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminCompany.bjs
1 {
2  "name" : "Pman.Dialog.BAdminCompany",
3  "parent" : "Pman.Tab.BAdmin",
4  "title" : "",
5  "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Dialog.BAdminCompany.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "1c76cbfe21c6f44c1d1e59d54f3e4420" : "Company",
10   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
11   "231bc72756b5e6de492aaaa1577f61b1" : "Remarks",
12   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
13   "bcc254b55c4a1babdf1dcb82c207506b" : "Phone",
14   "66bc3ece76861852889e623217049d32" : "Edit Company Details",
15   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
16   "ca0dbad92a874b2f69b549293387925e" : "Code",
17   "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
18   "dd7bf230fde8d4836917806aff6a6b27" : "Address",
19   "c9cc8cce247e49bae79f15173ce97354" : "Save",
20   "e6b391a8d2c4d45902a23a8b6585703d" : "URL"
21  },
22  "named_strings" : {
23   "tel_fieldLabel" : "bcc254b55c4a1babdf1dcb82c207506b",
24   "comptype_display_name_loadingText" : "1243daf593fa297e07ab03bf06d925af",
25   "code_fieldLabel" : "ca0dbad92a874b2f69b549293387925e",
26   "name_fieldLabel" : "1c76cbfe21c6f44c1d1e59d54f3e4420",
27   "remarks_fieldLabel" : "231bc72756b5e6de492aaaa1577f61b1",
28   "url_fieldLabel" : "e6b391a8d2c4d45902a23a8b6585703d",
29   "email_fieldLabel" : "ce8ae9da5b7cd6c3df2929543a9af92d",
30   "address_fieldLabel" : "dd7bf230fde8d4836917806aff6a6b27",
31   "comptype_display_name_fieldLabel" : "a1fa27779242b4902f7ae3bdd5c6d508"
32  },
33  "items" : [
34   {
35    "listeners" : {
36     "show" : "function (_self)\n{\n    _this.form.findField('code').hide();\n\n    if(appDisabled.indexOf('Coba.SuperAdmin') * 1 == -1) {\n        _this.form.findField('code').show();\n    }\n}",
37     "render" : "function (_self)\n{\n    _this.modal = _self;\n}"
38    },
39    "String cls" : "padding-bottom-trim badmin-dialog-company enable-modal-body-overflow",
40    "xtype" : "Modal",
41    "int max_width" : 650,
42    "$ xns" : "Roo.bootstrap",
43    "String title" : "Edit Company Details",
44    "items" : [
45     {
46      "xtype" : "Container",
47      "$ xns" : "Roo.bootstrap",
48      "String style" : "width: 100%;",
49      "items" : [
50       {
51        "listeners" : {
52         "actionfailed" : "function (_self, action)\n{\n    //Pman.standardActionFailed(_self,action);\n    \n    if (!this.isValid) {\n        return;\n    }\n    \n    Roo.bootstrap.MessageBox.alert(action.result.errorMsg);\n\n}",
53         "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n        _self.reset(); \n\n        if(_this.data.id * 1 > 0) {\n            this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});\n            _this.modal.setTitle('Edit Company Details');\n            \n        } else {\n           _this.modal.setTitle('Create Company');\n        }\n        return;\n    }\n   \n   \n    if (action.type == 'load') {\n        _this.data = action.result.data;\n        \n        if(_this.data.comptype == 'OWNER'){\n            _this.form.findField('comptype').hide();\n        }\n        \n        return;\n    }\n    \n    \n    if (action.type == 'submit') { // only submitted here if we are \n        //_this.dialog.hide();\n        \n        _this.dialog.hide();\n        \n         if (_this.callback) {\n            _this.callback.call(this, action.result.data);\n         }\n        return; \n    }\n}",
54         "render" : "function (_self)\n{\n    _this.form = _self; \n}"
55        },
56        "$ url" : "baseURL + '/Roo/Core_company.php'",
57        "xtype" : "Form",
58        "$ xns" : "Roo.bootstrap",
59        "items" : [
60         {
61          "xtype" : "Row",
62          "$ xns" : "Roo.bootstrap",
63          "items" : [
64           {
65            "Number md" : 12,
66            "xtype" : "Column",
67            "$ xns" : "Roo.bootstrap",
68            "items" : [
69             {
70              "listeners" : {
71               "render" : "function (_self)\n{\n    _this.company = _self;\n}"
72              },
73              "String name" : "code",
74              "xtype" : "Input",
75              "string fieldLabel" : "Code",
76              "$ xns" : "Roo.bootstrap",
77              "String indicatorpos" : "left"
78             }
79            ]
80           }
81          ]
82         },
83         {
84          "xtype" : "Row",
85          "$ xns" : "Roo.bootstrap",
86          "items" : [
87           {
88            "Number md" : 12,
89            "xtype" : "Column",
90            "$ xns" : "Roo.bootstrap",
91            "items" : [
92             {
93              "listeners" : {
94               "render" : "function (_self)\n{\n    _this.type = _self;\n    _self.store.load({});\n}"
95              },
96              "Boolean selectOnFocus" : true,
97              "Boolean allowBlank" : false,
98              "String loadingText" : "Searching...",
99              "String name" : "comptype_display_name",
100              "Number minChars" : 2,
101              "String valueField" : "name",
102              "String queryParam" : "query[name]",
103              "Boolean typeAhead" : false,
104              "xtype" : "ComboBox",
105              "Boolean editable" : false,
106              "String triggerAction" : "all",
107              "string fieldLabel" : "Type",
108              "Boolean alwaysQuery" : true,
109              "$ xns" : "Roo.bootstrap",
110              "String hiddenName" : "comptype",
111              "String displayField" : "display_name",
112              "String indicatorpos" : "left",
113              "items" : [
114               {
115                "listeners" : {
116                 "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    // set more here\n    //o.params['query[empty_etype]'] = 1;\n    options.params.etype = 'COMPTYPE';\n}"
117                },
118                "Object sortInfo" : "{ direction : 'ASC', field: 'id' }",
119                "xtype" : "Store",
120                "boolean remoteSort" : true,
121                "$ xns" : "Roo.data",
122                "* prop" : "store",
123                "items" : [
124                 {
125                  "$ url" : "baseURL + '/Roo/core_enum.php'",
126                  "xtype" : "HttpProxy",
127                  "$ xns" : "Roo.data",
128                  "String method" : "GET",
129                  "* prop" : "proxy"
130                 },
131                 {
132                  "xtype" : "JsonReader",
133                  "String root" : "data",
134                  "$ xns" : "Roo.data",
135                  "String id" : "id",
136                  "* prop" : "reader",
137                  "String totalProperty" : "total"
138                 }
139                ]
140               }
141              ]
142             }
143            ]
144           }
145          ]
146         },
147         {
148          "xtype" : "Row",
149          "$ xns" : "Roo.bootstrap",
150          "items" : [
151           {
152            "Number md" : 12,
153            "xtype" : "Column",
154            "$ xns" : "Roo.bootstrap",
155            "items" : [
156             {
157              "listeners" : {
158               "render" : "function (_self)\n{\n    _this.company = _self;\n}"
159              },
160              "String name" : "name",
161              "xtype" : "Input",
162              "string fieldLabel" : "Company",
163              "$ xns" : "Roo.bootstrap",
164              "String indicatorpos" : "left"
165             }
166            ]
167           }
168          ]
169         },
170         {
171          "xtype" : "Row",
172          "$ xns" : "Roo.bootstrap",
173          "items" : [
174           {
175            "Number md" : 12,
176            "xtype" : "Column",
177            "$ xns" : "Roo.bootstrap",
178            "items" : [
179             {
180              "listeners" : {
181               "render" : "function (_self)\n{\n    _this.address = _self;\n}"
182              },
183              "String name" : "address",
184              "xtype" : "Input",
185              "string fieldLabel" : "Address",
186              "$ xns" : "Roo.bootstrap",
187              "String indicatorpos" : "left"
188             }
189            ]
190           }
191          ]
192         },
193         {
194          "xtype" : "Row",
195          "$ xns" : "Roo.bootstrap",
196          "items" : [
197           {
198            "Number md" : 12,
199            "xtype" : "Column",
200            "$ xns" : "Roo.bootstrap",
201            "items" : [
202             {
203              "listeners" : {
204               "render" : "function (_self)\n{\n    _this.tel = _self;\n}"
205              },
206              "String name" : "tel",
207              "xtype" : "Input",
208              "string fieldLabel" : "Phone",
209              "$ xns" : "Roo.bootstrap",
210              "String indicatorpos" : "left"
211             }
212            ]
213           }
214          ]
215         },
216         {
217          "xtype" : "Row",
218          "$ xns" : "Roo.bootstrap",
219          "items" : [
220           {
221            "Number md" : 12,
222            "xtype" : "Column",
223            "$ xns" : "Roo.bootstrap",
224            "items" : [
225             {
226              "listeners" : {
227               "render" : "function (_self)\n{\n    _this.fax = _self;\n}"
228              },
229              "String name" : "email",
230              "xtype" : "Input",
231              "string fieldLabel" : "Email",
232              "$ xns" : "Roo.bootstrap",
233              "String indicatorpos" : "left"
234             }
235            ]
236           }
237          ]
238         },
239         {
240          "xtype" : "Row",
241          "$ xns" : "Roo.bootstrap",
242          "items" : [
243           {
244            "Number md" : 12,
245            "xtype" : "Column",
246            "$ xns" : "Roo.bootstrap",
247            "items" : [
248             {
249              "listeners" : {
250               "render" : "function (_self)\n{\n    _this.url = _self;\n}"
251              },
252              "String name" : "url",
253              "xtype" : "Input",
254              "string fieldLabel" : "URL",
255              "$ xns" : "Roo.bootstrap",
256              "String indicatorpos" : "left"
257             }
258            ]
259           }
260          ]
261         },
262         {
263          "String cls" : "badmin-company-edit-remark",
264          "xtype" : "Row",
265          "$ xns" : "Roo.bootstrap",
266          "items" : [
267           {
268            "Number md" : 12,
269            "xtype" : "Column",
270            "$ xns" : "Roo.bootstrap",
271            "items" : [
272             {
273              "listeners" : {
274               "render" : "function (_self)\n{\n    _this.remarks = _self;\n}"
275              },
276              "String name" : "remarks",
277              "xtype" : "TextArea",
278              "string fieldLabel" : "Remarks",
279              "$ xns" : "Roo.bootstrap",
280              "String indicatorpos" : "left"
281             }
282            ]
283           }
284          ]
285         },
286         {
287          "listeners" : {
288           "render" : "function (_self)\n{\n    _this.companyID = _self;\n}"
289          },
290          "String name" : "id",
291          "xtype" : "Input",
292          "String inputType" : "hidden",
293          "$ xns" : "Roo.bootstrap"
294         }
295        ]
296       }
297      ]
298     },
299     {
300      "listeners" : {
301       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
302      },
303      "String weight" : "default",
304      "xtype" : "Button",
305      "$ xns" : "Roo.bootstrap",
306      "String html" : "Cancel",
307      "* prop" : "buttons[]"
308     },
309     {
310      "listeners" : {
311       "render" : "function (_self)\n{\n    _this.btn_ok=this;\n}",
312       "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    var myID = _this.form.findField('id').getValue();\n    var myName = _this.form.findField('name').getValue();\n    \n    console.log(myID + ' ' + myName);\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_company.php',\n        method : 'POST',\n        params : {\n          id : _this.form.findField('id').getValue() * 1,\n          name : _this.form.findField('name').getValue(),\n          _check_name : 1\n        }, \n        success : function(res) {\n           \n            // Adding new record\n            _this.form.doAction(\"submit\");\n        },\n        failure : function(res) {\n           _this.form.doAction(\"submit\");\n        }\n    });\n     \n    return;\n    \n}"
313      },
314      "String weight" : "primary",
315      "xtype" : "Button",
316      "$ xns" : "Roo.bootstrap",
317      "String html" : "Save",
318      "* prop" : "buttons[]"
319     }
320    ]
321   }
322  ]
323 }