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