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