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',
195 xtype: 'PagingToolbar',
199 displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
200 emptyMsg : "No core_notify_recur found"
212 var grid = _this.grid;
213 var r = grid.getDataSource().reader.newRow({
215 person_id : _this.data.person_id,
216 dtstart : new Date(0),
217 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
218 tz : 'Asia/Hong Kong',
219 onid : _this.data.onid,
220 ontable : _this.data.ontable,
221 method : _this.data.method,
230 grid.getDataSource().insert(0, r);
231 grid.startEditing(0, 2);
236 cls : 'x-btn-text-icon',
238 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
248 cls : 'x-btn-text-icon',
249 icon : rootURL + '/Pman/templates/images/trash.gif',
253 Pman.genericDelete(_this, 'core_notify_recur');
261 xtype: 'ColumnModel',
263 dataIndex : 'dtstart',
266 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
277 xtype: 'ColumnModel',
282 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
293 xtype: 'ColumnModel',
295 dataIndex : 'freq_day',
296 header : 'on day(s)',
298 renderer : function(v,x,r) {
300 return String.format('{0}', r.data.freq_day_name || v);
310 displayField : 'title',
312 fieldLabel : 'Country',
313 hiddenName : 'freq_day',
316 name : 'freq_day_name',
318 triggerAction : 'all',
321 xtype: 'SimpleStore',
325 Roo.each(Date.dayNames, function(d) {
326 ret.push([ d.substring(0,3).toUpperCase(), d ]);
330 fields : ['code', 'title'],
331 sortInfo : { field : 'title', direction: 'ASC' }
337 xtype: 'ColumnModel',
339 dataIndex : 'freq_hour',
340 header : 'at Hour(s)',
342 renderer : function(v,x,r) {
344 return String.format('{0}', r.data.freq_hour_name || v);
354 displayField : 'title',
356 fieldLabel : 'Country',
357 hiddenName : 'freq_hour',
360 name : 'freq_hour_name',
362 triggerAction : 'all',
365 xtype: 'SimpleStore',
369 for (var i = 5; i < 25; i++) {
370 var h = i < 10 ? ('0' + i) : i;
371 var mer = i < 12 || i > 23 ? 'am' : 'pm';
372 var dh = i < 13 ? i : i-12;
374 ret.push([ h+':00', dh+':00' + mer ]);
375 ret.push([ h+':00', dh+':30' + mer ]);
379 fields : ['code', 'title'],
380 sortInfo : { field : 'title', direction: 'ASC' }
386 xtype: 'ColumnModel',
391 renderer : function(v) { return String.format('{0}', v); },
398 allowBlank : 'false',
401 emptyText : "Select timezone",
402 fieldLabel : 'core_enum',
403 forceSelection : true,
406 loadingText : "Searching...",
410 qtip : "Select timezone",
412 selectOnFocus : true,
413 tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
414 triggerAction : 'all',
422 beforeload : function (_self, o){
423 o.params = o.params || {};
428 sortInfo : { direction : 'ASC', field: 'tz' },
433 url : baseURL + '/Core/I18n/Timezone.php'
440 totalProperty : 'total',
441 fields : [{"name":"tz","type":"string"}]
448 xtype: 'ColumnModel',
450 header : 'Last event',
452 dataIndex : 'last_event_id',
453 renderer : function(v) { return String.format('{0}', v); }
460 xtype: 'LayoutRegion',