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                                     "fieldLabel": "Event",
159                                     "name": "event",
160                                     "width": 200,
161                                     "|xns": "Roo.form",
162                                     "xtype": "TextField"
163                                 },
164                                 {
165                                     "listeners": {
166                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
167                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
168                                     },
169                                     "allowBlank": true,
170                                     "displayField": "action",
171                                     "editable": false,
172                                     "emptyText": "Select Action",
173                                     "fieldLabel": "Match Event",
174                                     "forceSelection": true,
175                                     "listWidth": 300,
176                                     "loadingText": "Searching...",
177                                     "minChars": 2,
178                                     "name": "event",
179                                     "pageSize": 20,
180                                     "qtip": "Select Action",
181                                     "queryParam": "query[action]",
182                                     "selectOnFocus": true,
183                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
184                                     "triggerAction": "all",
185                                     "typeAhead": true,
186                                     "valueField": "action",
187                                     "width": 150,
188                                     "xtype": "ComboBox",
189                                     "|xns": "Roo.form",
190                                     "items": [
191                                         {
192                                             "listeners": {
193                                                 "|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}"
194                                             },
195                                             "*prop": "store",
196                                             "remoteSort": true,
197                                             "xtype": "Store",
198                                             "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
199                                             "|xns": "Roo.data",
200                                             "items": [
201                                                 {
202                                                     "*prop": "proxy",
203                                                     "method": "GET",
204                                                     "xtype": "HttpProxy",
205                                                     "|url": "baseURL + '/Roo/Events.php'",
206                                                     "|xns": "Roo.data"
207                                                 },
208                                                 {
209                                                     "|xns": "Roo.data",
210                                                     "xtype": "JsonReader",
211                                                     "totalProperty": "total",
212                                                     "root": "data",
213                                                     "*prop": "reader",
214                                                     "id": "id",
215                                                     "|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]"
216                                                 }
217                                             ]
218                                         }
219                                     ]
220                                 },
221                                 {
222                                     "fieldLabel": "Action",
223                                     "name": "medium",
224                                     "width": 200,
225                                     "xtype": "TextField",
226                                     "|xns": "Roo.form"
227                                 },
228                                 {
229                                     "fieldLabel": "Active",
230                                     "name": "active",
231                                     "width": 75,
232                                     "|xns": "Roo.form",
233                                     "xtype": "TextField"
234                                 },
235                                 {
236                                     "name": "id",
237                                     "|xns": "Roo.form",
238                                     "xtype": "Hidden"
239                                 }
240                             ]
241                         }
242                     ]
243                 },
244                 {
245                     "listeners": {
246                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
247                     },
248                     "*prop": "buttons[]",
249                     "text": "Cancel",
250                     "xtype": "Button",
251                     "|xns": "Roo"
252                 },
253                 {
254                     "listeners": {
255                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
256                     },
257                     "*prop": "buttons[]",
258                     "text": "Save",
259                     "xtype": "Button",
260                     "|xns": "Roo"
261                 }
262             ]
263         }
264     ],
265     "permname": "",
266     "modOrder": "001"
267 }