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