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");
109 beforeload : function (_self, o)
114 o.params = Roo.apply(o.params, {
115 person_id : _this.data.person_id,
116 onid : _this.data.onid,
117 ontable : _this.data.ontable,
118 method : _this.data.method
124 sortInfo : { field : 'freq', direction: 'ASC' },
129 url : baseURL + '/Roo/core_notify_recur.php'
136 totalProperty : 'total',
149 'dateFormat': 'Y-m-d'
154 'dateFormat': 'Y-m-d'
161 'name': 'last_applied_dt',
163 'dateFormat': 'Y-m-d'
178 'name': 'last_event_id',
189 xtype: 'PagingToolbar',
193 displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
194 emptyMsg : "No core_notify_recur found"
206 var grid = _this.grid;
207 var r = grid.getDataSource().reader.newRow({
209 person_id : _this.data.person_id,
210 dtstart : new Date(0),
211 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
212 tz : 'Asia/Hong Kong',
213 onid : _this.data.onid,
214 ontable : _this.data.ontable,
215 method : _this.data.method,
224 grid.getDataSource().insert(0, r);
225 grid.startEditing(0, 2);
230 cls : 'x-btn-text-icon',
232 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
242 cls : 'x-btn-text-icon',
243 icon : rootURL + '/Pman/templates/images/trash.gif',
247 Pman.genericDelete(_this, 'core_notify_recur');
255 xtype: 'ColumnModel',
257 dataIndex : 'dtstart',
260 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
271 xtype: 'ColumnModel',
276 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
287 xtype: 'ColumnModel',
289 dataIndex : 'freq_day',
290 header : 'on day(s)',
292 renderer : function(v,x,r) {
294 return String.format('{0}', r.data.freq_day_name || v);
304 displayField : 'title',
306 fieldLabel : 'Country',
307 hiddenName : 'freq_day',
310 name : 'freq_day_name',
312 triggerAction : 'all',
315 xtype: 'SimpleStore',
319 Roo.each(Date.dayNames, function(d) {
320 ret.push([ d.substring(0,3).toUpperCase(), d ]);
324 fields : ['code', 'title'],
325 sortInfo : { field : 'title', direction: 'ASC' }
331 xtype: 'ColumnModel',
333 dataIndex : 'freq_hour',
334 header : 'at Hour(s)',
336 renderer : function(v,x,r) {
338 return String.format('{0}', r.data.freq_hour_name || v);
348 displayField : 'title',
350 fieldLabel : 'Country',
351 hiddenName : 'freq_hour',
354 name : 'freq_hour_name',
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 < 13 ? 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); },
392 allowBlank : 'false',
395 emptyText : "Select timezone",
396 fieldLabel : 'core_enum',
397 forceSelection : true,
400 loadingText : "Searching...",
404 qtip : "Select timezone",
406 selectOnFocus : true,
407 tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
408 triggerAction : 'all',
416 beforeload : function (_self, o){
417 o.params = o.params || {};
422 sortInfo : { direction : 'ASC', field: 'tz' },
427 url : baseURL + '/Core/I18n/Timezone.php'
434 totalProperty : 'total',
435 fields : [{"name":"tz","type":"string"}]
442 xtype: 'ColumnModel',
444 header : 'Last event',
446 dataIndex : 'last_event_id',
447 renderer : function(v) { return String.format('{0}', v); }
454 xtype: 'LayoutRegion',