sync
[Pman.Admin] / Pman.Dialog.AdminWatch.bjs
1 {
2     "id": "roo-file-220",
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             "modal": true,
13             "resizable": false,
14             "title": "Edit / Create core_watch",
15             "width": 500,
16             "xtype": "LayoutDialog",
17             "|xns": "Roo",
18             "items": [
19                 {
20                     "|xns": "Roo",
21                     "xtype": "LayoutRegion",
22                     "*prop": "center"
23                 },
24                 {
25                     "region": "center",
26                     "xtype": "ContentPanel",
27                     "|xns": "Roo",
28                     "items": [
29                         {
30                             "listeners": {
31                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\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         return;\n    }\n    if (action.type =='submit') {\n    \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",
32                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
33                             },
34                             "method": "POST",
35                             "style": "margin:10px;",
36                             "xtype": "Form",
37                             "|url": "baseURL + '/Roo/core_watch.php'",
38                             "|xns": "Roo.form",
39                             "items": [
40                                 {
41                                     "listeners": {
42                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
43                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
44                                     },
45                                     "allowBlank": true,
46                                     "displayField": "on_table",
47                                     "editable": false,
48                                     "emptyText": "Select Table",
49                                     "fieldLabel": "Table",
50                                     "forceSelection": true,
51                                     "listWidth": 300,
52                                     "loadingText": "Searching...",
53                                     "minChars": 2,
54                                     "name": "ontable",
55                                     "pageSize": 20,
56                                     "qtip": "Select Action",
57                                     "queryParam": "query[on_table]",
58                                     "selectOnFocus": true,
59                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
60                                     "triggerAction": "all",
61                                     "typeAhead": true,
62                                     "valueField": "action",
63                                     "width": 150,
64                                     "xtype": "ComboBox",
65                                     "|xns": "Roo.form",
66                                     "items": [
67                                         {
68                                             "listeners": {
69                                                 "|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 ((typeof(Pman.Login) != 'undefined') && 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}"
70                                             },
71                                             "*prop": "store",
72                                             "remoteSort": true,
73                                             "xtype": "Store",
74                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
75                                             "|xns": "Roo.data",
76                                             "items": [
77                                                 {
78                                                     "*prop": "proxy",
79                                                     "method": "GET",
80                                                     "xtype": "HttpProxy",
81                                                     "|url": "baseURL + '/Roo/Events.php'",
82                                                     "|xns": "Roo.data"
83                                                 },
84                                                 {
85                                                     "|xns": "Roo.data",
86                                                     "xtype": "JsonReader",
87                                                     "totalProperty": "total",
88                                                     "root": "data",
89                                                     "*prop": "reader",
90                                                     "id": "id",
91                                                     "|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]"
92                                                 }
93                                             ]
94                                         }
95                                     ]
96                                 },
97                                 {
98                                     "fieldLabel": "ID",
99                                     "name": "onid",
100                                     "width": 75,
101                                     "xtype": "NumberField",
102                                     "|xns": "Roo.form"
103                                 },
104                                 {
105                                     "allowBlank": "false",
106                                     "displayField": "name",
107                                     "editable": "false",
108                                     "emptyText": "Select Person",
109                                     "fieldLabel": "Notify Who",
110                                     "forceSelection": true,
111                                     "hiddenName": "person_id",
112                                     "listWidth": 500,
113                                     "loadingText": "Searching...",
114                                     "minChars": 2,
115                                     "name": "person_id_name",
116                                     "pageSize": 20,
117                                     "qtip": "Select Person",
118                                     "queryParam": "query[name]",
119                                     "selectOnFocus": true,
120                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt;</div>",
121                                     "triggerAction": "all",
122                                     "typeAhead": true,
123                                     "valueField": "id",
124                                     "width": 300,
125                                     "xtype": "ComboBox",
126                                     "|xns": "Roo.form",
127                                     "items": [
128                                         {
129                                             "listeners": {
130                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
131                                             },
132                                             "*prop": "store",
133                                             "remoteSort": true,
134                                             "xtype": "Store",
135                                             "|sortInfo": "{ direction : 'ASC', field: 'name' }",
136                                             "|xns": "Roo.data",
137                                             "items": [
138                                                 {
139                                                     "*prop": "proxy",
140                                                     "xtype": "HttpProxy",
141                                                     "method": "GET",
142                                                     "|xns": "Roo.data",
143                                                     "|url": "baseURL + '/Roo/core_person'"
144                                                 },
145                                                 {
146                                                     "*prop": "reader",
147                                                     "xtype": "JsonReader",
148                                                     "|xns": "Roo.data",
149                                                     "id": "id",
150                                                     "root": "data",
151                                                     "totalProperty": "total",
152                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
153                                                 }
154                                             ]
155                                         }
156                                     ]
157                                 },
158                                 {
159                                     "listeners": {
160                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
161                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
162                                     },
163                                     "allowBlank": true,
164                                     "displayField": "action",
165                                     "editable": true,
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 (typeof(Pman.Login) !='undefined' && 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": true,
216                                     "displayField": "val",
217                                     "editable": true,
218                                     "fieldLabel": "Action",
219                                     "forceSelection": false,
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' ], ['ENDOFDAYMAIL'] ]",
232                                             "|fields": "[ 'val' ]",
233                                             "|xns": "Roo.data"
234                                         }
235                                     ]
236                                 },
237                                 {
238                                     "fieldLabel": "Active?",
239                                     "name": "active",
240                                     "xtype": "Checkbox",
241                                     "|xns": "Roo.form"
242                                 },
243                                 {
244                                     "name": "id",
245                                     "|xns": "Roo.form",
246                                     "xtype": "Hidden"
247                                 }
248                             ]
249                         }
250                     ]
251                 },
252                 {
253                     "listeners": {
254                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
255                     },
256                     "*prop": "buttons[]",
257                     "text": "Cancel",
258                     "xtype": "Button",
259                     "|xns": "Roo"
260                 },
261                 {
262                     "listeners": {
263                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n \n    _this.form.doAction(\"submit\");\n\n}"
264                     },
265                     "*prop": "buttons[]",
266                     "text": "Save",
267                     "xtype": "Button",
268                     "|xns": "Roo"
269                 }
270             ]
271         }
272     ],
273     "permname": "",
274     "modOrder": "001"
275 }