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