1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.CoreNotifyRecur = {
10 '3728af837fe70019577ddb0ed7125ee5' :"Until",
11 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
12 '023a5dfa857c4aa0156e6685231a1dbd' :"Select Type",
13 '6c768695a8efb18436d5b7b4374cdb45' :"Select core_enum",
14 '157e432ec303efd7d537b653cb255ccc' :"on day(s)",
15 '236df51bb0e6416236e255b528346fca' :"Timezone",
16 '44c68bed631ff6e62aecc4a4d32176e6' :"Select timezone",
17 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
18 'b26686c0a708faee42861d8b905e882e' :"Last Sent",
19 'c1d32776cd2d2afcd2c45a52f58679f4' :"Modify Recurrent Notifications",
20 '5da618e8e4b89c66fe86e32cdafde142' :"From",
21 'ce527d7432bab413730f25c794648e46' :"at Hour(s)",
22 'c7179f16884513c990b6cbf44aef7fc3' :"core_notify_recur",
23 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
24 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
25 'f92965e2c8a7afb3c1b9a5c09a263636' :"Done"
31 show : function(data, cb)
39 this.dialog.show(this.data._el);
42 this.form.setValues(data);
43 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
51 this.dialog = Roo.factory({
57 xtype : 'LayoutRegion'
63 title : _this._strings['c1d32776cd2d2afcd2c45a52f58679f4'],
66 xtype : 'LayoutDialog',
70 text : _this._strings['f92965e2c8a7afb3c1b9a5c09a263636'],
74 click : function (_self, e)
82 show : function (_self)
84 _this.grid.ds.load({});
94 url : baseURL + '/Roo/core_notify_recur.php',
112 'dateFormat': 'Y-m-d'
117 'dateFormat': 'Y-m-d'
124 'name': 'last_applied_dt',
126 'dateFormat': 'Y-m-d'
141 'name': 'last_event_id',
151 totalProperty : 'total',
157 sortInfo : { field : 'freq', direction: 'ASC' },
161 beforeload : function (_self, o)
166 o.params = Roo.apply(o.params || {}, {
167 person_id : _this.data.person_id,
168 onid : _this.data.onid,
169 ontable : _this.data.ontable,
170 method : _this.data.method
174 update : function (_self, record, operation)
176 //Roo.log(operation);
177 if (operation != 'commit') {
180 var p = Roo.apply({}, record.data);
181 p.dtstart = record.data.dtstart.format('Y-m-d');
182 p.dtend = record.data.dtend.format('Y-m-d');
186 url : baseURL + '/Roo/Core_notify_recur',
189 success : function(data)
192 record.set('id', data.data.id);
194 failure : function() {
195 Roo.MessageBox.alert("Error", "There was a problem saving");
214 '|xns' : 'Roo.Toolbar',
215 cls : 'x-btn-text-icon',
216 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
217 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
223 var grid = _this.grid;
224 var r = grid.getDataSource().reader.newRow({
226 person_id : _this.data.person_id,
227 dtstart : new Date(),
228 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
229 tz : 'Asia/Hong_Kong',
230 onid : _this.data.onid,
231 ontable : _this.data.ontable,
232 method : _this.data.method, // default...
234 method_id : _this.data.method_id, // default...
235 method_id_display_name : _this.data.method_id_display_name, // default...
245 grid.getDataSource().insert(0, r);
246 grid.startEditing(0, 2);
253 '|xns' : 'Roo.Toolbar',
258 '|xns' : 'Roo.Toolbar',
259 cls : 'x-btn-text-icon',
260 icon : rootURL + '/Pman/templates/images/trash.gif',
261 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
267 _this.grid.stopEditing();
268 var s = _this.grid.selModel.getSelectedCell();
270 Roo.MessageBox.alert("Error", "Select row");
275 url : baseURL + '/Roo/core_notify_recur',
278 _delete : _this.grid.ds.getAt(s[0]).data.id
280 success : function() {
281 _this.grid.ds.load({});
283 failure : function() {
284 Roo.MessageBox.alert("Error", "Deleting failed - try reloading");
295 autoExpandColumn : 'freq_day',
299 xtype : 'EditorGrid',
308 url : baseURL + '/Roo/core_enum.php',
314 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}],
317 totalProperty : 'total',
323 sortInfo : { direction : 'ASC', field: 'id' },
327 beforeload : function (_self, o){
328 o.params = o.params || {};
330 o.params.etype = 'core_notify_recur';
340 displayField : 'display_name',
342 emptyText : _this._strings['023a5dfa857c4aa0156e6685231a1dbd'],
343 fieldLabel : 'core_enum',
344 forceSelection : true,
345 hiddenName : 'method_id',
347 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
348 name : 'method_id_display_name',
350 qtip : _this._strings['6c768695a8efb18436d5b7b4374cdb45'],
351 selectOnFocus : true,
352 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
353 triggerAction : 'all',
366 xtype : 'GridEditor',
373 dataIndex : 'method_id',
374 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
375 renderer : function(v,x,r) {
376 return String.format('{0}', r.data.method_id_display_name);
380 xtype : 'ColumnModel',
395 xtype : 'GridEditor',
402 dataIndex : 'dtstart',
403 header : _this._strings['5da618e8e4b89c66fe86e32cdafde142'],
404 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
407 xtype : 'ColumnModel',
422 xtype : 'GridEditor',
430 header : _this._strings['3728af837fe70019577ddb0ed7125ee5'],
431 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
434 xtype : 'ColumnModel',
447 Roo.each(Date.dayNames, function(d) {
448 ret.push([ d.substring(0,3).toUpperCase(), d ]);
452 fields : ['code', 'title'],
453 sortInfo : { field : 'title', direction: 'ASC' },
455 xtype : 'SimpleStore'
459 displayField : 'title',
461 fieldLabel : 'Country',
462 hiddenName : 'freq_day',
465 name : 'freq_day_name',
467 triggerAction : 'all',
470 xtype : 'ComboCheck',
478 xtype : 'GridEditor',
485 dataIndex : 'freq_day',
486 header : _this._strings['157e432ec303efd7d537b653cb255ccc'],
487 renderer : function(v,x,r) {
491 var cm = _this.grid.colModel;
493 var ci = cm.getColumnByDataIndex(this.name);
496 var vals = Roo.decode(v);
497 Roo.each(vals, function(k) {
498 var r = this.findRecord(this.valueField, k);
500 tv.push(r.data[this.displayField]);
501 }else if(this.valueNotFoundText !== undefined){
502 tv.push( this.valueNotFoundText );
506 r.data[this.name + '_name'] = tv.join(', ');
507 return String.format('{0}',tv.join(', '));
512 r.data[this.name + '_name'] = '';
513 return String.format('{0}', r.data.freq_day_name || v);
518 xtype : 'ColumnModel',
531 for (var i = 5; i < 25; i++) {
532 var h = i < 10 ? ('0' + i) : i;
533 var mer = i < 12 || i > 23 ? 'am' : 'pm';
534 var dh = i < 13 ? i : i-12;
536 ret.push([ h+':00', dh+':00' + mer ]);
537 ret.push([ h+':30', dh+':30' + mer ]);
541 fields : ['code', 'title'],
542 sortInfo : { field : 'title', direction: 'ASC' },
544 xtype : 'SimpleStore'
548 displayField : 'title',
550 fieldLabel : 'Country',
551 hiddenName : 'freq_hour',
554 name : 'freq_hour_name',
556 triggerAction : 'all',
559 xtype : 'ComboCheck',
567 xtype : 'GridEditor',
574 dataIndex : 'freq_hour',
575 header : _this._strings['ce527d7432bab413730f25c794648e46'],
576 renderer : function(v,x,r) {
581 var cm = _this.grid.colModel;
583 var ci = cm.getColumnByDataIndex(this.name);
586 var vals = Roo.decode(v);
587 Roo.each(vals, function(k) {
588 var r = this.findRecord(this.valueField, k);
590 tv.push(r.data[this.displayField]);
591 }else if(this.valueNotFoundText !== undefined){
592 tv.push( this.valueNotFoundText );
596 r.data[this.name + '_name'] = tv.join(', ');
597 return String.format('{0}',tv.join(', '));
602 r.data[this.name + '_name'] = '';
603 return String.format('{0}', r.data.freq_hour_name || v);
608 xtype : 'ColumnModel',
621 url : baseURL + '/Core/I18n/Timezone.php',
627 fields : [{"name":"tz","type":"string"}],
630 totalProperty : 'total',
636 sortInfo : { direction : 'ASC', field: 'tz' },
640 beforeload : function (_self, o){
641 o.params = o.params || {};
654 emptyText : _this._strings['44c68bed631ff6e62aecc4a4d32176e6'],
655 fieldLabel : 'core_enum',
656 forceSelection : true,
658 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
662 qtip : _this._strings['44c68bed631ff6e62aecc4a4d32176e6'],
664 selectOnFocus : true,
665 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{tz}</b> </div>',
666 triggerAction : 'all',
678 xtype : 'GridEditor',
686 header : _this._strings['236df51bb0e6416236e255b528346fca'],
687 renderer : function(v) { return String.format('{0}', v); },
690 xtype : 'ColumnModel',
698 dataIndex : 'last_event_id',
699 header : _this._strings['b26686c0a708faee42861d8b905e882e'],
700 renderer : function(v) { return String.format('{0}', v ? v : 'never'); },
703 xtype : 'ColumnModel'
709 dataIndex : 'last_event_id',
710 header : _this._strings['b26686c0a708faee42861d8b905e882e'],
711 renderer : function(v) { return String.format('{0}', v ? v : 'never'); },
714 xtype : 'ColumnModel'
718 afteredit : function (e)
725 //_this.dialog = Pman.Dialog.FILL_IN
726 if (_this.panel.active) {
727 // this.footer.onClick('first');
730 rowdblclick : function (_self, rowIndex, e)
732 if (!_this.dialog) return;
733 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
734 _this.grid.footer.onClick('first');
748 tableName : 'core_notify_recur',
749 title : _this._strings['c7179f16884513c990b6cbf44aef7fc3'],
753 activate : function() {
756 // _this.grid.footer.onClick('first');