Pman.Tab.AdminLogEvents.bjs
[Pman.Admin] / Pman.Tab.AdminLogEvents.bjs
1 {
2     "id": "roo-file-43",
3     "name": "Pman.Tab.AdminLogEvents",
4     "parent": "Pman.Tab.AdminLogs",
5     "title": "Admin - Logs - Events",
6     "path": "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminLogEvents.bjs",
7     "items": [
8         {
9             "region": "center",
10             "title": "Events",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "|xns": "Roo",
21                             "xtype": "LayoutRegion",
22                             "*prop": "center"
23                         },
24                         {
25                             "*prop": "south",
26                             "autoScroll": true,
27                             "height": 150,
28                             "split": true,
29                             "xtype": "LayoutRegion",
30                             "|xns": "Roo"
31                         },
32                         {
33                             "listeners": {
34                                 "render": "function (_self)\n{\n  _this.viewPanel = _self;\n}"
35                             },
36                             "fitToFrame": true,
37                             "region": "south",
38                             "xtype": "ContentPanel",
39                             "|xns": "Roo"
40                         },
41                         {
42                             "listeners": {
43                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
44                             },
45                             "background": true,
46                             "fitContainer": true,
47                             "fitToframe": true,
48                             "region": "center",
49                             "tableName": "Events",
50                             "title": "Events",
51                             "xtype": "GridPanel",
52                             "|xns": "Roo",
53                             "items": [
54                                 {
55                                     "listeners": {
56                                         "|render": "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
57                                     },
58                                     "*prop": "grid",
59                                     "autoExpandColumn": "remarks",
60                                     "loadMask": true,
61                                     "xtype": "Grid",
62                                     "|xns": "Roo.grid",
63                                     "items": [
64                                         {
65                                             "*prop": "sm",
66                                             "singleSelect": true,
67                                             "xtype": "RowSelectionModel",
68                                             "|xns": "Roo.grid"
69                                         },
70                                         {
71                                             "listeners": {
72                                                 "|beforeload": "function (_self, o)\n{\n    if (!Pman.buildCompleted) {\n        return false;\n    }\n   \n   \n   if (! _this.personSel) {\n    return false;\n    }\n    o.params = o.params || {};\n    o.params.person_id = _this.personSel.getValue();\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    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    act = _this.groupedCombo.getValue();\n    o.params['query[grouped]'] = act;\n    if (o.params['query[grouped]'] == 'gr') {\n    \n        if (!tbl.length) {\n            Roo.MessageBox.alert(\"Error\", \"Select a table to group results on\");\n            return false;\n        }\n//        o.params['_columns']  = \n        o.params['_distinct'] = 'on_id';\n        \n        \n    }\n    \n    */\n\n    \n}"
73                                             },
74                                             "*prop": "dataSource",
75                                             "remoteSort": true,
76                                             "xtype": "Store",
77                                             "|sortInfo": "{ field: 'event_when', direction: 'DESC'}",
78                                             "|xns": "Roo.data",
79                                             "items": [
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                                                     "*prop": "proxy",
91                                                     "xtype": "HttpProxy",
92                                                     "method": "GET",
93                                                     "|url": "baseURL + '/Roo/Events.php'",
94                                                     "listeners": {},
95                                                     "|xns": "Roo.data"
96                                                 }
97                                             ]
98                                         },
99                                         {
100                                             "*prop": "footer",
101                                             "xtype": "PagingToolbar",
102                                             "pageSize": 25,
103                                             "displayInfo": true,
104                                             "displayMsg": "Displaying Events  {0} - {1} of {2}",
105                                             "emptyMsg": "No Events found",
106                                             "|xns": "Roo",
107                                             "items": [
108                                                 {
109                                                     "listeners": {
110                                                         "click": "function (_self, e)\n{\n    \n    var params = {\n        'sort' : 'event_when',\n        'dir' : 'DESC',\n        'start' : 0,\n        'limit' : 900,\n        person_id : _this.personSel.getValue(), \n        'csvTitles[0]' : 'When',   'csvCols[0]' : 'event_when', \n        'csvTitles[1]' : 'Staff',   'csvCols[1]' : 'person_id_name', \n        'csvTitles[2]' : 'Action',   'csvCols[2]' : 'action', \n        'csvTitles[3]' : 'Record ID',   'csvCols[3]' : 'on_id'       ,\n        'csvTitles[4]' : 'Record Type',   'csvCols[4]' : 'on_table',\n        'csvTitles[5]' : 'Remarks',   'csvCols[5]' : 'remarks'        \n    }\n        \n    params.person_id = _this.personSel.getValue();\n    var act = _this.actionSel.getValue();\n    if (act.length) {\n        params.action = act;\n    }\n    var tbl = _this.affectSel.getValue();\n    if (tbl.length) {\n        params.on_table = tbl;\n    }\n    act = _this.dateFrom.getValue();\n    if (act.format) {\n        params['query[from]'] = act.format('Y-m-d');\n    }\n    act = _this.dateTo.getValue();\n    if (act.format) {\n        params['query[to]'] = act.format('Y-m-d');\n    }\n    \n\n    new Pman.download({\n        url : baseURL + '/Roo/Events.php',\n        params : params,\n        newWindow: true\n        \n    });\n}"
111                                                     },
112                                                     "text": "Download to Excel",
113                                                     "xtype": "Button",
114                                                     "|xns": "Roo.Toolbar"
115                                                 }
116                                             ]
117                                         },
118                                         {
119                                             "*prop": "toolbar",
120                                             "xtype": "Toolbar",
121                                             "listeners": {},
122                                             "|xns": "Roo",
123                                             "items": [
124                                                 {
125                                                     "xtype": "TextItem",
126                                                     "|xns": "Roo.Toolbar",
127                                                     "text": "Show",
128                                                     "listeners": {}
129                                                 },
130                                                 {
131                                                     "listeners": {
132                                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n  \n}",
133                                                         "|render": "function (_self)\n{\n  _this.personSel = _self;\n}"
134                                                     },
135                                                     "allowBlank": true,
136                                                     "displayField": "name",
137                                                     "editable": false,
138                                                     "emptyText": "Select Person ",
139                                                     "fieldLabel": "Person ",
140                                                     "forceSelection": true,
141                                                     "listWidth": 600,
142                                                     "loadingText": "Searching...",
143                                                     "minChars": 2,
144                                                     "name": "person_id_name",
145                                                     "pageSize": 20,
146                                                     "qtip": "Select Person ",
147                                                     "queryParam": "query[name]",
148                                                     "selectOnFocus": true,
149                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt; </div>",
150                                                     "triggerAction": "all",
151                                                     "typeAhead": true,
152                                                     "valueField": "id",
153                                                     "width": 150,
154                                                     "xtype": "ComboBox",
155                                                     "|xns": "Roo.form",
156                                                     "items": [
157                                                         {
158                                                             "listeners": {
159                                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    o.company_id = Pman.Login.authUser.company_id;\n}"
160                                                             },
161                                                             "*prop": "store",
162                                                             "xtype": "Store",
163                                                             "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
164                                                             "|xns": "Roo.data",
165                                                             "items": [
166                                                                 {
167                                                                     "*prop": "proxy",
168                                                                     "xtype": "HttpProxy",
169                                                                     "|url": "baseURL + '/Roo/Person.php'",
170                                                                     "method": "GET",
171                                                                     "|xns": "Roo.data"
172                                                                 },
173                                                                 {
174                                                                     "*prop": "reader",
175                                                                     "id": "id",
176                                                                     "root": "data",
177                                                                     "totalProperty": "total",
178                                                                     "xtype": "JsonReader",
179                                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'phone',\n        'type': 'string'\n    },\n    {\n        'name': 'fax',\n        'type': 'string'\n    },\n    {\n        'name': 'email',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'role',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'lang',\n        'type': 'string'\n    },\n    {\n        'name': 'no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'deleted_dt',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'office_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_tel',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_url',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_created_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'company_id_updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_updated_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'company_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_dispatch_port',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_province',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_country',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_type',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_client_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_team_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_file_location',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_open_date',\n        'type': 'date'\n    },\n    {\n        'name': 'project_id_open_by',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_close_date',\n        'type': 'date'\n    },\n    {\n        'name': 'project_id_countries',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_languages',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_agency_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_deleted_dt',\n        'type': 'date'\n    }\n]",
180                                                                     "|xns": "Roo.data"
181                                                                 }
182                                                             ]
183                                                         }
184                                                     ]
185                                                 },
186                                                 {
187                                                     "listeners": {
188                                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
189                                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
190                                                     },
191                                                     "allowBlank": true,
192                                                     "displayField": "action",
193                                                     "editable": false,
194                                                     "emptyText": "Select Action",
195                                                     "forceSelection": true,
196                                                     "listWidth": 300,
197                                                     "loadingText": "Searching...",
198                                                     "minChars": 2,
199                                                     "name": "action",
200                                                     "pageSize": 20,
201                                                     "qtip": "Select Action",
202                                                     "queryParam": "query[action]",
203                                                     "selectOnFocus": true,
204                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
205                                                     "triggerAction": "all",
206                                                     "typeAhead": true,
207                                                     "valueField": "action",
208                                                     "width": 150,
209                                                     "xtype": "ComboBox",
210                                                     "|xns": "Roo.form",
211                                                     "items": [
212                                                         {
213                                                             "listeners": {
214                                                                 "|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}"
215                                                             },
216                                                             "*prop": "store",
217                                                             "remoteSort": true,
218                                                             "xtype": "Store",
219                                                             "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
220                                                             "|xns": "Roo.data",
221                                                             "items": [
222                                                                 {
223                                                                     "*prop": "proxy",
224                                                                     "method": "GET",
225                                                                     "xtype": "HttpProxy",
226                                                                     "|url": "baseURL + '/Roo/Events.php'",
227                                                                     "|xns": "Roo.data"
228                                                                 },
229                                                                 {
230                                                                     "|xns": "Roo.data",
231                                                                     "xtype": "JsonReader",
232                                                                     "totalProperty": "total",
233                                                                     "root": "data",
234                                                                     "*prop": "reader",
235                                                                     "id": "id",
236                                                                     "|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]"
237                                                                 }
238                                                             ]
239                                                         }
240                                                     ]
241                                                 },
242                                                 {
243                                                     "listeners": {
244                                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
245                                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
246                                                     },
247                                                     "allowBlank": true,
248                                                     "displayField": "on_table",
249                                                     "editable": false,
250                                                     "emptyText": "Select Affects",
251                                                     "forceSelection": true,
252                                                     "listWidth": 300,
253                                                     "loadingText": "Searching...",
254                                                     "minChars": 2,
255                                                     "name": "on_table",
256                                                     "pageSize": 20,
257                                                     "qtip": "Select Action",
258                                                     "queryParam": "query[on_table]",
259                                                     "selectOnFocus": true,
260                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
261                                                     "triggerAction": "all",
262                                                     "typeAhead": true,
263                                                     "valueField": "action",
264                                                     "width": 150,
265                                                     "xtype": "ComboBox",
266                                                     "|xns": "Roo.form",
267                                                     "items": [
268                                                         {
269                                                             "listeners": {
270                                                                 "|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}"
271                                                             },
272                                                             "*prop": "store",
273                                                             "remoteSort": true,
274                                                             "xtype": "Store",
275                                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
276                                                             "|xns": "Roo.data",
277                                                             "items": [
278                                                                 {
279                                                                     "*prop": "proxy",
280                                                                     "method": "GET",
281                                                                     "xtype": "HttpProxy",
282                                                                     "|url": "baseURL + '/Roo/Events.php'",
283                                                                     "|xns": "Roo.data"
284                                                                 },
285                                                                 {
286                                                                     "|xns": "Roo.data",
287                                                                     "xtype": "JsonReader",
288                                                                     "totalProperty": "total",
289                                                                     "root": "data",
290                                                                     "*prop": "reader",
291                                                                     "id": "id",
292                                                                     "|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]"
293                                                                 }
294                                                             ]
295                                                         }
296                                                     ]
297                                                 },
298                                                 {
299                                                     "text": "Date Range",
300                                                     "xtype": "TextItem",
301                                                     "|xns": "Roo.Toolbar"
302                                                 },
303                                                 {
304                                                     "listeners": {
305                                                         "render": "function (_self)\n{\n  _this.dateFrom = _self;\n}",
306                                                         "change": "function (_self, newValue, oldValue)\n{\n  _this.grid.footer.onClick('first');\n}"
307                                                     },
308                                                     "format": "Y-m-d",
309                                                     "xtype": "DateField",
310                                                     "|xns": "Roo.form"
311                                                 },
312                                                 {
313                                                     "listeners": {
314                                                         "render": "function (_self)\n{\n  _this.dateTo = _self;\n}",
315                                                         "change": "function (_self, newValue, oldValue)\n{\n  _this.grid.footer.onClick('first');\n}"
316                                                     },
317                                                     "format": "Y-m-d",
318                                                     "xtype": "DateField",
319                                                     "|xns": "Roo.form"
320                                                 }
321                                             ]
322                                         },
323                                         {
324                                             "*prop": "colModel[]",
325                                             "dataIndex": "event_when",
326                                             "header": "When",
327                                             "width": 100,
328                                             "xtype": "ColumnModel",
329                                             "|renderer": "function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }",
330                                             "|xns": "Roo.grid"
331                                         },
332                                         {
333                                             "*prop": "colModel[]",
334                                             "dataIndex": "id",
335                                             "header": "#id",
336                                             "width": 100,
337                                             "xtype": "ColumnModel",
338                                             "|xns": "Roo.grid"
339                                         },
340                                         {
341                                             "*prop": "colModel[]",
342                                             "dataIndex": "person_id_name",
343                                             "header": "Staff",
344                                             "width": 150,
345                                             "xtype": "ColumnModel",
346                                             "|renderer": "function(v,x,r) { \n    \n    \n    var email = r.data.person_id_email; // ? r.data.person_id_email : r.data.person_id_email;\n    var name  = r.data.person_id_name; // ? r.data.person_id_name : r.data.person_id_name;    \n    return String.format('{0} &lt;<a href=\"mailto:{1}\">{1}</a>&gt;', \n        name, email); \n}",
347                                             "|xns": "Roo.grid"
348                                         },
349                                         {
350                                             "xtype": "ColumnModel",
351                                             "header": "Action",
352                                             "width": 100,
353                                             "dataIndex": "action",
354                                             "|renderer": "function(v) { return String.format('{0}', v); }",
355                                             "|xns": "Roo.grid",
356                                             "*prop": "colModel[]"
357                                         },
358                                         {
359                                             "xtype": "ColumnModel",
360                                             "header": "IP",
361                                             "width": 100,
362                                             "dataIndex": "ipaddr",
363                                             "|renderer": "function(v) { return String.format('{0}', v); }",
364                                             "listeners": {},
365                                             "|xns": "Roo.grid",
366                                             "*prop": "colModel[]"
367                                         },
368                                         {
369                                             "*prop": "colModel[]",
370                                             "dataIndex": "on_table",
371                                             "header": "Affected",
372                                             "width": 100,
373                                             "xtype": "ColumnModel",
374                                             "|renderer": "function(v, x, r) {                     \n            return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';  \n   }",
375                                             "|xns": "Roo.grid"
376                                         },
377                                         {
378                                             "*prop": "colModel[]",
379                                             "dataIndex": "remarks",
380                                             "header": "Remarks",
381                                             "width": 300,
382                                             "xtype": "ColumnModel",
383                                             "|renderer": "function(v) { return String.format('<span qtip=\"{1}\">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }",
384                                             "|xns": "Roo.grid"
385                                         }
386                                     ]
387                                 }
388                             ]
389                         }
390                     ]
391                 }
392             ]
393         }
394     ],
395     "permname": "Admin.Logs",
396     "modOrder": "001"
397 }