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