Pman.Tab.AdminLogDrill.bjs
[Pman.Admin] / Pman.Tab.AdminLogDrill.bjs
1 {
2     "id": "roo-file-144",
3     "name": "Pman.Tab.AdminLogDrill",
4     "parent": "Pman.Tab.AdminLogs",
5     "title": "Pman.Tab.AdminLogDrill",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminLogDrill.bjs",
7     "items": [
8         {
9             "background": true,
10             "region": "center",
11             "title": "Event Drilldown",
12             "xtype": "NestedLayoutPanel",
13             "|xns": "Roo",
14             "items": [
15                 {
16                     "|xns": "Roo",
17                     "xtype": "Toolbar",
18                     "*prop": "toolbar"
19                 },
20                 {
21                     "|xns": "Roo",
22                     "xtype": "BorderLayout",
23                     "*prop": "layout",
24                     "items": [
25                         {
26                             "*prop": "west",
27                             "split": true,
28                             "width": 300,
29                             "xtype": "LayoutRegion",
30                             "|xns": "Roo"
31                         },
32                         {
33                             "|xns": "Roo",
34                             "xtype": "LayoutRegion",
35                             "*prop": "center"
36                         },
37                         {
38                             "*prop": "east",
39                             "split": true,
40                             "tabPosition": "top",
41                             "width": 600,
42                             "xtype": "LayoutRegion",
43                             "|xns": "Roo"
44                         },
45                         {
46                             "listeners": {
47                                 "|activate": "function() {\n    _this.datepanel = this;\n    if (_this.dategrid) {\n        _this.dategrid.ds.load({});\n    }\n}"
48                             },
49                             "background": false,
50                             "fitContainer": true,
51                             "fitToframe": true,
52                             "region": "west",
53                             "tableName": "Events",
54                             "title": "Events",
55                             "xtype": "GridPanel",
56                             "|xns": "Roo",
57                             "items": [
58                                 {
59                                     "listeners": {
60                                         "|render": "function() \n{\n    _this.dategrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.ds.load({});\n    }\n}",
61                                         "rowclick": "function (_self, rowIndex, e)\n{\n    _this.tablegrid.footer.onClick('first');\n}"
62                                     },
63                                     "*prop": "grid",
64                                     "autoExpandColumn": "person_name",
65                                     "loadMask": true,
66                                     "xtype": "Grid",
67                                     "|xns": "Roo.grid",
68                                     "items": [
69                                         {
70                                             "listeners": {
71                                                 "beforeload": "function (_self, o)\n{\n    \n    \n    if (! _this.dateFrom) {\n        return;\n    }\n\n     try {\n         _this.tablegrid.ds.removeAll();\n         _this.panel.layout.getRegion('east').getActivePanel().grid.ds.removeAll();\n         \n    } catch (e) {\n        // do nothing..\n    }\n    o.params = o.params || {};\n     \n    var act = _this.actionSel ? _this.actionSel.getValue() : '';\n    if (act.length) {\n        o.params.action = act;\n    }\n    var tbl = _this.affectSel ? _this.affectSel.getValue() : '';\n    if (tbl.length) {\n        o.params.on_table = tbl;\n    }\n    act = _this.dateFrom.getValue();\n    if (act.format) {\n        o.params['query[from]'] = act.format('Y-m-d');\n    }\n    act = _this.dateTo.getValue();\n    if (act.format) {\n        o.params['query[to]'] = act.format('Y-m-d');\n    }\n    \n    \n    \n    o.params['query[person_sum]'] = 1;\n    o.params._columns = 'person_id,person_id_name,person_id_email,qty,uqty';\n    o.params.limit = 999;\n \n}"
72                                             },
73                                             "*prop": "dataSource",
74                                             "remoteSort": true,
75                                             "xtype": "Store",
76                                             "|sortInfo": "{ field : 'person_name', direction: 'ASC' }",
77                                             "|xns": "Roo.data",
78                                             "items": [
79                                                 {
80                                                     "*prop": "proxy",
81                                                     "xtype": "HttpProxy",
82                                                     "method": "GET",
83                                                     "|url": "baseURL + '/Roo/Events.php'",
84                                                     "|xns": "Roo.data"
85                                                 },
86                                                 {
87                                                     "|xns": "Roo.data",
88                                                     "xtype": "JsonReader",
89                                                     "totalProperty": "total",
90                                                     "root": "data",
91                                                     "*prop": "reader",
92                                                     "id": "id",
93                                                     "|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]"
94                                                 }
95                                             ]
96                                         },
97                                         {
98                                             "*prop": "toolbar",
99                                             "xtype": "Toolbar",
100                                             "listeners": {},
101                                             "|xns": "Roo",
102                                             "items": [
103                                                 {
104                                                     "text": "Date Range",
105                                                     "xtype": "TextItem",
106                                                     "|xns": "Roo.Toolbar"
107                                                 },
108                                                 {
109                                                     "listeners": {
110                                                         "render": "function (_self)\n{\n  _this.dateFrom = _self;\n}",
111                                                         "change": "function (_self, newValue, oldValue)\n{\n  _this.dategrid.ds.load({});\n}"
112                                                     },
113                                                     "format": "Y-m-d",
114                                                     "xtype": "DateField",
115                                                     "|value": "(function() { var d = new Date(); return d.format('Y-m-01'); })()",
116                                                     "|xns": "Roo.form"
117                                                 },
118                                                 {
119                                                     "listeners": {
120                                                         "render": "function (_self)\n{\n  _this.dateTo = _self;\n}",
121                                                         "change": "function (_self, newValue, oldValue)\n{\n  _this.dategrid.ds.load({});\n}"
122                                                     },
123                                                     "format": "Y-m-d",
124                                                     "|value": "(function() { var d = new Date();d =  d.add(Date.MONTH, 1) ; return d.format('Y-m-01'); })()",
125                                                     "xtype": "DateField",
126                                                     "|xns": "Roo.form"
127                                                 }
128                                             ]
129                                         },
130                                         {
131                                             "*prop": "colModel[]",
132                                             "dataIndex": "person_id_name",
133                                             "header": "Person name",
134                                             "sortable": true,
135                                             "width": 200,
136                                             "xtype": "ColumnModel",
137                                             "|renderer": "function(v,x,r) {\n     return String.format('{0} &lt;<a href=\"mailto:{1}\">{1}</a>&gt;', v, r.data.person_id_email); \n }",
138                                             "|xns": "Roo.grid"
139                                         },
140                                         {
141                                             "*prop": "colModel[]",
142                                             "dataIndex": "uqty",
143                                             "header": "#Affected",
144                                             "sortable": true,
145                                             "width": 70,
146                                             "xtype": "ColumnModel",
147                                             "|renderer": "function(v) { return String.format('{0}', v); }",
148                                             "|xns": "Roo.grid"
149                                         },
150                                         {
151                                             "*prop": "colModel[]",
152                                             "dataIndex": "qty",
153                                             "header": "Changes",
154                                             "sortable": true,
155                                             "width": 70,
156                                             "xtype": "ColumnModel",
157                                             "|renderer": "function(v) { return String.format('{0}', v); }",
158                                             "|xns": "Roo.grid"
159                                         }
160                                     ]
161                                 }
162                             ]
163                         },
164                         {
165                             "listeners": {
166                                 "|activate": "function() {\n    _this.tablepanel = this;\n    if (_this.tablegrid) {\n        _this.tablegrid.footer.onClick('first');\n    }\n}"
167                             },
168                             "background": false,
169                             "fitContainer": true,
170                             "fitToframe": true,
171                             "region": "center",
172                             "tableName": "Events",
173                             "title": "Events",
174                             "xtype": "GridPanel",
175                             "|xns": "Roo",
176                             "items": [
177                                 {
178                                     "listeners": {
179                                         "|render": "function() \n{\n    _this.tablegrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.tablepanel.active) {\n       this.footer.onClick('first');\n    }\n}",
180                                         "rowclick": "function (_self, rowIndex, e)\n{\n \n    _this.panel.layout.getRegion('east').getActivePanel().grid.footer.onClick('first');\n}"
181                                     },
182                                     "*prop": "grid",
183                                     "autoExpandColumn": "person_name",
184                                     "loadMask": true,
185                                     "xtype": "Grid",
186                                     "|xns": "Roo.grid",
187                                     "items": [
188                                         {
189                                             "listeners": {
190                                                 "beforeload": "function (_self, o)\n{\n     if (! _this.dategrid) {\n     return;\n    }\n    try {\n         _this.panel.layout.getRegion('east').getActivePanel().grid.ds.removeAll();\n         \n    } catch (e) {\n        // do nothing..\n    }\n    \n    var s = _this.dategrid.selModel.getSelected();\n    if (!s) {\n        _this.tablegrid.view.el.mask(\"Select a person\");\n        return false;\n    }\n    _this.tablegrid.view.el.unmask();\n \n    o.params = o.params || {};\n    var act = _this.actionSel.getValue();\n    if (act.length) {\n        o.params.action = act;\n    }\n    var tbl = _this.affectSel.getValue();\n    if (tbl.length) {\n        o.params.on_table = tbl;\n    }\n \n    act = _this.dateFrom.getValue();\n    if (act.format) {\n        o.params['query[from]'] = act.format('Y-m-d');\n    }\n    act = _this.dateTo.getValue();\n    if (act.format) {\n        o.params['query[to]'] = act.format('Y-m-d');\n    }\n    o.params.person_id = s.data.person_id;\n    o.params['query[table_sum]'] = 1;\n    o.params._columns = 'on_table,qty,uqty';\n\n    \n}"
191                                             },
192                                             "*prop": "dataSource",
193                                             "remoteSort": true,
194                                             "xtype": "Store",
195                                             "|sortInfo": "{ field : 'on_table', direction: 'ASC' }",
196                                             "|xns": "Roo.data",
197                                             "items": [
198                                                 {
199                                                     "*prop": "proxy",
200                                                     "xtype": "HttpProxy",
201                                                     "method": "GET",
202                                                     "|url": "baseURL + '/Roo/Events.php'",
203                                                     "|xns": "Roo.data"
204                                                 },
205                                                 {
206                                                     "|xns": "Roo.data",
207                                                     "xtype": "JsonReader",
208                                                     "totalProperty": "total",
209                                                     "root": "data",
210                                                     "*prop": "reader",
211                                                     "id": "id",
212                                                     "|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]"
213                                                 }
214                                             ]
215                                         },
216                                         {
217                                             "*prop": "footer",
218                                             "xtype": "PagingToolbar",
219                                             "pageSize": 25,
220                                             "displayInfo": true,
221                                             "displayMsg": "Displaying Events{0} - {1} of {2}",
222                                             "emptyMsg": "No Events found",
223                                             "|xns": "Roo"
224                                         },
225                                         {
226                                             "*prop": "toolbar",
227                                             "xtype": "Toolbar",
228                                             "listeners": {},
229                                             "|xns": "Roo",
230                                             "items": [
231                                                 {
232                                                     "listeners": {
233                                                         "|select": "function (combo, record, index)\n{\n   _this.dategrid.ds.load({});\n}",
234                                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
235                                                     },
236                                                     "allowBlank": true,
237                                                     "displayField": "action",
238                                                     "editable": false,
239                                                     "emptyText": "Select Action",
240                                                     "forceSelection": true,
241                                                     "listWidth": 300,
242                                                     "loadingText": "Searching...",
243                                                     "minChars": 2,
244                                                     "name": "action",
245                                                     "pageSize": 20,
246                                                     "qtip": "Select Action",
247                                                     "queryParam": "query[action]",
248                                                     "selectOnFocus": true,
249                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
250                                                     "triggerAction": "all",
251                                                     "typeAhead": true,
252                                                     "valueField": "action",
253                                                     "width": 150,
254                                                     "xtype": "ComboBox",
255                                                     "|xns": "Roo.form",
256                                                     "items": [
257                                                         {
258                                                             "listeners": {
259                                                                 "|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}"
260                                                             },
261                                                             "*prop": "store",
262                                                             "remoteSort": true,
263                                                             "xtype": "Store",
264                                                             "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
265                                                             "|xns": "Roo.data",
266                                                             "items": [
267                                                                 {
268                                                                     "*prop": "proxy",
269                                                                     "method": "GET",
270                                                                     "xtype": "HttpProxy",
271                                                                     "|url": "baseURL + '/Roo/Events.php'",
272                                                                     "|xns": "Roo.data"
273                                                                 },
274                                                                 {
275                                                                     "|xns": "Roo.data",
276                                                                     "xtype": "JsonReader",
277                                                                     "totalProperty": "total",
278                                                                     "root": "data",
279                                                                     "*prop": "reader",
280                                                                     "id": "id",
281                                                                     "|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]"
282                                                                 }
283                                                             ]
284                                                         }
285                                                     ]
286                                                 },
287                                                 {
288                                                     "listeners": {
289                                                         "|select": "function (combo, record, index)\n{\n   _this.dategrid.ds.load({});\n}",
290                                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
291                                                     },
292                                                     "allowBlank": true,
293                                                     "displayField": "on_table",
294                                                     "editable": false,
295                                                     "emptyText": "Select Affects",
296                                                     "forceSelection": true,
297                                                     "listWidth": 300,
298                                                     "loadingText": "Searching...",
299                                                     "minChars": 2,
300                                                     "name": "on_table",
301                                                     "pageSize": 20,
302                                                     "qtip": "Select Action",
303                                                     "queryParam": "query[on_table]",
304                                                     "selectOnFocus": true,
305                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
306                                                     "triggerAction": "all",
307                                                     "typeAhead": true,
308                                                     "valueField": "action",
309                                                     "width": 150,
310                                                     "xtype": "ComboBox",
311                                                     "|xns": "Roo.form",
312                                                     "items": [
313                                                         {
314                                                             "listeners": {
315                                                                 "|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}"
316                                                             },
317                                                             "*prop": "store",
318                                                             "remoteSort": true,
319                                                             "xtype": "Store",
320                                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
321                                                             "|xns": "Roo.data",
322                                                             "items": [
323                                                                 {
324                                                                     "*prop": "proxy",
325                                                                     "method": "GET",
326                                                                     "xtype": "HttpProxy",
327                                                                     "|url": "baseURL + '/Roo/Events.php'",
328                                                                     "|xns": "Roo.data"
329                                                                 },
330                                                                 {
331                                                                     "|xns": "Roo.data",
332                                                                     "xtype": "JsonReader",
333                                                                     "totalProperty": "total",
334                                                                     "root": "data",
335                                                                     "*prop": "reader",
336                                                                     "id": "id",
337                                                                     "|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]"
338                                                                 }
339                                                             ]
340                                                         }
341                                                     ]
342                                                 }
343                                             ]
344                                         },
345                                         {
346                                             "*prop": "colModel[]",
347                                             "dataIndex": "on_table",
348                                             "header": "Table",
349                                             "sortable": true,
350                                             "width": 200,
351                                             "xtype": "ColumnModel",
352                                             "|renderer": "function(v) { \n    if (!v.length) {\n        return \"Login / Logout / Errors\";\n    }\n    return String.format('{0}', v); \n}",
353                                             "|xns": "Roo.grid"
354                                         },
355                                         {
356                                             "*prop": "colModel[]",
357                                             "dataIndex": "uqty",
358                                             "header": "#Affected",
359                                             "sortable": true,
360                                             "width": 70,
361                                             "xtype": "ColumnModel",
362                                             "|renderer": "function(v) { return String.format('{0}', v); }",
363                                             "|xns": "Roo.grid"
364                                         },
365                                         {
366                                             "*prop": "colModel[]",
367                                             "dataIndex": "qty",
368                                             "header": "Changes",
369                                             "sortable": true,
370                                             "width": 70,
371                                             "xtype": "ColumnModel",
372                                             "|renderer": "function(v) { return String.format('{0}', v); }",
373                                             "|xns": "Roo.grid"
374                                         }
375                                     ]
376                                 }
377                             ]
378                         },
379                         {
380                             "listeners": {
381                                 "|activate": "function() {\n    _this.detailpanel = this;\n    if (_this.detailgrid) {\n        _this.detailgrid.footer.onClick('first');\n    }\n}"
382                             },
383                             "background": true,
384                             "fitContainer": true,
385                             "fitToframe": true,
386                             "region": "east",
387                             "tableName": "Events",
388                             "title": "Detail",
389                             "xtype": "GridPanel",
390                             "|xns": "Roo",
391                             "items": [
392                                 {
393                                     "listeners": {
394                                         "|render": "function() \n{\n    _this.detailgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.detailpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
395                                     },
396                                     "*prop": "grid",
397                                     "autoExpandColumn": "person_name",
398                                     "loadMask": true,
399                                     "xtype": "Grid",
400                                     "|xns": "Roo.grid",
401                                     "items": [
402                                         {
403                                             "listeners": {
404                                                 "beforeload": "function (_self, o)\n{\n     if (! _this.dategrid) {\n         return false;\n    }\n    \n    o.params = o.params || {};\n    \n    var s = _this.dategrid.selModel.getSelected();\n    if (!s) {\n        _this.detailgrid.view.el.mask(\"Select a person\");\n        return false;\n    }\n    \n    o.params.person_id = s.data.person_id;    \n    \n    var s = _this.tablegrid.selModel.getSelected();\n    if (!s) {\n        _this.detailgrid.view.el.mask(\"Select a table\");\n        return false;\n    }\n    o.params.on_table = s.data.on_table;        \n    \n    _this.detailgrid.view.el.unmask();\n \n    var act = _this.actionSel.getValue();\n    if (act.length) {\n        o.params.action = act;\n    }\n    var tbl = _this.affectSel.getValue();\n    if (tbl.length) {\n        o.params.on_table = tbl;\n    }\n     \n \n    act = _this.dateFrom.getValue();\n    if (act.format) {\n        o.params['query[from]'] = act.format('Y-m-d');\n    }\n    act = _this.dateTo.getValue();\n    if (act.format) {\n        o.params['query[to]'] = act.format('Y-m-d');\n    }\n\n    //o.params['query[table_d]'] = 1;\n    //o.params._columns = 'on_table,qty,uqty';\n\n    \n}"
405                                             },
406                                             "*prop": "dataSource",
407                                             "remoteSort": true,
408                                             "xtype": "Store",
409                                             "|sortInfo": "{ field : 'event_when', direction: 'DESC' }",
410                                             "|xns": "Roo.data",
411                                             "items": [
412                                                 {
413                                                     "*prop": "proxy",
414                                                     "xtype": "HttpProxy",
415                                                     "method": "GET",
416                                                     "|url": "baseURL + '/Roo/Events.php'",
417                                                     "|xns": "Roo.data"
418                                                 },
419                                                 {
420                                                     "|xns": "Roo.data",
421                                                     "xtype": "JsonReader",
422                                                     "totalProperty": "total",
423                                                     "root": "data",
424                                                     "*prop": "reader",
425                                                     "id": "id",
426                                                     "|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]"
427                                                 }
428                                             ]
429                                         },
430                                         {
431                                             "*prop": "footer",
432                                             "xtype": "PagingToolbar",
433                                             "pageSize": 25,
434                                             "displayInfo": true,
435                                             "displayMsg": "Displaying Events{0} - {1} of {2}",
436                                             "emptyMsg": "No Events found",
437                                             "|xns": "Roo"
438                                         },
439                                         {
440                                             "*prop": "colModel[]",
441                                             "dataIndex": "id",
442                                             "header": "Id",
443                                             "width": 50,
444                                             "xtype": "ColumnModel",
445                                             "|renderer": "function(v) { return String.format('{0}', v); }",
446                                             "|xns": "Roo.grid"
447                                         },
448                                         {
449                                             "xtype": "ColumnModel",
450                                             "header": "Event when",
451                                             "width": 75,
452                                             "dataIndex": "event_when",
453                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
454                                             "|xns": "Roo.grid",
455                                             "*prop": "colModel[]"
456                                         },
457                                         {
458                                             "*prop": "colModel[]",
459                                             "dataIndex": "action",
460                                             "header": "Action",
461                                             "width": 50,
462                                             "xtype": "ColumnModel",
463                                             "|renderer": "function(v) { return String.format('{0}', v); }",
464                                             "|xns": "Roo.grid"
465                                         },
466                                         {
467                                             "*prop": "colModel[]",
468                                             "dataIndex": "ipaddr",
469                                             "header": "Ipaddr",
470                                             "width": 100,
471                                             "xtype": "ColumnModel",
472                                             "|renderer": "function(v) { return String.format('{0}', v); }",
473                                             "|xns": "Roo.grid"
474                                         },
475                                         {
476                                             "*prop": "colModel[]",
477                                             "dataIndex": "on_id",
478                                             "header": "#ID",
479                                             "width": 75,
480                                             "xtype": "ColumnModel",
481                                             "|renderer": "function(v) { return String.format('{0}', v); }",
482                                             "|xns": "Roo.grid"
483                                         },
484                                         {
485                                             "xtype": "ColumnModel",
486                                             "header": "Remarks",
487                                             "width": 200,
488                                             "dataIndex": "remarks",
489                                             "|renderer": "function(v) { return String.format('{0}', v); }",
490                                             "|xns": "Roo.grid",
491                                             "*prop": "colModel[]"
492                                         }
493                                     ]
494                                 }
495                             ]
496                         },
497                         {
498                             "listeners": {
499                                 "|activate": "function() {\n    _this.daypanel = this;\n    if (_this.daygrid) {\n        _this.daygrid.footer.onClick('first');\n    }\n}"
500                             },
501                             "background": true,
502                             "fitContainer": true,
503                             "fitToframe": true,
504                             "region": "east",
505                             "tableName": "Events",
506                             "title": "Daily summary",
507                             "xtype": "GridPanel",
508                             "|xns": "Roo",
509                             "items": [
510                                 {
511                                     "listeners": {
512                                         "|render": "function() \n{\n    _this.daygrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.daypanel.active) {\n       this.footer.onClick('first');\n    }\n}"
513                                     },
514                                     "*prop": "grid",
515                                     "autoExpandColumn": "person_name",
516                                     "loadMask": true,
517                                     "xtype": "Grid",
518                                     "|xns": "Roo.grid",
519                                     "items": [
520                                         {
521                                             "listeners": {
522                                                 "beforeload": "function (_self, o)\n{\n     if (! _this.dategrid) {\n         return false;\n    }\n    \n    o.params = o.params || {};\n    \n    var s = _this.dategrid.selModel.getSelected();\n    if (!s) {\n        _this.detailgrid.view.el.mask(\"Select a person\");\n        return false;\n    }\n    \n    o.params.person_id = s.data.person_id;    \n    \n    var s = _this.tablegrid.selModel.getSelected();\n    if (!s) {\n        _this.detailgrid.view.el.mask(\"Select a table\");\n        return false;\n    }\n    o.params.on_table = s.data.on_table;        \n    \n    _this.detailgrid.view.el.unmask();\n \n    var act = _this.actionSel.getValue();\n    if (act.length) {\n        o.params.action = act;\n    }\n    var tbl = _this.affectSel.getValue();\n    if (tbl.length) {\n        o.params.on_table = tbl;\n    }\n     \n \n    act = _this.dateFrom.getValue();\n    if (act.format) {\n        o.params['query[from]'] = act.format('Y-m-d');\n    }\n    act = _this.dateTo.getValue();\n    if (act.format) {\n        o.params['query[to]'] = act.format('Y-m-d');\n    }\n\n    o.params['query[day_sum]'] = 1;\n    o.params._columns = 'on_day,qty,uqty';\n\n    \n}"
523                                             },
524                                             "*prop": "dataSource",
525                                             "remoteSort": true,
526                                             "xtype": "Store",
527                                             "|sortInfo": "{ field : 'on_day', direction: 'ASC' }",
528                                             "|xns": "Roo.data",
529                                             "items": [
530                                                 {
531                                                     "*prop": "proxy",
532                                                     "xtype": "HttpProxy",
533                                                     "method": "GET",
534                                                     "|url": "baseURL + '/Roo/Events.php'",
535                                                     "|xns": "Roo.data"
536                                                 },
537                                                 {
538                                                     "|xns": "Roo.data",
539                                                     "xtype": "JsonReader",
540                                                     "totalProperty": "total",
541                                                     "root": "data",
542                                                     "*prop": "reader",
543                                                     "id": "id",
544                                                     "|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]"
545                                                 }
546                                             ]
547                                         },
548                                         {
549                                             "*prop": "footer",
550                                             "xtype": "PagingToolbar",
551                                             "pageSize": 25,
552                                             "displayInfo": true,
553                                             "displayMsg": "Displaying Events{0} - {1} of {2}",
554                                             "emptyMsg": "No Events found",
555                                             "|xns": "Roo"
556                                         },
557                                         {
558                                             "*prop": "colModel[]",
559                                             "dataIndex": "on_day",
560                                             "header": "Event when",
561                                             "sortable": true,
562                                             "width": 75,
563                                             "xtype": "ColumnModel",
564                                             "|renderer": "function(v) { return String.format('{0}', v  ); }",
565                                             "|xns": "Roo.grid"
566                                         },
567                                         {
568                                             "*prop": "colModel[]",
569                                             "dataIndex": "uqty",
570                                             "header": "#Affected",
571                                             "sortable": true,
572                                             "width": 70,
573                                             "xtype": "ColumnModel",
574                                             "|renderer": "function(v) { return String.format('{0}', v); }",
575                                             "|xns": "Roo.grid"
576                                         },
577                                         {
578                                             "*prop": "colModel[]",
579                                             "dataIndex": "qty",
580                                             "header": "Changes",
581                                             "sortable": true,
582                                             "width": 70,
583                                             "xtype": "ColumnModel",
584                                             "|renderer": "function(v) { return String.format('{0}', v); }",
585                                             "|xns": "Roo.grid"
586                                         }
587                                     ]
588                                 }
589                             ]
590                         }
591                     ]
592                 }
593             ]
594         }
595     ],
596     "permname": "",
597     "modOrder": "003"
598 }