Pman.Tab.AdminNotify.bjs
[Pman.Admin] / Pman.Tab.AdminNotify.bjs
1 {
2     "id": "roo-file-255",
3     "name": "Pman.Tab.AdminNotify",
4     "parent": "Pman.Tab.AdminWatchNotify",
5     "title": "Pman.Tab.AdminNotify",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminNotify.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    \n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "core_notify",
17             "title": "Current Notifications",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "person_id_name",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "beforeload": "function (_self, options)\n{\n    if (!_this.toggleBtn.pressed) {\n        options.params['event_id'] = 0;\n    }\n    if (!_this.personCombo) {\n        return false;\n    }\n    var p = _this.personCombo.getValue();\n    if (p*1) { \n        options.params.person_id = p;\n    }\n    \n}"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'act_when', direction: 'DESC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/core_notify.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'act_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'msgid',\n        'type': 'string'\n    },\n    {\n        'name': 'sent',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'event_id',\n        'type': 'int'\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    {\n        'name': 'event_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'event_id_person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_id_event_when',\n        'type': 'date'\n    },\n    {\n        'name': 'event_id_action',\n        'type': 'string'\n    },\n    {\n        'name': 'event_id_ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'event_id_on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'event_id_on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'event_id_person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'event_id_remarks',\n        'type': 'string'\n    }\n]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "xtype": "PagingToolbar",
63                             "pageSize": 25,
64                             "displayInfo": true,
65                             "displayMsg": "Displaying core_notify{0} - {1} of {2}",
66                             "emptyMsg": "No core_notify found",
67                             "|xns": "Roo"
68                         },
69                         {
70                             "*prop": "toolbar",
71                             "xtype": "Toolbar",
72                             "|xns": "Roo",
73                             "items": [
74                                 {
75                                     "listeners": {
76                                         "select": "function (combo, record, index)\n{\n   (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
77                                         "render": "function (_self)\n{\n   _this.personCombo = _self;\n}"
78                                     },
79                                     "allowBlank": true,
80                                     "displayField": "person_id_name",
81                                     "editable": true,
82                                     "emptyText": "Select person",
83                                     "forceSelection": true,
84                                     "hiddenName": "id",
85                                     "listWidth": 400,
86                                     "loadingText": "Searching...",
87                                     "minChars": 2,
88                                     "name": "name",
89                                     "pageSize": 20,
90                                     "qtip": "Select core_notify",
91                                     "queryParam": "query[person_id_name]",
92                                     "selectOnFocus": true,
93                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{person_id_name}</b> {person_id_email}</div>",
94                                     "triggerAction": "all",
95                                     "valueField": "person_id",
96                                     "width": 300,
97                                     "xtype": "ComboBox",
98                                     "|xns": "Roo.form",
99                                     "items": [
100                                         {
101                                             "listeners": {
102                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params._distinct='person_id';\n    o.params._columns='person_id,person_id_name,person_id_email';\n    o.params['!person_id_name'] = '';\n    \n    // set more here\n}\n"
103                                             },
104                                             "*prop": "store",
105                                             "remoteSort": true,
106                                             "xtype": "Store",
107                                             "|sortInfo": "{ direction : 'ASC', field: 'person_id_name' }",
108                                             "|xns": "Roo.data",
109                                             "items": [
110                                                 {
111                                                     "*prop": "proxy",
112                                                     "xtype": "HttpProxy",
113                                                     "method": "GET",
114                                                     "|xns": "Roo.data",
115                                                     "|url": "baseURL + '/Roo/core_notify.php'"
116                                                 },
117                                                 {
118                                                     "*prop": "reader",
119                                                     "xtype": "JsonReader",
120                                                     "|xns": "Roo.data",
121                                                     "id": "id",
122                                                     "root": "data",
123                                                     "totalProperty": "total",
124                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ontable\",\"type\":\"string\"}]"
125                                                 }
126                                             ]
127                                         }
128                                     ]
129                                 },
130                                 {
131                                     "|xns": "Roo.Toolbar",
132                                     "xtype": "Fill"
133                                 },
134                                 {
135                                     "listeners": {
136                                         "|click": "function()\n        {\n        Pman.genericDelete(_this, 'core_notify'); \n        }\n        "
137                                     },
138                                     "cls": "x-btn-text-icon",
139                                     "text": "Delete",
140                                     "xtype": "Button",
141                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
142                                     "|xns": "Roo.Toolbar"
143                                 },
144                                 {
145                                     "listeners": {
146                                         "render": "function (_self)\n{\n    _this.toggleBtn = _self;\n}",
147                                         "toggle": "function (_self, pressed)\n{\n    this.setText(pressed ? \"Hide Completed\" : \"Show Completed\");\n    _this.grid.footer.onClick('first');\n}"
148                                     },
149                                     "enableToggle": true,
150                                     "text": "Show Completed",
151                                     "xtype": "Button",
152                                     "|xns": "Roo.Toolbar"
153                                 }
154                             ]
155                         },
156                         {
157                             "*prop": "colModel[]",
158                             "dataIndex": "id",
159                             "header": "id#",
160                             "sortable": true,
161                             "width": 50,
162                             "xtype": "ColumnModel",
163                             "|renderer": "function(v) { return String.format('{0}', v ); }",
164                             "|xns": "Roo.grid"
165                         },
166                         {
167                             "*prop": "colModel[]",
168                             "dataIndex": "evtype",
169                             "header": "Method",
170                             "sortable": true,
171                             "width": 100,
172                             "xtype": "ColumnModel",
173                             "|renderer": "function(v) { return String.format('{0}', v ); }",
174                             "|xns": "Roo.grid"
175                         },
176                         {
177                             "*prop": "colModel[]",
178                             "dataIndex": "act_when",
179                             "header": "Act when",
180                             "sortable": true,
181                             "width": 100,
182                             "xtype": "ColumnModel",
183                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
184                             "|xns": "Roo.grid"
185                         },
186                         {
187                             "*prop": "colModel[]",
188                             "dataIndex": "sent",
189                             "header": "Sent",
190                             "sortable": true,
191                             "width": 100,
192                             "xtype": "ColumnModel",
193                             "|renderer": "function(v,x,r) {\n    if (r.data.event_id *1 == 0) {\n        return '';\n    }\n     return String.format('{0}', v ? v.format('d/M/Y H:i:s') : '');\n  }",
194                             "|xns": "Roo.grid"
195                         },
196                         {
197                             "*prop": "colModel[]",
198                             "dataIndex": "ontable",
199                             "header": "Ontable",
200                             "width": 100,
201                             "xtype": "ColumnModel",
202                             "|renderer": "function(v,x,r) { return String.format('{0}:{1}', v,r.data.onid); }",
203                             "|xns": "Roo.grid"
204                         },
205                         {
206                             "*prop": "colModel[]",
207                             "dataIndex": "person_id_name",
208                             "header": "Who to notify",
209                             "width": 100,
210                             "xtype": "ColumnModel",
211                             "|renderer": "function(v,x,r) {\n     return String.format('{0} <u>&lt;{1}&gt;</u>', v, r.data.person_id_email); \n }",
212                             "|xns": "Roo.grid"
213                         },
214                         {
215                             "*prop": "colModel[]",
216                             "dataIndex": "trigger_event_id",
217                             "header": "Triggered by",
218                             "width": 100,
219                             "xtype": "ColumnModel",
220                             "|renderer": "function(v,x,r) {\n     return String.format(\n            '{0} : {1} {2}', \n            r.data.trigger_event_id_on_table, \n            r.data.trigger_event_id_on_id, \n            r.data.trigger_event_id_remarks\n        ); \n }",
221                             "|xns": "Roo.grid"
222                         },
223                         {
224                             "xtype": "ColumnModel",
225                             "header": "Msgid",
226                             "width": 200,
227                             "dataIndex": "msgid",
228                             "|renderer": "function(v) { return String.format('{0}', v); }",
229                             "|xns": "Roo.grid",
230                             "*prop": "colModel[]"
231                         },
232                         {
233                             "*prop": "colModel[]",
234                             "dataIndex": "event_id_remarks",
235                             "header": "Event",
236                             "width": 300,
237                             "xtype": "ColumnModel",
238                             "|renderer": "function(v) { return String.format('<span qtip=\"{0}\">{0}</span>', v); }",
239                             "|xns": "Roo.grid"
240                         }
241                     ]
242                 }
243             ]
244         }
245     ],
246     "permname": "",
247     "modOrder": "001"
248 }