1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CoreNotifyRefer = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
36 title : "Modify Recurrent Notifications",
43 activate : function() {
46 _this.grid.footer.onClick('first');
54 tableName : 'core_notify_recur',
55 title : "core_notify_recur",
63 //_this.dialog = Pman.Dialog.FILL_IN
64 if (_this.panel.active) {
65 this.footer.onClick('first');
68 rowdblclick : function (_self, rowIndex, e)
70 if (!_this.dialog) return;
71 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
72 _this.grid.footer.onClick('first');
76 autoExpandColumn : 'freq_day',
83 sortInfo : { field : 'freq', direction: 'ASC' },
88 url : baseURL + '/Roo/core_notify_recur.php'
95 totalProperty : 'total',
108 'dateFormat': 'Y-m-d'
113 'dateFormat': 'Y-m-d'
120 'name': 'last_applied_dt',
122 'dateFormat': 'Y-m-d'
137 'name': 'last_event_id',
148 xtype: 'PagingToolbar',
152 displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
153 emptyMsg : "No core_notify_recur found"
165 var grid = _this.grid;
166 var r = grid.getDataSource().reader.newRow({
168 person_id : _this.data.person_id,
169 dtstart : new Date(0),
170 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
171 tz : 'Asia/Hong Kong',
172 onid : _this.data.onid,
173 ontable : _this.data.ontable,
174 method : _this.data.method,
183 grid.getDataSource().insert(0, r);
184 grid.startEditing(0, 2);
188 cls : 'x-btn-text-icon',
190 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
200 cls : 'x-btn-text-icon',
201 icon : rootURL + '/Pman/templates/images/trash.gif',
205 Pman.genericDelete(_this, 'core_notify_recur');
213 xtype: 'ColumnModel',
215 dataIndex : 'dtstart',
218 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
229 xtype: 'ColumnModel',
234 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
245 xtype: 'ColumnModel',
248 header : 'Frequency',
250 renderer : function(v,x,r) {
253 var cm = _this.grid.colModel;
254 var ix = cm.findColumnIndex('freq');
255 var ce = cm.getCellEditor(ix)
256 var matches = ce.field.store.query('code',v);
257 if (!matches.length) {
260 return String.format('{0}', matches.first().data.title);
269 displayField : 'title',
271 fieldLabel : 'Country',
276 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
277 triggerAction : 'all',
281 xtype: 'SimpleStore',
284 [ 'HOURLY' , 'Hourly at' ] ,
285 [ 'DAILY' , 'Daily at'] ,
286 [ 'WEEKLY' , 'Weekly at'] ,
287 [ 'Montly' , 'Montly at']
289 fields : ['code', 'title'],
290 sortInfo : { field : 'title', direction: 'ASC' }
296 xtype: 'ColumnModel',
298 dataIndex : 'freq_day',
299 header : 'on day(s)',
301 renderer : function(v) { return String.format('{0}', v); },
309 displayField : 'title',
311 fieldLabel : 'Country',
312 hiddenName : 'freq_day',
315 name : 'freq_day_name',
317 triggerAction : 'all',
320 xtype: 'SimpleStore',
324 Roo.each(Date.dayNames, function(d) {
325 ret.push([ d.substring(0,3).toUpperCase(), d ]);
329 fields : ['code', 'title'],
330 sortInfo : { field : 'title', direction: 'ASC' }
336 xtype: 'ColumnModel',
338 dataIndex : 'freq_hour',
339 header : 'at Hour(s)',
341 renderer : function(v) { return String.format('{0}', v); },
349 displayField : 'title',
351 fieldLabel : 'Country',
352 hiddenName : 'freq_hour',
355 name : 'freq_hour_name',
357 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
358 triggerAction : 'all',
361 xtype: 'SimpleStore',
365 for (var i = 5; i < 25; i++) {
366 var h = i < 10 ? ('0' + i) : i;
367 var mer = i < 12 || i > 23 ? 'am' : 'pm';
368 var dh = i < 12 ? i : i-12;
370 ret.push([ h+':00', dh+':00' + mer ]);
371 ret.push([ h+':00', dh+':30' + mer ]);
375 fields : ['code', 'title'],
376 sortInfo : { field : 'title', direction: 'ASC' }
382 xtype: 'ColumnModel',
387 renderer : function(v) { return String.format('{0}', v); }
390 xtype: 'ColumnModel',
392 header : 'Last event',
394 dataIndex : 'last_event_id',
395 renderer : function(v) { return String.format('{0}', v); }
402 xtype: 'LayoutRegion',