Pman.Tab.AdminProjectMembers.js
[Pman.Admin] / Pman.Tab.AdminLogEvents.bjs
1 {
2     "id": "roo-file-0",
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             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "Events",
17             "title": "Events",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "*prop": "grid",
23                     "xtype": "Grid",
24                     "autoExpandColumn": "remarks",
25                     "loadMask": true,
26                     "listeners": {
27                         "|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}"
28                     },
29                     "|xns": "Roo.grid",
30                     "items": [
31                         {
32                             "listeners": {
33                                 "|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     act = _this.affectSel.getValue();\n    if (act.length) {\n        o.params.on_table = act;\n    }\n    \n}"
34                             },
35                             "*prop": "dataSource",
36                             "remoteSort": true,
37                             "xtype": "Store",
38                             "|reader": "Pman.Readers.Events",
39                             "|sortInfo": "{ field: 'event_when', direction: 'DESC'}",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/Events.php'",
47                                     "listeners": {},
48                                     "|xns": "Roo.data"
49                                 }
50                             ]
51                         },
52                         {
53                             "*prop": "footer",
54                             "xtype": "PagingToolbar",
55                             "pageSize": 25,
56                             "displayInfo": true,
57                             "displayMsg": "Displaying Events  {0} - {1} of {2}",
58                             "emptyMsg": "No Events found",
59                             "|xns": "Roo"
60                         },
61                         {
62                             "*prop": "toolbar",
63                             "xtype": "Toolbar",
64                             "listeners": {},
65                             "|xns": "Roo",
66                             "items": [
67                                 {
68                                     "xtype": "TextItem",
69                                     "|xns": "Roo.Toolbar",
70                                     "text": "Show",
71                                     "listeners": {}
72                                 },
73                                 {
74                                     "fieldLabel": "Person ",
75                                     "name": "person_id_name",
76                                     "qtip": "Select Person ",
77                                     "emptyText": "Select Person ",
78                                     "xtype": "ComboBox",
79                                     "selectOnFocus": true,
80                                     "allowBlank": true,
81                                     "width": 150,
82                                     "listWidth": 400,
83                                     "editable": false,
84                                     "displayField": "name",
85                                     "valueField": "id",
86                                     "typeAhead": true,
87                                     "forceSelection": true,
88                                     "triggerAction": "all",
89                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
90                                     "queryParam": "query[name]",
91                                     "loadingText": "Searching...",
92                                     "minChars": 2,
93                                     "pageSize": 20,
94                                     "listeners": {
95                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
96                                         "|render": "function (_self)\n{\n  _this.personSel = _self;\n}"
97                                     },
98                                     "|xns": "Roo.form",
99                                     "items": [
100                                         {
101                                             "listeners": {
102                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    o.company_id = Pman.Login.authUser.company_id;\n}"
103                                             },
104                                             "*prop": "store",
105                                             "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
106                                             "xtype": "Store",
107                                             "|xns": "Roo.data",
108                                             "items": [
109                                                 {
110                                                     "*prop": "proxy",
111                                                     "xtype": "HttpProxy",
112                                                     "|url": "baseURL + '/Roo/Person.php'",
113                                                     "method": "GET",
114                                                     "|xns": "Roo.data"
115                                                 },
116                                                 {
117                                                     "|xns": "Roo.data",
118                                                     "xtype": "JsonReader",
119                                                     "totalProperty": "total",
120                                                     "root": "data",
121                                                     "*prop": "reader",
122                                                     "id": "id",
123                                                     "|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]"
124                                                 }
125                                             ]
126                                         }
127                                     ]
128                                 },
129                                 {
130                                     "listeners": {
131                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
132                                         "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
133                                     },
134                                     "allowBlank": true,
135                                     "displayField": "action",
136                                     "editable": false,
137                                     "emptyText": "Select Action",
138                                     "forceSelection": true,
139                                     "listWidth": 300,
140                                     "loadingText": "Searching...",
141                                     "minChars": 2,
142                                     "name": "action",
143                                     "pageSize": 20,
144                                     "qtip": "Select Action",
145                                     "queryParam": "query[action]",
146                                     "selectOnFocus": true,
147                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>",
148                                     "triggerAction": "all",
149                                     "typeAhead": true,
150                                     "valueField": "action",
151                                     "width": 150,
152                                     "xtype": "ComboBox",
153                                     "|xns": "Roo.form",
154                                     "items": [
155                                         {
156                                             "listeners": {
157                                                 "|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}"
158                                             },
159                                             "*prop": "store",
160                                             "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
161                                             "xtype": "Store",
162                                             "|xns": "Roo.data",
163                                             "items": [
164                                                 {
165                                                     "*prop": "proxy",
166                                                     "method": "GET",
167                                                     "xtype": "HttpProxy",
168                                                     "|url": "baseURL + '/Roo/Events.php'",
169                                                     "|xns": "Roo.data"
170                                                 },
171                                                 {
172                                                     "|xns": "Roo.data",
173                                                     "xtype": "JsonReader",
174                                                     "totalProperty": "total",
175                                                     "root": "data",
176                                                     "*prop": "reader",
177                                                     "id": "id",
178                                                     "|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]"
179                                                 }
180                                             ]
181                                         }
182                                     ]
183                                 },
184                                 {
185                                     "listeners": {
186                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
187                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
188                                     },
189                                     "allowBlank": true,
190                                     "displayField": "on_table",
191                                     "editable": false,
192                                     "emptyText": "Select Affects",
193                                     "forceSelection": true,
194                                     "listWidth": 300,
195                                     "loadingText": "Searching...",
196                                     "minChars": 2,
197                                     "name": "on_table",
198                                     "pageSize": 20,
199                                     "qtip": "Select Action",
200                                     "queryParam": "query[on_table]",
201                                     "selectOnFocus": true,
202                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
203                                     "triggerAction": "all",
204                                     "typeAhead": true,
205                                     "valueField": "action",
206                                     "width": 150,
207                                     "xtype": "ComboBox",
208                                     "|xns": "Roo.form",
209                                     "items": [
210                                         {
211                                             "listeners": {
212                                                 "|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}"
213                                             },
214                                             "*prop": "store",
215                                             "xtype": "Store",
216                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
217                                             "|xns": "Roo.data",
218                                             "items": [
219                                                 {
220                                                     "*prop": "proxy",
221                                                     "method": "GET",
222                                                     "xtype": "HttpProxy",
223                                                     "|url": "baseURL + '/Roo/Events.php'",
224                                                     "|xns": "Roo.data"
225                                                 },
226                                                 {
227                                                     "|xns": "Roo.data",
228                                                     "xtype": "JsonReader",
229                                                     "totalProperty": "total",
230                                                     "root": "data",
231                                                     "*prop": "reader",
232                                                     "id": "id",
233                                                     "|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]"
234                                                 }
235                                             ]
236                                         }
237                                     ]
238                                 },
239                                 {
240                                     "listeners": {
241                                         "click": "function (_self, e)\n{\n \n    var params = {\n        'sort' : 'event_when',\n        'dir' : 'DESC',\n        'start' : 0,\n        'limit' : 400,\n        person_id : _this.personSel.getValue(), \n        'csvTitles[0]' : 'When',   'csvCols[0]' : 'event_when', \n        'csvTitles[1]' : 'Staff',   'csvCols[1]' : 'person_name', \n        'csvTitles[2]' : 'Action',   'csvCols[2]' : 'action', \n        'csvTitles[3]' : 'Remarks',   'csvCols[3]' : 'remarks'\n        \n    }\n        \n    \n    var act = _this.actionSel.getValue();\n    if (act.length) {\n        params.action = act;\n    }\n    \n\n    new Pman.download({\n        url : baseURL + '/Roo/Events.php',\n        params : params,\n        newWindow: true\n        \n    });\n}"
242                                     },
243                                     "text": "Download",
244                                     "xtype": "Button",
245                                     "|xns": "Roo.Toolbar"
246                                 }
247                             ]
248                         },
249                         {
250                             "xtype": "ColumnModel",
251                             "header": "When",
252                             "width": 100,
253                             "dataIndex": "event_when",
254                             "|renderer": "function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }",
255                             "listeners": {},
256                             "|xns": "Roo.grid",
257                             "*prop": "colModel[]"
258                         },
259                         {
260                             "*prop": "colModel[]",
261                             "dataIndex": "id",
262                             "header": "#id",
263                             "width": 100,
264                             "xtype": "ColumnModel",
265                             "|xns": "Roo.grid",
266                             "listeners": {}
267                         },
268                         {
269                             "xtype": "ColumnModel",
270                             "header": "Staff",
271                             "width": 150,
272                             "dataIndex": "person_name",
273                             "|renderer": "function(v) { return String.format('{0}', v); }",
274                             "listeners": {},
275                             "|xns": "Roo.grid",
276                             "*prop": "colModel[]"
277                         },
278                         {
279                             "xtype": "ColumnModel",
280                             "header": "Action",
281                             "width": 100,
282                             "dataIndex": "action",
283                             "|renderer": "function(v) { return String.format('{0}', v); }",
284                             "|xns": "Roo.grid",
285                             "*prop": "colModel[]"
286                         },
287                         {
288                             "xtype": "ColumnModel",
289                             "header": "IP",
290                             "width": 100,
291                             "dataIndex": "ipaddr",
292                             "|renderer": "function(v) { return String.format('{0}', v); }",
293                             "listeners": {},
294                             "|xns": "Roo.grid",
295                             "*prop": "colModel[]"
296                         },
297                         {
298                             "xtype": "ColumnModel",
299                             "header": "Affected",
300                             "width": 100,
301                             "dataIndex": "on_id",
302                             "|renderer": "function(v, x, r) {                             return v ? String.format('{0}({1})', r.data.on_table, v)  : '';                         }",
303                             "listeners": {},
304                             "|xns": "Roo.grid",
305                             "*prop": "colModel[]"
306                         },
307                         {
308                             "xtype": "ColumnModel",
309                             "header": "Remarks",
310                             "width": 300,
311                             "dataIndex": "remarks",
312                             "|renderer": "function(v) { return String.format('{0}', v); }",
313                             "listeners": {},
314                             "|xns": "Roo.grid",
315                             "*prop": "colModel[]"
316                         }
317                     ]
318                 }
319             ]
320         }
321     ],
322     "permname": "",
323     "modOrder": "001"
324 }