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',
34 show : function (_self)
36 _this.grid.ds.load({});
42 title : "Modify Recurrent Notifications",
49 activate : function() {
52 // _this.grid.footer.onClick('first');
60 tableName : 'core_notify_recur',
61 title : "core_notify_recur",
69 //_this.dialog = Pman.Dialog.FILL_IN
70 if (_this.panel.active) {
71 // this.footer.onClick('first');
74 rowdblclick : function (_self, rowIndex, e)
76 if (!_this.dialog) return;
77 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
78 _this.grid.footer.onClick('first');
81 afteredit : function (e)
86 autoExpandColumn : 'freq_day',
93 update : function (_self, record, operation)
96 if (operation != 'commit') {
100 url : baseURL + '/Roo/Core_notify_recur',
102 params : record.data,
107 failure : function() {
108 Roo.MessageBox.alert("Error", "There was a problem saving");
115 beforeload : function (_self, o)
120 o.params = Roo.apply(o.params || {}, {
121 person_id : _this.data.person_id,
122 onid : _this.data.onid,
123 ontable : _this.data.ontable,
124 method : _this.data.method
130 sortInfo : { field : 'freq', direction: 'ASC' },
135 url : baseURL + '/Roo/core_notify_recur.php'
142 totalProperty : 'total',
155 'dateFormat': 'Y-m-d'
160 'dateFormat': 'Y-m-d'
167 'name': 'last_applied_dt',
169 'dateFormat': 'Y-m-d'
184 'name': 'last_event_id',
204 var grid = _this.grid;
205 var r = grid.getDataSource().reader.newRow({
207 person_id : _this.data.person_id,
208 dtstart : new Date(0),
209 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
210 tz : 'Asia/Hong Kong',
211 onid : _this.data.onid,
212 ontable : _this.data.ontable,
213 method : _this.data.method,
222 grid.getDataSource().insert(0, r);
223 grid.startEditing(0, 2);
228 cls : 'x-btn-text-icon',
230 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
240 cls : 'x-btn-text-icon',
241 icon : rootURL + '/Pman/templates/images/trash.gif',
245 Pman.genericDelete(_this, 'core_notify_recur');
253 xtype: 'ColumnModel',
255 dataIndex : 'dtstart',
258 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
269 xtype: 'ColumnModel',
274 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
285 xtype: 'ColumnModel',
287 dataIndex : 'freq_day',
288 header : 'on day(s)',
290 renderer : function(v,x,r) {
292 return String.format('{0}', r.data.freq_day_name || v);
302 displayField : 'title',
304 fieldLabel : 'Country',
305 hiddenName : 'freq_day',
308 name : 'freq_day_name',
310 triggerAction : 'all',
313 xtype: 'SimpleStore',
317 Roo.each(Date.dayNames, function(d) {
318 ret.push([ d.substring(0,3).toUpperCase(), d ]);
322 fields : ['code', 'title'],
323 sortInfo : { field : 'title', direction: 'ASC' }
329 xtype: 'ColumnModel',
331 dataIndex : 'freq_hour',
332 header : 'at Hour(s)',
334 renderer : function(v,x,r) {
339 var cm = _this.grid.colModel;
341 var ci = cm.getColumnByDataIndex(this.name);
344 var ce = cm.getCellEditor(ci);
346 ce.field.setValue(v);
347 return String.format('{0}',ce.field.el.value);
353 return String.format('{0}', r.data.freq_hour_name || v);
363 displayField : 'title',
365 fieldLabel : 'Country',
366 hiddenName : 'freq_hour',
369 name : 'freq_hour_name',
371 triggerAction : 'all',
374 xtype: 'SimpleStore',
378 for (var i = 5; i < 25; i++) {
379 var h = i < 10 ? ('0' + i) : i;
380 var mer = i < 12 || i > 23 ? 'am' : 'pm';
381 var dh = i < 13 ? i : i-12;
383 ret.push([ h+':00', dh+':00' + mer ]);
384 ret.push([ h+':00', dh+':30' + mer ]);
388 fields : ['code', 'title'],
389 sortInfo : { field : 'title', direction: 'ASC' }
395 xtype: 'ColumnModel',
400 renderer : function(v) { return String.format('{0}', v); },
407 allowBlank : 'false',
410 emptyText : "Select timezone",
411 fieldLabel : 'core_enum',
412 forceSelection : true,
415 loadingText : "Searching...",
419 qtip : "Select timezone",
421 selectOnFocus : true,
422 tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
423 triggerAction : 'all',
431 beforeload : function (_self, o){
432 o.params = o.params || {};
437 sortInfo : { direction : 'ASC', field: 'tz' },
442 url : baseURL + '/Core/I18n/Timezone.php'
449 totalProperty : 'total',
450 fields : [{"name":"tz","type":"string"}]
457 xtype: 'ColumnModel',
459 header : 'Last event',
461 dataIndex : 'last_event_id',
462 renderer : function(v) { return String.format('{0}', v); }
469 xtype: 'LayoutRegion',
479 click : function (_self, e)