Pman.Dialog.CoreNotifyRecur.bjs
[Pman.Core] / Pman.Dialog.CoreNotifyRecur.js
index 1b3c0b8..a526efb 100644 (file)
@@ -36,7 +36,7 @@ Pman.Dialog.CoreNotifyRecur = {
                     _this.grid.ds.load({});
                 }
             },
-            height : 500,
+            height : 550,
             modal : true,
             resizable : false,
             title : "Modify Recurrent Notifications",
@@ -213,7 +213,7 @@ Pman.Dialog.CoreNotifyRecur = {
                                                 person_id : _this.data.person_id,
                                                 dtstart : new Date(),
                                                 dtend : Date.parseDate('2050-01-01', 'Y-m-d'),
-                                                tz : 'Asia/Hong Kong',
+                                                tz : 'Asia/Hong_Kong',
                                                 onid : _this.data.onid,
                                                 ontable : _this.data.ontable,
                                                 method : _this.data.method,
@@ -246,7 +246,7 @@ Pman.Dialog.CoreNotifyRecur = {
                                         click : function()
                                         {
                                              _this.grid.stopEditing();
-                                             var s = _this.grid.selModel.getSelectedCell()
+                                             var s = _this.grid.selModel.getSelectedCell();
                                              if (!s) {
                                                 Roo.MessageBox.alert("Error", "Select row");
                                                 return;
@@ -256,7 +256,7 @@ Pman.Dialog.CoreNotifyRecur = {
                                                 url : baseURL + '/Roo/core_notify_recur',
                                                 method : 'POST',
                                                 params : {
-                                                    _delete : _this.grid.ds.getAt(s[0]).data.id,
+                                                    _delete : _this.grid.ds.getAt(s[0]).data.id
                                                 }, 
                                                 success : function() {
                                                     _this.grid.ds.load({});
@@ -275,6 +275,72 @@ Pman.Dialog.CoreNotifyRecur = {
                             ]
                         },
                         colModel : [
+                            {
+                                xtype: 'ColumnModel',
+                                xns: Roo.grid,
+                                dataIndex : 'method_id',
+                                header : 'From',
+                                width : 75,
+                                renderer : function(v,x,r) {
+                                     return String.format('{0}', r.data.method_id_display_name); 
+                                 },
+                                editor : {
+                                    xtype: 'GridEditor',
+                                    xns: Roo.grid,
+                                    items : [
+                                        {
+                                            xtype: 'ComboBox',
+                                            xns: Roo.form,
+                                            allowBlank : 'false',
+                                            editable : 'false',
+                                            emptyText : "Select core_enum",
+                                            forceSelection : true,
+                                            listWidth : 400,
+                                            loadingText : "Searching...",
+                                            minChars : 2,
+                                            pageSize : 20,
+                                            qtip : "Select core_enum",
+                                            selectOnFocus : true,
+                                            triggerAction : 'all',
+                                            typeAhead : true,
+                                            width : 300,
+                                            tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
+                                            queryParam : '',
+                                            fieldLabel : 'core_enum',
+                                            valueField : 'id',
+                                            displayField : '',
+                                            hiddenName : '',
+                                            name : '',
+                                            store : {
+                                                xtype: 'Store',
+                                                xns: Roo.data,
+                                                remoteSort : true,
+                                                sortInfo : { direction : 'ASC', field: 'id' },
+                                                listeners : {
+                                                    beforeload : function (_self, o){
+                                                        o.params = o.params || {};
+                                                        // set more here
+                                                    }
+                                                },
+                                                proxy : {
+                                                    xtype: 'HttpProxy',
+                                                    xns: Roo.data,
+                                                    method : 'GET',
+                                                    url : baseURL + '/Roo/core_enum.php'
+                                                },
+                                                reader : {
+                                                    xtype: 'JsonReader',
+                                                    xns: Roo.data,
+                                                    id : 'id',
+                                                    root : 'data',
+                                                    totalProperty : 'total',
+                                                    fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
+                                                }
+                                            }
+                                        }
+                                    ]
+                                }
+                            },
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
@@ -439,7 +505,7 @@ Pman.Dialog.CoreNotifyRecur = {
                                                     var dh = i < 13 ? i : i-12;
                                                     
                                                     ret.push([ h+':00', dh+':00' + mer ]);
-                                                    ret.push([ h+':00', dh+':30' + mer ]);        
+                                                    ret.push([ h+':30', dh+':30' + mer ]);        
                                                 }
                                                 return ret;
                                             })(),