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}"
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                                     },
78                                     "allowBlank": true,
79                                     "displayField": "person_id_name",
80                                     "editable": true,
81                                     "emptyText": "Select person",
82                                     "forceSelection": true,
83                                     "hiddenName": "id",
84                                     "listWidth": 400,
85                                     "loadingText": "Searching...",
86                                     "minChars": 2,
87                                     "name": "name",
88                                     "pageSize": 20,
89                                     "qtip": "Select core_notify",
90                                     "queryParam": "query[person_id_name]",
91                                     "selectOnFocus": true,
92                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{person_id_name}</b> {person_id_email}</div>",
93                                     "triggerAction": "all",
94                                     "valueField": "person_id",
95                                     "width": 300,
96                                     "xtype": "ComboBox",
97                                     "|xns": "Roo.form",
98                                     "items": [
99                                         {
100                                             "listeners": {
101                                                 "|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"
102                                             },
103                                             "*prop": "store",
104                                             "remoteSort": true,
105                                             "xtype": "Store",
106                                             "|sortInfo": "{ direction : 'ASC', field: 'person_id_name' }",
107                                             "|xns": "Roo.data",
108                                             "items": [
109                                                 {
110                                                     "*prop": "proxy",
111                                                     "xtype": "HttpProxy",
112                                                     "method": "GET",
113                                                     "|xns": "Roo.data",
114                                                     "|url": "baseURL + '/Roo/core_notify.php'"
115                                                 },
116                                                 {
117                                                     "*prop": "reader",
118                                                     "xtype": "JsonReader",
119                                                     "|xns": "Roo.data",
120                                                     "id": "id",
121                                                     "root": "data",
122                                                     "totalProperty": "total",
123                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ontable\",\"type\":\"string\"}]"
124                                                 }
125                                             ]
126                                         }
127                                     ]
128                                 },
129                                 {
130                                     "|xns": "Roo.Toolbar",
131                                     "xtype": "Fill"
132                                 },
133                                 {
134                                     "listeners": {
135                                         "|click": "function()\n        {\n        Pman.genericDelete(_this, 'core_notify'); \n        }\n        "
136                                     },
137                                     "cls": "x-btn-text-icon",
138                                     "text": "Delete",
139                                     "xtype": "Button",
140                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
141                                     "|xns": "Roo.Toolbar"
142                                 },
143                                 {
144                                     "listeners": {
145                                         "render": "function (_self)\n{\n    _this.toggleBtn = _self;\n}",
146                                         "toggle": "function (_self, pressed)\n{\n    this.setText(pressed ? \"Hide Completed\" : \"Show Completed\");\n    _this.grid.footer.onClick('first');\n}"
147                                     },
148                                     "enableToggle": true,
149                                     "text": "Show Completed",
150                                     "xtype": "Button",
151                                     "|xns": "Roo.Toolbar"
152                                 }
153                             ]
154                         },
155                         {
156                             "*prop": "colModel[]",
157                             "dataIndex": "id",
158                             "header": "id#",
159                             "sortable": true,
160                             "width": 50,
161                             "xtype": "ColumnModel",
162                             "|renderer": "function(v) { return String.format('{0}', v ); }",
163                             "|xns": "Roo.grid"
164                         },
165                         {
166                             "*prop": "colModel[]",
167                             "dataIndex": "evtype",
168                             "header": "Method",
169                             "sortable": true,
170                             "width": 100,
171                             "xtype": "ColumnModel",
172                             "|renderer": "function(v) { return String.format('{0}', v ); }",
173                             "|xns": "Roo.grid"
174                         },
175                         {
176                             "*prop": "colModel[]",
177                             "dataIndex": "act_when",
178                             "header": "Act when",
179                             "sortable": true,
180                             "width": 100,
181                             "xtype": "ColumnModel",
182                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
183                             "|xns": "Roo.grid"
184                         },
185                         {
186                             "*prop": "colModel[]",
187                             "dataIndex": "sent",
188                             "header": "Sent",
189                             "sortable": true,
190                             "width": 100,
191                             "xtype": "ColumnModel",
192                             "|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  }",
193                             "|xns": "Roo.grid"
194                         },
195                         {
196                             "*prop": "colModel[]",
197                             "dataIndex": "ontable",
198                             "header": "Ontable",
199                             "width": 100,
200                             "xtype": "ColumnModel",
201                             "|renderer": "function(v,x,r) { return String.format('{0}:{1}', v,r.data.onid); }",
202                             "|xns": "Roo.grid"
203                         },
204                         {
205                             "*prop": "colModel[]",
206                             "dataIndex": "person_id_name",
207                             "header": "Who to notify",
208                             "width": 100,
209                             "xtype": "ColumnModel",
210                             "|renderer": "function(v,x,r) {\n     return String.format('{0} <u>&lt;{1}&gt;</u>', v, r.data.person_id_email); \n }",
211                             "|xns": "Roo.grid"
212                         },
213                         {
214                             "*prop": "colModel[]",
215                             "dataIndex": "trigger_event_id",
216                             "header": "Triggered by",
217                             "width": 100,
218                             "xtype": "ColumnModel",
219                             "|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 }",
220                             "|xns": "Roo.grid"
221                         },
222                         {
223                             "xtype": "ColumnModel",
224                             "header": "Msgid",
225                             "width": 200,
226                             "dataIndex": "msgid",
227                             "|renderer": "function(v) { return String.format('{0}', v); }",
228                             "|xns": "Roo.grid",
229                             "*prop": "colModel[]"
230                         },
231                         {
232                             "*prop": "colModel[]",
233                             "dataIndex": "event_id_remarks",
234                             "header": "Event",
235                             "width": 300,
236                             "xtype": "ColumnModel",
237                             "|renderer": "function(v) { return String.format('<span qtip=\"{0}\">{0}</span>', v); }",
238                             "|xns": "Roo.grid"
239                         }
240                     ]
241                 }
242             ]
243         }
244     ],
245     "permname": "",
246     "modOrder": "001"
247 }