Pman.Tab.AdminNotifyRecur.bjs
[Pman.Admin] / Pman.Tab.AdminNotifyRecur.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Tab.AdminNotifyRecur = new Roo.XComponent({
6     part     :  ["Admin","NotifyRecur"],
7     order    : '800-Pman.Tab.AdminNotifyRecur',
8     region   : 'center',
9     parent   : 'Pman.Tab.AdminWatchNotify',
10     name     : "Pman.Tab.AdminNotifyRecur",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         var _this = this;
16         var MODULE = this;
17         return {
18             xtype: 'GridPanel',
19             xns: Roo,
20             listeners : {
21                 activate : function() {
22                     _this.panel = this;
23                     if (_this.grid) {
24                         _this.grid.footer.onClick('first');
25                     }
26                 }
27             },
28             background : true,
29             fitContainer : true,
30             fitToframe : true,
31             region : 'center',
32             tableName : 'core_notify_recur',
33             title : "Recurrent Notifications",
34             grid : {
35                 xtype: 'Grid',
36                 xns: Roo.grid,
37                 listeners : {
38                     render : function() 
39                     {
40                         _this.grid = this; 
41                         //_this.dialog = Pman.Dialog.FILL_IN
42                         if (_this.panel.active) {
43                            this.footer.onClick('first');
44                         }
45                     },
46                     rowdblclick : function (_self, rowIndex, e)
47                     {
48                         if (!_this.dialog) return;
49                         _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
50                             _this.grid.footer.onClick('first');
51                         }); 
52                     }
53                 },
54                 autoExpandColumn : 'person_id_name',
55                 loadMask : true,
56                 toolbar : {
57                     xtype: 'Toolbar',
58                     xns: Roo,
59                     items : [
60                         {
61                             xtype: 'ComboBox',
62                             xns: Roo.form,
63                             listeners : {
64                                 select : function (combo, record, index)
65                                 {
66                                    (function() { _this.grid.footer.onClick('first'); }).defer(100);
67                                 },
68                                 render : function (_self)
69                                 {
70                                    _this.personCombo = _self;
71                                 }
72                             },
73                             allowBlank : true,
74                             displayField : 'person_id_name',
75                             editable : true,
76                             emptyText : "Select person",
77                             forceSelection : true,
78                             hiddenName : 'id',
79                             listWidth : 400,
80                             loadingText : "Searching...",
81                             minChars : 2,
82                             name : 'name',
83                             pageSize : 20,
84                             qtip : "Select core_notify",
85                             queryParam : 'query[person_id_name]',
86                             selectOnFocus : true,
87                             tpl : '<div class="x-grid-cell-text x-btn button"><b>{person_id_name}</b> {person_id_email}</div>',
88                             triggerAction : 'all',
89                             valueField : 'person_id',
90                             width : 300,
91                             store : {
92                                 xtype: 'Store',
93                                 xns: Roo.data,
94                                 listeners : {
95                                     beforeload : function (_self, o){
96                                         o.params = o.params || {};
97                                         o.params._distinct='person_id';
98                                         o.params._columns='person_id,person_id_name,person_id_email';
99                                         o.params['!person_id_name'] = '';
100                                         
101                                         // set more here
102                                     }
103                                 },
104                                 remoteSort : true,
105                                 sortInfo : { direction : 'ASC', field: 'person_id_name' },
106                                 proxy : {
107                                     xtype: 'HttpProxy',
108                                     xns: Roo.data,
109                                     method : 'GET',
110                                     url : baseURL + '/Roo/core_notify.php'
111                                 },
112                                 reader : {
113                                     xtype: 'JsonReader',
114                                     xns: Roo.data,
115                                     id : 'id',
116                                     root : 'data',
117                                     totalProperty : 'total',
118                                     fields : [{"name":"id","type":"int"},{"name":"ontable","type":"string"}]
119                                 }
120                             }
121                         }
122                     ]
123                 },
124                 dataSource : {
125                     xtype: 'Store',
126                     xns: Roo.data,
127                     remoteSort : true,
128                     sortInfo : { field : 'person_id_name', direction: 'ASC' },
129                     proxy : {
130                         xtype: 'HttpProxy',
131                         xns: Roo.data,
132                         method : 'GET',
133                         url : baseURL + '/Roo/core_notify_recur.php'
134                     },
135                     reader : {
136                         xtype: 'JsonReader',
137                         xns: Roo.data,
138                         totalProperty : 'total',
139                         root : 'data',
140                         id : 'id',
141                         fields : [
142                             {
143                                 'name': 'id',
144                                 'type': 'int'
145                             },
146                             {
147                                 'name': 'person_id',
148                                 'type': 'int'
149                             },
150                             {
151                                 'name': 'dtstart',
152                                 'type': 'date',
153                                 'dateFormat': 'Y-m-d'
154                             },
155                             {
156                                 'name': 'dtend',
157                                 'type': 'date',
158                                 'dateFormat': 'Y-m-d'
159                             },
160                             {
161                                 'name': 'max_applied_dt',
162                                 'type': 'date',
163                                 'dateFormat': 'Y-m-d'
164                             },
165                             {
166                                 'name': 'updated_dt',
167                                 'type': 'date',
168                                 'dateFormat': 'Y-m-d'
169                             },
170                             {
171                                 'name': 'last_applied_dt',
172                                 'type': 'date',
173                                 'dateFormat': 'Y-m-d'
174                             },
175                             {
176                                 'name': 'tz',
177                                 'type': 'string'
178                             },
179                             {
180                                 'name': 'freq',
181                                 'type': 'string'
182                             },
183                             {
184                                 'name': 'freq_day',
185                                 'type': 'string'
186                             },
187                             {
188                                 'name': 'freq_hour',
189                                 'type': 'string'
190                             },
191                             {
192                                 'name': 'onid',
193                                 'type': 'int'
194                             },
195                             {
196                                 'name': 'ontable',
197                                 'type': 'string'
198                             },
199                             {
200                                 'name': 'last_event_id',
201                                 'type': 'int'
202                             },
203                             {
204                                 'name': 'method',
205                                 'type': 'string'
206                             }
207                         ]
208                     }
209                 },
210                 footer : {
211                     xtype: 'PagingToolbar',
212                     xns: Roo,
213                     pageSize : 25,
214                     displayInfo : true,
215                     displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
216                     emptyMsg : "No core_notify_recur found"
217                 },
218                 colModel : [
219                     {
220                         xtype: 'ColumnModel',
221                         xns: Roo.grid,
222                         dataIndex : 'person_id_name',
223                         header : 'Person',
224                         width : 75,
225                         renderer : function(v,x,r) { 
226                             return String.format('{0} <a href="mailto:{1}">{1}</a>', v,r.data.person_id_email); 
227                         }
228                     },
229                     {
230                         xtype: 'ColumnModel',
231                         xns: Roo.grid,
232                         header : 'Dtstart',
233                         width : 75,
234                         dataIndex : 'dtstart',
235                         renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
236                     },
237                     {
238                         xtype: 'ColumnModel',
239                         xns: Roo.grid,
240                         header : 'Dtend',
241                         width : 75,
242                         dataIndex : 'dtend',
243                         renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
244                     },
245                     {
246                         xtype: 'ColumnModel',
247                         xns: Roo.grid,
248                         dataIndex : 'last_applied_dt',
249                         header : 'Last Notification created',
250                         width : 75,
251                         renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
252                     },
253                     {
254                         xtype: 'ColumnModel',
255                         xns: Roo.grid,
256                         dataIndex : 'tz',
257                         header : 'Tz',
258                         width : 50,
259                         renderer : function(v) { return String.format('{0}', v); }
260                     },
261                     {
262                         xtype: 'ColumnModel',
263                         xns: Roo.grid,
264                         dataIndex : 'freq',
265                         header : 'Freq',
266                         width : 100,
267                         renderer : function(v) { return String.format('{0}', v); }
268                     },
269                     {
270                         xtype: 'ColumnModel',
271                         xns: Roo.grid,
272                         dataIndex : 'freq_day',
273                         header : 'Freq day',
274                         width : 100,
275                         renderer : function(v) { return String.format('{0}', v); }
276                     },
277                     {
278                         xtype: 'ColumnModel',
279                         xns: Roo.grid,
280                         header : 'Freq hour',
281                         width : 200,
282                         dataIndex : 'freq_hour',
283                         renderer : function(v) { return String.format('{0}', v); }
284                     },
285                     {
286                         xtype: 'ColumnModel',
287                         xns: Roo.grid,
288                         dataIndex : 'onid',
289                         header : 'Affects',
290                         width : 75,
291                         renderer : function(v,x,r) { return String.format('{1}:{0}', v,r.data.ontable); }
292                     },
293                     {
294                         xtype: 'ColumnModel',
295                         xns: Roo.grid,
296                         dataIndex : 'method',
297                         header : 'Method',
298                         width : 75,
299                         renderer : function(v) { return String.format('{0}', v); }
300                     }
301                 ]
302             }
303         };
304     }
305 });