Pman.Dialog.AdminWatch.bjs
[Pman.Admin] / Pman.Dialog.AdminWatch.bjs
1 {
2     "id": "roo-file-170",
3     "name": "Pman.Dialog.AdminWatch",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminWatch.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 230,
12             "resizable": false,
13             "title": "Edit / Create core_watch",
14             "width": 500,
15             "xtype": "LayoutDialog",
16             "|xns": "Roo",
17             "items": [
18                 {
19                     "|xns": "Roo",
20                     "xtype": "LayoutRegion",
21                     "*prop": "center"
22                 },
23                 {
24                     "region": "center",
25                     "xtype": "ContentPanel",
26                     "|xns": "Roo",
27                     "items": [
28                         {
29                             "|xns": "Roo.form",
30                             "xtype": "Form",
31                             "listeners": {
32                                 "|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",
33                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
34                             },
35                             "method": "POST",
36                             "style": "margin:10px;",
37                             "|url": "baseURL + '/Roo/core_watch.php'",
38                             "items": [
39                                 {
40                                     "listeners": {
41                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
42                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
43                                     },
44                                     "allowBlank": true,
45                                     "displayField": "on_table",
46                                     "editable": false,
47                                     "emptyText": "Select Table",
48                                     "fieldLabel": "Table",
49                                     "forceSelection": true,
50                                     "listWidth": 300,
51                                     "loadingText": "Searching...",
52                                     "minChars": 2,
53                                     "name": "ontable",
54                                     "pageSize": 20,
55                                     "qtip": "Select Action",
56                                     "queryParam": "query[on_table]",
57                                     "selectOnFocus": true,
58                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
59                                     "triggerAction": "all",
60                                     "typeAhead": true,
61                                     "valueField": "action",
62                                     "width": 150,
63                                     "xtype": "ComboBox",
64                                     "|xns": "Roo.form",
65                                     "items": [
66                                         {
67                                             "listeners": {
68                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    // staff can see all logs, other companies can only see their own.\n    if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n        o.params.company_id = Pman.Login.authUser.company_id;\n    }\n    o.params._distinct = 'on_table';\n    o.params._columns ='on_table';\n}"
69                                             },
70                                             "*prop": "store",
71                                             "remoteSort": true,
72                                             "xtype": "Store",
73                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
74                                             "|xns": "Roo.data",
75                                             "items": [
76                                                 {
77                                                     "*prop": "proxy",
78                                                     "method": "GET",
79                                                     "xtype": "HttpProxy",
80                                                     "|url": "baseURL + '/Roo/Events.php'",
81                                                     "|xns": "Roo.data"
82                                                 },
83                                                 {
84                                                     "|xns": "Roo.data",
85                                                     "xtype": "JsonReader",
86                                                     "totalProperty": "total",
87                                                     "root": "data",
88                                                     "*prop": "reader",
89                                                     "id": "id",
90                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
91                                                 }
92                                             ]
93                                         }
94                                     ]
95                                 },
96                                 {
97                                     "fieldLabel": "ID",
98                                     "name": "onid",
99                                     "width": 75,
100                                     "xtype": "NumberField",
101                                     "|xns": "Roo.form"
102                                 },
103                                 {
104                                     "allowBlank": "false",
105                                     "displayField": "name",
106                                     "editable": "false",
107                                     "emptyText": "Select Person",
108                                     "fieldLabel": "Notify Who",
109                                     "forceSelection": true,
110                                     "hiddenName": "person_id",
111                                     "listWidth": 400,
112                                     "loadingText": "Searching...",
113                                     "minChars": 2,
114                                     "name": "person_id_name",
115                                     "pageSize": 20,
116                                     "qtip": "Select Person",
117                                     "queryParam": "query[name]",
118                                     "selectOnFocus": true,
119                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
120                                     "triggerAction": "all",
121                                     "typeAhead": true,
122                                     "valueField": "id",
123                                     "width": 300,
124                                     "xtype": "ComboBox",
125                                     "|xns": "Roo.form",
126                                     "items": [
127                                         {
128                                             "*prop": "store",
129                                             "xtype": "Store",
130                                             "|xns": "Roo.data",
131                                             "remoteSort": true,
132                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
133                                             "listeners": {
134                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
135                                             },
136                                             "items": [
137                                                 {
138                                                     "*prop": "proxy",
139                                                     "xtype": "HttpProxy",
140                                                     "method": "GET",
141                                                     "|xns": "Roo.data",
142                                                     "|url": "baseURL + '/Roo/Person.php'"
143                                                 },
144                                                 {
145                                                     "*prop": "reader",
146                                                     "xtype": "JsonReader",
147                                                     "|xns": "Roo.data",
148                                                     "id": "id",
149                                                     "root": "data",
150                                                     "totalProperty": "total",
151                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
152                                                 }
153                                             ]
154                                         }
155                                     ]
156                                 },
157                                 {
158                                     "listeners": {
159                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
160                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
161                                     },
162                                     "allowBlank": true,
163                                     "displayField": "action",
164                                     "editable": true,
165                                     "emptyText": "Select Action",
166                                     "fieldLabel": "Match Event",
167                                     "forceSelection": false,
168                                     "listWidth": 300,
169                                     "loadingText": "Searching...",
170                                     "minChars": 2,
171                                     "name": "event",
172                                     "pageSize": 20,
173                                     "qtip": "Select Action",
174                                     "queryParam": "query[action]",
175                                     "selectOnFocus": true,
176                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
177                                     "triggerAction": "all",
178                                     "typeAhead": true,
179                                     "valueField": "action",
180                                     "width": 150,
181                                     "xtype": "ComboBox",
182                                     "|xns": "Roo.form",
183                                     "items": [
184                                         {
185                                             "listeners": {
186                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    // staff can see all logs, other companies can only see their own.\n    if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n        o.params.company_id = Pman.Login.authUser.company_id;\n    }\n    o.params._distinct = 'action';\n    o.params._columns ='action';\n}"
187                                             },
188                                             "*prop": "store",
189                                             "remoteSort": true,
190                                             "xtype": "Store",
191                                             "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
192                                             "|xns": "Roo.data",
193                                             "items": [
194                                                 {
195                                                     "*prop": "proxy",
196                                                     "method": "GET",
197                                                     "xtype": "HttpProxy",
198                                                     "|url": "baseURL + '/Roo/Events.php'",
199                                                     "|xns": "Roo.data"
200                                                 },
201                                                 {
202                                                     "|xns": "Roo.data",
203                                                     "xtype": "JsonReader",
204                                                     "totalProperty": "total",
205                                                     "root": "data",
206                                                     "*prop": "reader",
207                                                     "id": "id",
208                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
209                                                 }
210                                             ]
211                                         }
212                                     ]
213                                 },
214                                 {
215                                     "allowBlank": false,
216                                     "alwaysQuery": true,
217                                     "displayField": "title",
218                                     "editable": false,
219                                     "fieldLabel": "Action",
220                                     "listWidth": 200,
221                                     "name": "medium",
222                                     "triggerAction": "all",
223                                     "valueField": "val",
224                                     "width": 200,
225                                     "xtype": "ComboBox",
226                                     "|xns": "Roo.form",
227                                     "items": [
228                                         {
229                                             "*prop": "store",
230                                             "xtype": "SimpleStore",
231                                             "|data": "[ [ 'email' ], [ 'APPROVAL' ] ]",
232                                             "|fields": "[ 'val' ]",
233                                             "|xns": "Roo.data"
234                                         }
235                                     ]
236                                 },
237                                 {
238                                     "fieldLabel": "Action",
239                                     "name": "medium",
240                                     "width": 200,
241                                     "xtype": "TextField",
242                                     "|xns": "Roo.form"
243                                 },
244                                 {
245                                     "fieldLabel": "Active?",
246                                     "name": "active",
247                                     "xtype": "Checkbox",
248                                     "|xns": "Roo.form"
249                                 },
250                                 {
251                                     "name": "id",
252                                     "|xns": "Roo.form",
253                                     "xtype": "Hidden"
254                                 }
255                             ]
256                         }
257                     ]
258                 },
259                 {
260                     "listeners": {
261                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
262                     },
263                     "*prop": "buttons[]",
264                     "text": "Cancel",
265                     "xtype": "Button",
266                     "|xns": "Roo"
267                 },
268                 {
269                     "listeners": {
270                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
271                     },
272                     "*prop": "buttons[]",
273                     "text": "Save",
274                     "xtype": "Button",
275                     "|xns": "Roo"
276                 }
277             ]
278         }
279     ],
280     "permname": "",
281     "modOrder": "001"
282 }