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");
111 sortInfo : { field : 'freq', direction: 'ASC' },
116 url : baseURL + '/Roo/core_notify_recur.php'
123 totalProperty : 'total',
136 'dateFormat': 'Y-m-d'
141 'dateFormat': 'Y-m-d'
148 'name': 'last_applied_dt',
150 'dateFormat': 'Y-m-d'
165 'name': 'last_event_id',
176 xtype: 'PagingToolbar',
180 displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
181 emptyMsg : "No core_notify_recur found"
193 var grid = _this.grid;
194 var r = grid.getDataSource().reader.newRow({
196 person_id : _this.data.person_id,
197 dtstart : new Date(0),
198 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
199 tz : 'Asia/Hong Kong',
200 onid : _this.data.onid,
201 ontable : _this.data.ontable,
202 method : _this.data.method,
211 grid.getDataSource().insert(0, r);
212 grid.startEditing(0, 2);
217 cls : 'x-btn-text-icon',
219 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
229 cls : 'x-btn-text-icon',
230 icon : rootURL + '/Pman/templates/images/trash.gif',
234 Pman.genericDelete(_this, 'core_notify_recur');
242 xtype: 'ColumnModel',
244 dataIndex : 'dtstart',
247 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
258 xtype: 'ColumnModel',
263 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
274 xtype: 'ColumnModel',
276 dataIndex : 'freq_day',
277 header : 'on day(s)',
279 renderer : function(v,x,r) {
281 return String.format('{0}', r.data.freq_day_name || v);
291 displayField : 'title',
293 fieldLabel : 'Country',
294 hiddenName : 'freq_day',
297 name : 'freq_day_name',
299 triggerAction : 'all',
302 xtype: 'SimpleStore',
306 Roo.each(Date.dayNames, function(d) {
307 ret.push([ d.substring(0,3).toUpperCase(), d ]);
311 fields : ['code', 'title'],
312 sortInfo : { field : 'title', direction: 'ASC' }
318 xtype: 'ColumnModel',
320 dataIndex : 'freq_hour',
321 header : 'at Hour(s)',
323 renderer : function(v,x,r) {
325 return String.format('{0}', r.data.freq_hour_name || v);
335 displayField : 'title',
337 fieldLabel : 'Country',
338 hiddenName : 'freq_hour',
341 name : 'freq_hour_name',
343 triggerAction : 'all',
346 xtype: 'SimpleStore',
350 for (var i = 5; i < 25; i++) {
351 var h = i < 10 ? ('0' + i) : i;
352 var mer = i < 12 || i > 23 ? 'am' : 'pm';
353 var dh = i < 13 ? i : i-12;
355 ret.push([ h+':00', dh+':00' + mer ]);
356 ret.push([ h+':00', dh+':30' + mer ]);
360 fields : ['code', 'title'],
361 sortInfo : { field : 'title', direction: 'ASC' }
367 xtype: 'ColumnModel',
372 renderer : function(v) { return String.format('{0}', v); },
379 allowBlank : 'false',
382 emptyText : "Select timezone",
383 fieldLabel : 'core_enum',
384 forceSelection : true,
387 loadingText : "Searching...",
391 qtip : "Select timezone",
393 selectOnFocus : true,
394 tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
395 triggerAction : 'all',
403 beforeload : function (_self, o){
404 o.params = o.params || {};
409 sortInfo : { direction : 'ASC', field: 'tz' },
414 url : baseURL + '/Core/I18n/Timezone.php'
421 totalProperty : 'total',
422 fields : [{"name":"tz","type":"string"}]
429 xtype: 'ColumnModel',
431 header : 'Last event',
433 dataIndex : 'last_event_id',
434 renderer : function(v) { return String.format('{0}', v); }
441 xtype: 'LayoutRegion',