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": 400,
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                                     "fieldLabel": "Ontable",
41                                     "name": "ontable",
42                                     "width": 200,
43                                     "|xns": "Roo.form",
44                                     "xtype": "TextField"
45                                 },
46                                 {
47                                     "listeners": {
48                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
49                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
50                                     },
51                                     "allowBlank": true,
52                                     "displayField": "on_table",
53                                     "editable": false,
54                                     "emptyText": "Select Table",
55                                     "fieldLabel": "Table",
56                                     "forceSelection": true,
57                                     "listWidth": 300,
58                                     "loadingText": "Searching...",
59                                     "minChars": 2,
60                                     "name": "on_table",
61                                     "pageSize": 20,
62                                     "qtip": "Select Action",
63                                     "queryParam": "query[on_table]",
64                                     "selectOnFocus": true,
65                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
66                                     "triggerAction": "all",
67                                     "typeAhead": true,
68                                     "valueField": "action",
69                                     "width": 150,
70                                     "xtype": "ComboBox",
71                                     "|xns": "Roo.form",
72                                     "items": [
73                                         {
74                                             "listeners": {
75                                                 "|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}"
76                                             },
77                                             "*prop": "store",
78                                             "remoteSort": true,
79                                             "xtype": "Store",
80                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
81                                             "|xns": "Roo.data",
82                                             "items": [
83                                                 {
84                                                     "*prop": "proxy",
85                                                     "method": "GET",
86                                                     "xtype": "HttpProxy",
87                                                     "|url": "baseURL + '/Roo/Events.php'",
88                                                     "|xns": "Roo.data"
89                                                 },
90                                                 {
91                                                     "|xns": "Roo.data",
92                                                     "xtype": "JsonReader",
93                                                     "totalProperty": "total",
94                                                     "root": "data",
95                                                     "*prop": "reader",
96                                                     "id": "id",
97                                                     "|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]"
98                                                 }
99                                             ]
100                                         }
101                                     ]
102                                 },
103                                 {
104                                     "fieldLabel": "Onid",
105                                     "name": "onid",
106                                     "width": 75,
107                                     "|xns": "Roo.form",
108                                     "xtype": "TextField"
109                                 },
110                                 {
111                                     "|xns": "Roo.form",
112                                     "xtype": "ComboBox",
113                                     "allowBlank": "false",
114                                     "editable": "false",
115                                     "emptyText": "Select Person",
116                                     "forceSelection": true,
117                                     "listWidth": 400,
118                                     "loadingText": "Searching...",
119                                     "minChars": 2,
120                                     "pageSize": 20,
121                                     "qtip": "Select Person",
122                                     "selectOnFocus": true,
123                                     "triggerAction": "all",
124                                     "typeAhead": true,
125                                     "width": 300,
126                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
127                                     "queryParam": "query[name]",
128                                     "fieldLabel": "Person",
129                                     "valueField": "id",
130                                     "displayField": "name",
131                                     "hiddenName": "person_id",
132                                     "name": "person_id_name",
133                                     "items": [
134                                         {
135                                             "*prop": "store",
136                                             "xtype": "Store",
137                                             "|xns": "Roo.data",
138                                             "remoteSort": true,
139                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
140                                             "listeners": {
141                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
142                                             },
143                                             "items": [
144                                                 {
145                                                     "*prop": "proxy",
146                                                     "xtype": "HttpProxy",
147                                                     "method": "GET",
148                                                     "|xns": "Roo.data",
149                                                     "|url": "baseURL + '/Roo/Person.php'"
150                                                 },
151                                                 {
152                                                     "*prop": "reader",
153                                                     "xtype": "JsonReader",
154                                                     "|xns": "Roo.data",
155                                                     "id": "id",
156                                                     "root": "data",
157                                                     "totalProperty": "total",
158                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
159                                                 }
160                                             ]
161                                         }
162                                     ]
163                                 },
164                                 {
165                                     "fieldLabel": "Event",
166                                     "name": "event",
167                                     "width": 200,
168                                     "|xns": "Roo.form",
169                                     "xtype": "TextField"
170                                 },
171                                 {
172                                     "fieldLabel": "Medium",
173                                     "name": "medium",
174                                     "width": 200,
175                                     "|xns": "Roo.form",
176                                     "xtype": "TextField"
177                                 },
178                                 {
179                                     "fieldLabel": "Active",
180                                     "name": "active",
181                                     "width": 75,
182                                     "|xns": "Roo.form",
183                                     "xtype": "TextField"
184                                 },
185                                 {
186                                     "name": "id",
187                                     "|xns": "Roo.form",
188                                     "xtype": "Hidden"
189                                 }
190                             ]
191                         }
192                     ]
193                 },
194                 {
195                     "listeners": {
196                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
197                     },
198                     "*prop": "buttons[]",
199                     "text": "Cancel",
200                     "xtype": "Button",
201                     "|xns": "Roo"
202                 },
203                 {
204                     "listeners": {
205                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
206                     },
207                     "*prop": "buttons[]",
208                     "text": "Save",
209                     "xtype": "Button",
210                     "|xns": "Roo"
211                 }
212             ]
213         }
214     ],
215     "permname": "",
216     "modOrder": "001"
217 }