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