check what is being written to our log files.
[Pman.Core] / Pman.Dialog.CorePersonContact.bjs
1 {
2  "name" : "Pman.Dialog.CorePersonContact",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/johns/gitlive/Pman.Core/Pman.Dialog.CorePersonContact.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "1c76cbfe21c6f44c1d1e59d54f3e4420" : "Company",
10   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
11   "c8972faa3b9e1c7250db23c57c85aa23" : "Edit / Create Contact Details",
12   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
13   "bcc254b55c4a1babdf1dcb82c207506b" : "Phone",
14   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
15   "9675747b5ab12d05f18518761e68a533" : "Select Companies",
16   "df814135652a5a308fea15bff37ea284" : "Office",
17   "c373dd4bd4ba0b5d3e0c7522c5629880" : "Select Office",
18   "49ee3087348e8d44e1feda1917443987" : "Name",
19   "bbbabdbe1b262f75d99d62880b953be1" : "Role",
20   "c9cc8cce247e49bae79f15173ce97354" : "Save",
21   "9810aa2b9f44401be4bf73188ef2b67d" : "Fax"
22  },
23  "items" : [
24   {
25    "collapsible" : false,
26    "title" : "Edit / Create Contact Details",
27    "xtype" : "LayoutDialog",
28    "width" : 450,
29    "$ xns" : "Roo",
30    "closable" : false,
31    "resizable" : false,
32    "height" : 290,
33    "items" : [
34     {
35      "xtype" : "LayoutRegion",
36      "$ xns" : "Roo",
37      "* prop" : "center"
38     },
39     {
40      "region" : "center",
41      "xtype" : "ContentPanel",
42      "$ xns" : "Roo",
43      "items" : [
44       {
45        "listeners" : {
46         "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\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",
47         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
48        },
49        "$ url" : "baseURL + '/Roo/core_person'",
50        "xtype" : "Form",
51        "method" : "POST",
52        "style" : "margin:10px;",
53        "$ xns" : "Roo.form",
54        "items" : [
55         {
56          "listeners" : {
57           "add" : "function (combo)\n{\n\n    Pman.Dialog.Companies.show( {  id: 0 },  function(data) {\n            _this.form.setValues({\n                    company_id_name : data.name,\n                    company_id : data.id\n            });\n    }); \n}"
58          },
59          "listWidth" : 400,
60          "triggerAction" : "all",
61          "fieldLabel" : "Company",
62          "forceSelection" : true,
63          "selectOnFocus" : true,
64          "pageSize" : 20,
65          "displayField" : "code",
66          "emptyText" : "Select Companies",
67          "hiddenName" : "company_id",
68          "minChars" : 2,
69          "valueField" : "id",
70          "xtype" : "ComboBox",
71          "allowBlank" : false,
72          "typeAhead" : true,
73          "editable" : false,
74          "width" : 300,
75          "$ xns" : "Roo.form",
76          "name" : "company_id_code",
77          "qtip" : "Select Companies",
78          "queryParam" : "query[code]",
79          "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> </div>",
80          "loadingText" : "Searching...",
81          "items" : [
82           {
83            "listeners" : {
84             "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
85            },
86            "xtype" : "Store",
87            "remoteSort" : true,
88            "$ xns" : "Roo.data",
89            "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
90            "* prop" : "store",
91            "items" : [
92             {
93              "$ url" : "baseURL + '/Roo/core_company.php'",
94              "method" : "GET",
95              "xtype" : "HttpProxy",
96              "$ xns" : "Roo.data",
97              "* prop" : "proxy"
98             },
99             {
100              "id" : "id",
101              "root" : "data",
102              "xtype" : "JsonReader",
103              "$ xns" : "Roo.data",
104              "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]",
105              "* prop" : "reader",
106              "totalProperty" : "total"
107             }
108            ]
109           }
110          ]
111         },
112         {
113          "listeners" : {
114           "add" : "function (combo)\n{\n    var coid = _this.form.findField('company_id').getValue();\n    if (!coid ) {\n    \n         Ext.MessageBox.alert(\"Error\", \"Select An Company First\");\n        return false;\n\n    }\n    Pman.Dialog.Office.show(cfg, function(data) {\n                _this.form.setValues({\n                    office_id_name : data.name,\n                    office_id : data.id\n            });\n        }); \n    \n    \n}",
115           "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n        var coid = _this.form.findField('company_id').getValue();\n        if (coid < 1 ) {\n            Ext.MessageBox.alert(\"Error\", \"Select An Company First\");\n            return false;\n        }\n}"
116          },
117          "listWidth" : 400,
118          "triggerAction" : "all",
119          "fieldLabel" : "Office",
120          "forceSelection" : true,
121          "selectOnFocus" : true,
122          "pageSize" : 20,
123          "displayField" : "name",
124          "emptyText" : "Select Office",
125          "hiddenName" : "office_id",
126          "minChars" : 2,
127          "valueField" : "id",
128          "xtype" : "ComboBox",
129          "allowBlank" : false,
130          "typeAhead" : true,
131          "editable" : false,
132          "width" : 300,
133          "$ xns" : "Roo.form",
134          "name" : "office_id_name",
135          "qtip" : "Select Office",
136          "queryParam" : "query[name]",
137          "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
138          "loadingText" : "Searching...",
139          "items" : [
140           {
141            "listeners" : {
142             "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    var coid = _this.form.findField('company_id').getValue();\n    o.params.company_id = coid;\n}\n"
143            },
144            "xtype" : "Store",
145            "remoteSort" : true,
146            "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
147            "$ xns" : "Roo.data",
148            "* prop" : "store",
149            "items" : [
150             {
151              "$ url" : "baseURL + '/Roo/Office.php'",
152              "method" : "GET",
153              "xtype" : "HttpProxy",
154              "$ xns" : "Roo.data",
155              "* prop" : "proxy"
156             },
157             {
158              "id" : "id",
159              "root" : "data",
160              "xtype" : "JsonReader",
161              "$ xns" : "Roo.data",
162              "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
163              "* prop" : "reader",
164              "totalProperty" : "total"
165             }
166            ]
167           }
168          ]
169         },
170         {
171          "fieldLabel" : "Name",
172          "xtype" : "TextField",
173          "allowBlank" : true,
174          "width" : 300,
175          "$ xns" : "Roo.form",
176          "name" : "name"
177         },
178         {
179          "fieldLabel" : "Role",
180          "xtype" : "TextField",
181          "width" : 200,
182          "$ xns" : "Roo.form",
183          "name" : "role"
184         },
185         {
186          "fieldLabel" : "Phone",
187          "xtype" : "TextField",
188          "width" : 200,
189          "$ xns" : "Roo.form",
190          "name" : "phone"
191         },
192         {
193          "fieldLabel" : "Fax",
194          "xtype" : "TextField",
195          "width" : 200,
196          "$ xns" : "Roo.form",
197          "name" : "fax"
198         },
199         {
200          "fieldLabel" : "Email",
201          "xtype" : "TextField",
202          "allowBlank" : false,
203          "width" : 200,
204          "$ xns" : "Roo.form",
205          "name" : "email"
206         },
207         {
208          "xtype" : "Hidden",
209          "$ xns" : "Roo.form",
210          "name" : "id"
211         }
212        ]
213       }
214      ]
215     },
216     {
217      "listeners" : {
218       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
219      },
220      "text" : "Cancel",
221      "xtype" : "Button",
222      "$ xns" : "Roo",
223      "* prop" : "buttons[]"
224     },
225     {
226      "listeners" : {
227       "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
228      },
229      "text" : "Save",
230      "xtype" : "Button",
231      "$ xns" : "Roo",
232      "* prop" : "buttons[]"
233     }
234    ]
235   }
236  ]
237 }