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,
180 grid.getDataSource().insert(0, r);
181 grid.startEditing(0, 2);
185 cls : 'x-btn-text-icon',
187 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
197 cls : 'x-btn-text-icon',
198 icon : rootURL + '/Pman/templates/images/trash.gif',
202 Pman.genericDelete(_this, 'core_notify_recur');
210 xtype: 'ColumnModel',
212 dataIndex : 'dtstart',
215 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
226 xtype: 'ColumnModel',
231 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
242 xtype: 'ColumnModel',
245 header : 'Frequency',
247 renderer : function(v,x,r) {
250 var cm = _this.grid.colModel;
251 var ix = cm.findColumnIndex('freq');
252 var ce = cm.getCellEditor(ix)
253 var matches = ce.field.store.query('code',v);
254 if (!matches.length) {
257 return String.format('{0}', matches.first().data.title);
266 displayField : 'title',
268 fieldLabel : 'Country',
273 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
274 triggerAction : 'all',
278 xtype: 'SimpleStore',
281 [ 'HOURLY' , 'Hourly at' ] ,
282 [ 'DAILY' , 'Daily at'] ,
283 [ 'WEEKLY' , 'Weekly at'] ,
284 [ 'Montly' , 'Montly at']
286 fields : ['code', 'title'],
287 sortInfo : { field : 'title', direction: 'ASC' }
293 xtype: 'ColumnModel',
295 dataIndex : 'freq_day',
296 header : 'on day(s)',
298 renderer : function(v) { return String.format('{0}', v); },
306 displayField : 'title',
308 fieldLabel : 'Country',
314 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
315 triggerAction : 'all',
318 xtype: 'SimpleStore',
322 Roo.each(Date.dayNames, function(d) {
323 ret.push([ d.substring(0,3).toUpperCase(), d ]);
327 fields : ['code', 'title'],
328 sortInfo : { field : 'title', direction: 'ASC' }
334 xtype: 'ColumnModel',
336 dataIndex : 'freq_hour',
337 header : 'at Hour(s)',
339 renderer : function(v) { return String.format('{0}', v); },
347 displayField : 'title',
349 fieldLabel : 'Country',
353 name : 'freq_hour_name',
355 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
356 triggerAction : 'all',
359 xtype: 'SimpleStore',
363 for (var i = 5; i < 25; i++) {
364 var h = i < 10 ? ('0' + i) : i;
365 var mer = i < 12 || i > 23 ? 'am' : 'pm';
366 var dh = i < 12 ? i : i-12;
368 ret.push([ h+':00', dh+':00' + mer ]);
369 ret.push([ h+':00', dh+':30' + mer ]);
373 fields : ['code', 'title'],
374 sortInfo : { field : 'title', direction: 'ASC' }
380 xtype: 'ColumnModel',
385 renderer : function(v) { return String.format('{0}', v); }
388 xtype: 'ColumnModel',
390 header : 'Last event',
392 dataIndex : 'last_event_id',
393 renderer : function(v) { return String.format('{0}', v); }
400 xtype: 'LayoutRegion',