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