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