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