Pman.Tab.AdminLogEvents.bjs
[Pman.Admin] / Pman.Tab.AdminLogEvents.bjs
1 {
2     "id": "roo-file-121",
3     "name": "Pman.Tab.AdminLogEvents",
4     "parent": "Pman.Tab.AdminLogs",
5     "title": "Admin - Logs - Events",
6     "path": "/home/alan/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                             "height": 100,
27                             "xtype": "LayoutRegion",
28                             "|xns": "Roo"
29                         },
30                         {
31                             "listeners": {
32                                 "render": "function (_self)\n{\n  _this.viewPanel = _self;\n}"
33                             },
34                             "region": "south",
35                             "xtype": "ContentPanel",
36                             "|xns": "Roo"
37                         },
38                         {
39                             "listeners": {
40                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
41                             },
42                             "background": true,
43                             "fitContainer": true,
44                             "fitToframe": true,
45                             "region": "center",
46                             "tableName": "Events",
47                             "title": "Events",
48                             "xtype": "GridPanel",
49                             "|xns": "Roo",
50                             "items": [
51                                 {
52                                     "*prop": "grid",
53                                     "xtype": "Grid",
54                                     "autoExpandColumn": "remarks",
55                                     "loadMask": true,
56                                     "listeners": {
57                                         "|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}"
58                                     },
59                                     "|xns": "Roo.grid",
60                                     "items": [
61                                         {
62                                             "listeners": {
63                                                 "afterselectionchange": "function (_self)\n{\n    // load detail log in _this.viewPanel;\n    if (!this.getSelected()) {\n        this.viewPanel.setContent(\"Nothing Selected\");\n        return;\n    }\n    var id = this.getSelected().rec.data.id;\n    this.viewPanel.load( { url : baseURL + \"/Admin/EventView/\" + id + \".html\" });\n    \n}"
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 (! _this.personSel) {\n    return;\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                                             "|reader": "Pman.Readers.Events",
78                                             "|sortInfo": "{ field: 'event_when', direction: 'DESC'}",
79                                             "|xns": "Roo.data",
80                                             "items": [
81                                                 {
82                                                     "|xns": "Roo.data",
83                                                     "xtype": "JsonReader",
84                                                     "totalProperty": "total",
85                                                     "root": "data",
86                                                     "*prop": "reader",
87                                                     "id": "id",
88                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
89                                                 },
90                                                 {
91                                                     "*prop": "proxy",
92                                                     "xtype": "HttpProxy",
93                                                     "method": "GET",
94                                                     "|url": "baseURL + '/Roo/Events.php'",
95                                                     "listeners": {},
96                                                     "|xns": "Roo.data"
97                                                 }
98                                             ]
99                                         },
100                                         {
101                                             "*prop": "footer",
102                                             "xtype": "PagingToolbar",
103                                             "pageSize": 25,
104                                             "displayInfo": true,
105                                             "displayMsg": "Displaying Events  {0} - {1} of {2}",
106                                             "emptyMsg": "No Events found",
107                                             "|xns": "Roo",
108                                             "items": [
109                                                 {
110                                                     "listeners": {
111                                                         "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    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    new Pman.download({\n        url : baseURL + '/Roo/Events.php',\n        params : params,\n        newWindow: true\n        \n    });\n}"
112                                                     },
113                                                     "text": "Download to Excel",
114                                                     "xtype": "Button",
115                                                     "|xns": "Roo.Toolbar"
116                                                 }
117                                             ]
118                                         },
119                                         {
120                                             "*prop": "toolbar",
121                                             "xtype": "Toolbar",
122                                             "listeners": {},
123                                             "|xns": "Roo",
124                                             "items": [
125                                                 {
126                                                     "xtype": "TextItem",
127                                                     "|xns": "Roo.Toolbar",
128                                                     "text": "Show",
129                                                     "listeners": {}
130                                                 },
131                                                 {
132                                                     "listeners": {
133                                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n  \n}",
134                                                         "|render": "function (_self)\n{\n  _this.personSel = _self;\n}"
135                                                     },
136                                                     "allowBlank": true,
137                                                     "displayField": "name",
138                                                     "editable": true,
139                                                     "emptyText": "Select Person ",
140                                                     "fieldLabel": "Person ",
141                                                     "forceSelection": true,
142                                                     "listWidth": 600,
143                                                     "loadingText": "Searching...",
144                                                     "minChars": 2,
145                                                     "name": "person_id_name",
146                                                     "pageSize": 20,
147                                                     "qtip": "Select Person ",
148                                                     "queryParam": "query[name]",
149                                                     "selectOnFocus": true,
150                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt; </div>",
151                                                     "triggerAction": "all",
152                                                     "typeAhead": true,
153                                                     "valueField": "id",
154                                                     "width": 150,
155                                                     "xtype": "ComboBox",
156                                                     "|xns": "Roo.form",
157                                                     "items": [
158                                                         {
159                                                             "listeners": {
160                                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    o.company_id = Pman.Login.authUser.company_id;\n}"
161                                                             },
162                                                             "*prop": "store",
163                                                             "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
164                                                             "xtype": "Store",
165                                                             "|xns": "Roo.data",
166                                                             "items": [
167                                                                 {
168                                                                     "*prop": "proxy",
169                                                                     "xtype": "HttpProxy",
170                                                                     "|url": "baseURL + '/Roo/Person.php'",
171                                                                     "method": "GET",
172                                                                     "|xns": "Roo.data"
173                                                                 },
174                                                                 {
175                                                                     "*prop": "reader",
176                                                                     "id": "id",
177                                                                     "root": "data",
178                                                                     "totalProperty": "total",
179                                                                     "xtype": "JsonReader",
180                                                                     "|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]",
181                                                                     "|xns": "Roo.data"
182                                                                 }
183                                                             ]
184                                                         }
185                                                     ]
186                                                 },
187                                                 {
188                                                     "listeners": {
189                                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
190                                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
191                                                     },
192                                                     "allowBlank": true,
193                                                     "displayField": "action",
194                                                     "editable": false,
195                                                     "emptyText": "Select Action",
196                                                     "forceSelection": true,
197                                                     "listWidth": 300,
198                                                     "loadingText": "Searching...",
199                                                     "minChars": 2,
200                                                     "name": "action",
201                                                     "pageSize": 20,
202                                                     "qtip": "Select Action",
203                                                     "queryParam": "query[action]",
204                                                     "selectOnFocus": true,
205                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
206                                                     "triggerAction": "all",
207                                                     "typeAhead": true,
208                                                     "valueField": "action",
209                                                     "width": 150,
210                                                     "xtype": "ComboBox",
211                                                     "|xns": "Roo.form",
212                                                     "items": [
213                                                         {
214                                                             "listeners": {
215                                                                 "|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}"
216                                                             },
217                                                             "*prop": "store",
218                                                             "remoteSort": true,
219                                                             "xtype": "Store",
220                                                             "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
221                                                             "|xns": "Roo.data",
222                                                             "items": [
223                                                                 {
224                                                                     "*prop": "proxy",
225                                                                     "method": "GET",
226                                                                     "xtype": "HttpProxy",
227                                                                     "|url": "baseURL + '/Roo/Events.php'",
228                                                                     "|xns": "Roo.data"
229                                                                 },
230                                                                 {
231                                                                     "|xns": "Roo.data",
232                                                                     "xtype": "JsonReader",
233                                                                     "totalProperty": "total",
234                                                                     "root": "data",
235                                                                     "*prop": "reader",
236                                                                     "id": "id",
237                                                                     "|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]"
238                                                                 }
239                                                             ]
240                                                         }
241                                                     ]
242                                                 },
243                                                 {
244                                                     "listeners": {
245                                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
246                                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
247                                                     },
248                                                     "allowBlank": true,
249                                                     "displayField": "on_table",
250                                                     "editable": false,
251                                                     "emptyText": "Select Affects",
252                                                     "forceSelection": true,
253                                                     "listWidth": 300,
254                                                     "loadingText": "Searching...",
255                                                     "minChars": 2,
256                                                     "name": "on_table",
257                                                     "pageSize": 20,
258                                                     "qtip": "Select Action",
259                                                     "queryParam": "query[on_table]",
260                                                     "selectOnFocus": true,
261                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
262                                                     "triggerAction": "all",
263                                                     "typeAhead": true,
264                                                     "valueField": "action",
265                                                     "width": 150,
266                                                     "xtype": "ComboBox",
267                                                     "|xns": "Roo.form",
268                                                     "items": [
269                                                         {
270                                                             "listeners": {
271                                                                 "|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}"
272                                                             },
273                                                             "*prop": "store",
274                                                             "remoteSort": true,
275                                                             "xtype": "Store",
276                                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
277                                                             "|xns": "Roo.data",
278                                                             "items": [
279                                                                 {
280                                                                     "*prop": "proxy",
281                                                                     "method": "GET",
282                                                                     "xtype": "HttpProxy",
283                                                                     "|url": "baseURL + '/Roo/Events.php'",
284                                                                     "|xns": "Roo.data"
285                                                                 },
286                                                                 {
287                                                                     "|xns": "Roo.data",
288                                                                     "xtype": "JsonReader",
289                                                                     "totalProperty": "total",
290                                                                     "root": "data",
291                                                                     "*prop": "reader",
292                                                                     "id": "id",
293                                                                     "|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]"
294                                                                 }
295                                                             ]
296                                                         }
297                                                     ]
298                                                 },
299                                                 {
300                                                     "text": "Date Range",
301                                                     "xtype": "TextItem",
302                                                     "|xns": "Roo.Toolbar"
303                                                 },
304                                                 {
305                                                     "listeners": {
306                                                         "render": "function (_self)\n{\n  _this.dateFrom = _self;\n}",
307                                                         "change": "function (_self, newValue, oldValue)\n{\n  _this.grid.footer.onClick('first');\n}"
308                                                     },
309                                                     "format": "Y-m-d",
310                                                     "xtype": "DateField",
311                                                     "|xns": "Roo.form"
312                                                 },
313                                                 {
314                                                     "listeners": {
315                                                         "render": "function (_self)\n{\n  _this.dateTo = _self;\n}",
316                                                         "change": "function (_self, newValue, oldValue)\n{\n  _this.grid.footer.onClick('first');\n}"
317                                                     },
318                                                     "format": "Y-m-d",
319                                                     "xtype": "DateField",
320                                                     "|xns": "Roo.form"
321                                                 }
322                                             ]
323                                         },
324                                         {
325                                             "*prop": "colModel[]",
326                                             "dataIndex": "event_when",
327                                             "header": "When",
328                                             "width": 100,
329                                             "xtype": "ColumnModel",
330                                             "|renderer": "function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }",
331                                             "|xns": "Roo.grid"
332                                         },
333                                         {
334                                             "*prop": "colModel[]",
335                                             "dataIndex": "id",
336                                             "header": "#id",
337                                             "width": 100,
338                                             "xtype": "ColumnModel",
339                                             "|xns": "Roo.grid"
340                                         },
341                                         {
342                                             "*prop": "colModel[]",
343                                             "dataIndex": "person_id_name",
344                                             "header": "Staff",
345                                             "width": 150,
346                                             "xtype": "ColumnModel",
347                                             "|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}",
348                                             "|xns": "Roo.grid"
349                                         },
350                                         {
351                                             "xtype": "ColumnModel",
352                                             "header": "Action",
353                                             "width": 100,
354                                             "dataIndex": "action",
355                                             "|renderer": "function(v) { return String.format('{0}', v); }",
356                                             "|xns": "Roo.grid",
357                                             "*prop": "colModel[]"
358                                         },
359                                         {
360                                             "xtype": "ColumnModel",
361                                             "header": "IP",
362                                             "width": 100,
363                                             "dataIndex": "ipaddr",
364                                             "|renderer": "function(v) { return String.format('{0}', v); }",
365                                             "listeners": {},
366                                             "|xns": "Roo.grid",
367                                             "*prop": "colModel[]"
368                                         },
369                                         {
370                                             "*prop": "colModel[]",
371                                             "dataIndex": "on_table",
372                                             "header": "Affected",
373                                             "width": 100,
374                                             "xtype": "ColumnModel",
375                                             "|renderer": "function(v, x, r) {                     \n            return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';  \n   }",
376                                             "|xns": "Roo.grid"
377                                         },
378                                         {
379                                             "*prop": "colModel[]",
380                                             "dataIndex": "remarks",
381                                             "header": "Remarks",
382                                             "width": 300,
383                                             "xtype": "ColumnModel",
384                                             "|renderer": "function(v) { return String.format('<span qtip=\"{1}\">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }",
385                                             "|xns": "Roo.grid"
386                                         }
387                                     ]
388                                 }
389                             ]
390                         }
391                     ]
392                 }
393             ]
394         }
395     ],
396     "permname": "Admin.Logs",
397     "modOrder": "001"
398 }