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