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)
111 o.params = Roo.apply(o.params, {
112 person_id : _this.data.person_id,
113 onid : _this.data.onid,
114 ontable : _this.data.ontable,
115 method : _this.data.method
121 sortInfo : { field : 'freq', direction: 'ASC' },
126 url : baseURL + '/Roo/core_notify_recur.php'
133 totalProperty : 'total',
146 'dateFormat': 'Y-m-d'
151 'dateFormat': 'Y-m-d'
158 'name': 'last_applied_dt',
160 'dateFormat': 'Y-m-d'
175 'name': 'last_event_id',
186 xtype: 'PagingToolbar',
190 displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
191 emptyMsg : "No core_notify_recur found"
203 var grid = _this.grid;
204 var r = grid.getDataSource().reader.newRow({
206 person_id : _this.data.person_id,
207 dtstart : new Date(0),
208 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
209 tz : 'Asia/Hong Kong',
210 onid : _this.data.onid,
211 ontable : _this.data.ontable,
212 method : _this.data.method,
221 grid.getDataSource().insert(0, r);
222 grid.startEditing(0, 2);
227 cls : 'x-btn-text-icon',
229 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
239 cls : 'x-btn-text-icon',
240 icon : rootURL + '/Pman/templates/images/trash.gif',
244 Pman.genericDelete(_this, 'core_notify_recur');
252 xtype: 'ColumnModel',
254 dataIndex : 'dtstart',
257 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
268 xtype: 'ColumnModel',
273 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
284 xtype: 'ColumnModel',
286 dataIndex : 'freq_day',
287 header : 'on day(s)',
289 renderer : function(v,x,r) {
291 return String.format('{0}', r.data.freq_day_name || v);
301 displayField : 'title',
303 fieldLabel : 'Country',
304 hiddenName : 'freq_day',
307 name : 'freq_day_name',
309 triggerAction : 'all',
312 xtype: 'SimpleStore',
316 Roo.each(Date.dayNames, function(d) {
317 ret.push([ d.substring(0,3).toUpperCase(), d ]);
321 fields : ['code', 'title'],
322 sortInfo : { field : 'title', direction: 'ASC' }
328 xtype: 'ColumnModel',
330 dataIndex : 'freq_hour',
331 header : 'at Hour(s)',
333 renderer : function(v,x,r) {
335 return String.format('{0}', r.data.freq_hour_name || v);
345 displayField : 'title',
347 fieldLabel : 'Country',
348 hiddenName : 'freq_hour',
351 name : 'freq_hour_name',
353 triggerAction : 'all',
356 xtype: 'SimpleStore',
360 for (var i = 5; i < 25; i++) {
361 var h = i < 10 ? ('0' + i) : i;
362 var mer = i < 12 || i > 23 ? 'am' : 'pm';
363 var dh = i < 13 ? i : i-12;
365 ret.push([ h+':00', dh+':00' + mer ]);
366 ret.push([ h+':00', dh+':30' + mer ]);
370 fields : ['code', 'title'],
371 sortInfo : { field : 'title', direction: 'ASC' }
377 xtype: 'ColumnModel',
382 renderer : function(v) { return String.format('{0}', v); },
389 allowBlank : 'false',
392 emptyText : "Select timezone",
393 fieldLabel : 'core_enum',
394 forceSelection : true,
397 loadingText : "Searching...",
401 qtip : "Select timezone",
403 selectOnFocus : true,
404 tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
405 triggerAction : 'all',
413 beforeload : function (_self, o){
414 o.params = o.params || {};
419 sortInfo : { direction : 'ASC', field: 'tz' },
424 url : baseURL + '/Core/I18n/Timezone.php'
431 totalProperty : 'total',
432 fields : [{"name":"tz","type":"string"}]
439 xtype: 'ColumnModel',
441 header : 'Last event',
443 dataIndex : 'last_event_id',
444 renderer : function(v) { return String.format('{0}', v); }
451 xtype: 'LayoutRegion',