Pman.Dialog.CoreNotifyRecur.bjs
[Pman.Core] / Pman.Dialog.CoreNotifyRecur.js
index b1263b4..5891cbe 100644 (file)
@@ -105,6 +105,16 @@ Pman.Dialog.CoreNotifyRecur = {
                                        
                                     
                                     
+                                },
+                                beforeload : function (_self, o)
+                                {
+                                    o.params =  Roo.apply(o.params, {
+                                        person_id : _this.data.person_id,
+                                        onid : _this.data.onid,
+                                        ontable : _this.data.ontable,
+                                        method : _this.data.method
+                                    });
+                                        
                                 }
                             },
                             remoteSort : true,
@@ -270,57 +280,6 @@ Pman.Dialog.CoreNotifyRecur = {
                                     }
                                 }
                             },
-                            {
-                                xtype: 'ColumnModel',
-                                xns: Roo.grid,
-                                dataIndex : 'freq',
-                                header : 'Frequency',
-                                width : 70,
-                                renderer : function(v,x,r) { 
-                                
-                                    Roo.log(this);
-                                    var cm = _this.grid.colModel;
-                                    var ix = cm.findColumnIndex('freq');
-                                    var ce = cm.getCellEditor(ix)
-                                    var matches = ce.field.store.query('code',v);
-                                    if (!matches.length) {
-                                        return '';
-                                    }
-                                    return String.format('{0}', matches.first().data.title);
-                                 },
-                                editor : {
-                                    xtype: 'GridEditor',
-                                    xns: Roo.grid,
-                                    field : {
-                                        xtype: 'ComboBox',
-                                        xns: Roo.form,
-                                        allowBlank : false,
-                                        displayField : 'title',
-                                        editable : false,
-                                        fieldLabel : 'Country',
-                                        hiddenName : 'freq',
-                                        listWidth : 200,
-                                        mode : 'local',
-                                        name : 'freq_name',
-                                        tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
-                                        triggerAction : 'all',
-                                        valueField : 'code',
-                                        width : 200,
-                                        store : {
-                                            xtype: 'SimpleStore',
-                                            xns: Roo.data,
-                                            data : [ 
-                                                [ 'HOURLY' , 'Hourly at' ] ,
-                                                   [ 'DAILY' , 'Daily at'] ,
-                                                    [ 'WEEKLY' , 'Weekly at'] ,
-                                                     [ 'Montly' , 'Montly at'] 
-                                            ],
-                                            fields : ['code', 'title'],
-                                            sortInfo : { field : 'title', direction: 'ASC' }
-                                        }
-                                    }
-                                }
-                            },
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
@@ -424,83 +383,54 @@ Pman.Dialog.CoreNotifyRecur = {
                                 editor : {
                                     xtype: 'GridEditor',
                                     xns: Roo.grid,
-                                    items : [
-                                        {
-                                            xtype: 'ComboBox',
-                                            xns: Roo.form,
-                                            allowBlank : 'false',
-                                            displayField : 'tz',
-                                            editable : 'false',
-                                            emptyText : "Select core_enum",
-                                            fieldLabel : 'core_enum',
-                                            forceSelection : true,
-                                            hiddenName : 'tz',
-                                            listWidth : 400,
-                                            loadingText : "Searching...",
-                                            minChars : 2,
-                                            name : 'tz_name',
-                                            pageSize : 20,
-                                            qtip : "Select timezone",
-                                            selectOnFocus : true,
-                                            tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
-                                            triggerAction : 'all',
-                                            typeAhead : true,
-                                            valueField : 'id',
-                                            width : 300,
-                                            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"}]
-                                                }
-                                            }
-                                        }
-                                    ],
                                     field : {
                                         xtype: 'ComboBox',
                                         xns: Roo.form,
-                                        allowBlank : false,
-                                        displayField : 'title',
-                                        editable : false,
-                                        fieldLabel : 'Country',
-                                        hiddenName : 'freq',
-                                        listWidth : 200,
-                                        mode : 'local',
-                                        name : 'freq_name',
-                                        tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
+                                        allowBlank : 'false',
+                                        displayField : 'tz',
+                                        editable : true,
+                                        emptyText : "Select timezone",
+                                        fieldLabel : 'core_enum',
+                                        forceSelection : true,
+                                        hiddenName : 'tz',
+                                        listWidth : 400,
+                                        loadingText : "Searching...",
+                                        minChars : 2,
+                                        name : 'tz_name',
+                                        pageSize : 999,
+                                        qtip : "Select timezone",
+                                        queryParam : 'q',
+                                        selectOnFocus : true,
+                                        tpl : '<div class="x-grid-cell-text x-btn button"><b>{tz}</b> </div>',
                                         triggerAction : 'all',
-                                        valueField : 'code',
-                                        width : 200,
+                                        typeAhead : true,
+                                        valueField : 'tz',
+                                        width : 300,
                                         store : {
-                                            xtype: 'SimpleStore',
+                                            xtype: 'Store',
                                             xns: Roo.data,
-                                            data : [ 
-                                                [ 'HOURLY' , 'Hourly at' ] ,
-                                                   [ 'DAILY' , 'Daily at'] ,
-                                                    [ 'WEEKLY' , 'Weekly at'] ,
-                                                     [ 'Montly' , 'Montly at'] 
-                                            ],
-                                            fields : ['code', 'title'],
-                                            sortInfo : { field : 'title', direction: 'ASC' }
+                                            listeners : {
+                                                beforeload : function (_self, o){
+                                                    o.params = o.params || {};
+                                                    // set more here
+                                                }
+                                            },
+                                            remoteSort : true,
+                                            sortInfo : { direction : 'ASC', field: 'tz' },
+                                            proxy : {
+                                                xtype: 'HttpProxy',
+                                                xns: Roo.data,
+                                                method : 'GET',
+                                                url : baseURL + '/Core/I18n/Timezone.php'
+                                            },
+                                            reader : {
+                                                xtype: 'JsonReader',
+                                                xns: Roo.data,
+                                                id : 'id',
+                                                root : 'data',
+                                                totalProperty : 'total',
+                                                fields : [{"name":"tz","type":"string"}]
+                                            }
                                         }
                                     }
                                 }