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) {
338 var cm = _this.grid.colModel;
340 cm.getColumnByDataIndex('xx');
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',
470 click : function (_self, e)