1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CoreNotifyRecur = {
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');
75 afteredit : function (e)
80 autoExpandColumn : 'freq_day',
87 update : function (_self, record, operation)
90 if (operation != 'commit') {
94 url : baseURL + '/Roo/Core_notify_recur',
101 failure : function() {
102 Roo.MessageBox.alert("Error", "There was a problem saving");
111 sortInfo : { field : 'freq', direction: 'ASC' },
116 url : baseURL + '/Roo/core_notify_recur.php'
123 totalProperty : 'total',
136 'dateFormat': 'Y-m-d'
141 'dateFormat': 'Y-m-d'
148 'name': 'last_applied_dt',
150 'dateFormat': 'Y-m-d'
165 'name': 'last_event_id',
176 xtype: 'PagingToolbar',
180 displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
181 emptyMsg : "No core_notify_recur found"
193 var grid = _this.grid;
194 var r = grid.getDataSource().reader.newRow({
196 person_id : _this.data.person_id,
197 dtstart : new Date(0),
198 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
199 tz : 'Asia/Hong Kong',
200 onid : _this.data.onid,
201 ontable : _this.data.ontable,
202 method : _this.data.method,
211 grid.getDataSource().insert(0, r);
212 grid.startEditing(0, 2);
216 cls : 'x-btn-text-icon',
218 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
228 cls : 'x-btn-text-icon',
229 icon : rootURL + '/Pman/templates/images/trash.gif',
233 Pman.genericDelete(_this, 'core_notify_recur');
241 xtype: 'ColumnModel',
243 dataIndex : 'dtstart',
246 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
257 xtype: 'ColumnModel',
262 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
273 xtype: 'ColumnModel',
276 header : 'Frequency',
278 renderer : function(v,x,r) {
281 var cm = _this.grid.colModel;
282 var ix = cm.findColumnIndex('freq');
283 var ce = cm.getCellEditor(ix)
284 var matches = ce.field.store.query('code',v);
285 if (!matches.length) {
288 return String.format('{0}', matches.first().data.title);
297 displayField : 'title',
299 fieldLabel : 'Country',
304 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
305 triggerAction : 'all',
309 xtype: 'SimpleStore',
312 [ 'HOURLY' , 'Hourly at' ] ,
313 [ 'DAILY' , 'Daily at'] ,
314 [ 'WEEKLY' , 'Weekly at'] ,
315 [ 'Montly' , 'Montly at']
317 fields : ['code', 'title'],
318 sortInfo : { field : 'title', direction: 'ASC' }
324 xtype: 'ColumnModel',
326 dataIndex : 'freq_day',
327 header : 'on day(s)',
329 renderer : function(v,x,r) {
331 return String.format('{0}', r.data.freq_day_name || v);
341 displayField : 'title',
343 fieldLabel : 'Country',
344 hiddenName : 'freq_day',
347 name : 'freq_day_name',
349 triggerAction : 'all',
352 xtype: 'SimpleStore',
356 Roo.each(Date.dayNames, function(d) {
357 ret.push([ d.substring(0,3).toUpperCase(), d ]);
361 fields : ['code', 'title'],
362 sortInfo : { field : 'title', direction: 'ASC' }
368 xtype: 'ColumnModel',
370 dataIndex : 'freq_hour',
371 header : 'at Hour(s)',
373 renderer : function(v,x,r) {
375 return String.format('{0}', r.data.freq_hour_name || v);
385 displayField : 'title',
387 fieldLabel : 'Country',
388 hiddenName : 'freq_hour',
391 name : 'freq_hour_name',
393 triggerAction : 'all',
396 xtype: 'SimpleStore',
400 for (var i = 5; i < 25; i++) {
401 var h = i < 10 ? ('0' + i) : i;
402 var mer = i < 12 || i > 23 ? 'am' : 'pm';
403 var dh = i < 13 ? i : i-12;
405 ret.push([ h+':00', dh+':00' + mer ]);
406 ret.push([ h+':00', dh+':30' + mer ]);
410 fields : ['code', 'title'],
411 sortInfo : { field : 'title', direction: 'ASC' }
417 xtype: 'ColumnModel',
422 renderer : function(v) { return String.format('{0}', v); }
425 xtype: 'ColumnModel',
427 header : 'Last event',
429 dataIndex : 'last_event_id',
430 renderer : function(v) { return String.format('{0}', v); }
437 xtype: 'LayoutRegion',