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);
217 cls : 'x-btn-text-icon',
219 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
229 cls : 'x-btn-text-icon',
230 icon : rootURL + '/Pman/templates/images/trash.gif',
234 Pman.genericDelete(_this, 'core_notify_recur');
242 xtype: 'ColumnModel',
244 dataIndex : 'dtstart',
247 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
258 xtype: 'ColumnModel',
263 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
274 xtype: 'ColumnModel',
277 header : 'Frequency',
279 renderer : function(v,x,r) {
282 var cm = _this.grid.colModel;
283 var ix = cm.findColumnIndex('freq');
284 var ce = cm.getCellEditor(ix)
285 var matches = ce.field.store.query('code',v);
286 if (!matches.length) {
289 return String.format('{0}', matches.first().data.title);
298 displayField : 'title',
300 fieldLabel : 'Country',
305 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
306 triggerAction : 'all',
310 xtype: 'SimpleStore',
313 [ 'HOURLY' , 'Hourly at' ] ,
314 [ 'DAILY' , 'Daily at'] ,
315 [ 'WEEKLY' , 'Weekly at'] ,
316 [ 'Montly' , 'Montly at']
318 fields : ['code', 'title'],
319 sortInfo : { field : 'title', direction: 'ASC' }
325 xtype: 'ColumnModel',
327 dataIndex : 'freq_day',
328 header : 'on day(s)',
330 renderer : function(v,x,r) {
332 return String.format('{0}', r.data.freq_day_name || v);
342 displayField : 'title',
344 fieldLabel : 'Country',
345 hiddenName : 'freq_day',
348 name : 'freq_day_name',
350 triggerAction : 'all',
353 xtype: 'SimpleStore',
357 Roo.each(Date.dayNames, function(d) {
358 ret.push([ d.substring(0,3).toUpperCase(), d ]);
362 fields : ['code', 'title'],
363 sortInfo : { field : 'title', direction: 'ASC' }
369 xtype: 'ColumnModel',
371 dataIndex : 'freq_hour',
372 header : 'at Hour(s)',
374 renderer : function(v,x,r) {
376 return String.format('{0}', r.data.freq_hour_name || v);
386 displayField : 'title',
388 fieldLabel : 'Country',
389 hiddenName : 'freq_hour',
392 name : 'freq_hour_name',
394 triggerAction : 'all',
397 xtype: 'SimpleStore',
401 for (var i = 5; i < 25; i++) {
402 var h = i < 10 ? ('0' + i) : i;
403 var mer = i < 12 || i > 23 ? 'am' : 'pm';
404 var dh = i < 13 ? i : i-12;
406 ret.push([ h+':00', dh+':00' + mer ]);
407 ret.push([ h+':00', dh+':30' + mer ]);
411 fields : ['code', 'title'],
412 sortInfo : { field : 'title', direction: 'ASC' }
418 xtype: 'ColumnModel',
423 renderer : function(v) { return String.format('{0}', v); },
431 allowBlank : 'false',
433 emptyText : "Select timezone",
434 fieldLabel : 'core_enum',
435 forceSelection : true,
438 loadingText : "Searching...",
442 qtip : "Select timezone",
443 selectOnFocus : true,
444 tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
445 triggerAction : 'all',
453 sortInfo : { direction : 'ASC', field: 'id' },
455 beforeload : function (_self, o){
456 o.params = o.params || {};
464 url : baseURL + '/Roo/core_enum.php'
471 totalProperty : 'total',
472 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
481 displayField : 'title',
483 fieldLabel : 'Country',
488 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
489 triggerAction : 'all',
493 xtype: 'SimpleStore',
496 [ 'HOURLY' , 'Hourly at' ] ,
497 [ 'DAILY' , 'Daily at'] ,
498 [ 'WEEKLY' , 'Weekly at'] ,
499 [ 'Montly' , 'Montly at']
501 fields : ['code', 'title'],
502 sortInfo : { field : 'title', direction: 'ASC' }
508 xtype: 'ColumnModel',
510 header : 'Last event',
512 dataIndex : 'last_event_id',
513 renderer : function(v) { return String.format('{0}', v); }
520 xtype: 'LayoutRegion',