Pman.Tab.AdminNotify.bjs
[Pman.Admin] / Pman.Tab.AdminNotify.js
index 49cc613..6e66148 100644 (file)
@@ -201,6 +201,23 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                                   options.params.person_id = p;
                               }
                               
+                              var from = _this.fromDateSel.getValue();
+                              
+                              if(from){
+                                  options.params.from = from.format('Y-m-d');
+                              }
+                              
+                              var to = _this.toDateSel.getValue();
+                              
+                              if(to){
+                                  options.params.to = to.format('Y-m-d');
+                              }
+                              
+                              var type = _this.typeCombo.getValue();
+                              
+                              if(type.length){
+                                  options.params.evtype = type;
+                              }
                           }
                     },
                     items : [
@@ -268,16 +285,14 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                             pageSize : 20,
                             displayField : 'person_id_name',
                             emptyText : "Select person",
-                            hiddenName : 'id',
                             minChars : 2,
                             valueField : 'person_id',
                             xtype : 'ComboBox',
                             allowBlank : true,
                             editable : true,
-                            width : 300,
+                            width : 200,
                             xns : Roo.form,
-                            name : 'name',
-                            qtip : "Select core_notify",
+                            qtip : "Select person",
                             queryParam : 'query[person_id_name]',
                             tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{person_id_name}</b> {person_id_email}</div>',
                             loadingText : "Searching...",
@@ -296,6 +311,138 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                             ]
 
                         },
+                       {
+                            '|xns' : 'Roo.Toolbar',
+                            xtype : 'Separator',
+                            xns : Roo.Toolbar
+                        },
+                       {
+                            store : {
+                                proxy : {
+                                    '|xns' : 'Roo.data',
+                                    url : baseURL + '/Roo/core_enum.php',
+                                    xtype : 'HttpProxy',
+                                    method : 'GET',
+                                    xns : Roo.data
+                                },
+                                reader : {
+                                    '|xns' : 'Roo.data',
+                                    id : 'id',
+                                    root : 'data',
+                                    xtype : 'JsonReader',
+                                    xns : Roo.data,
+                                    fields : [{"name":"name","type":"string"},{"name":"display_name","type":"string"}],
+                                    totalProperty : 'total'
+                                },
+                                '|xns' : 'Roo.data',
+                                xtype : 'Store',
+                                remoteSort : true,
+                                sortInfo : { direction : 'ASC', field: 'id' },
+                                xns : Roo.data,
+                                listeners : {
+                                       beforeload : function (_self, o){
+                                              o.params = o.params || {};
+                                              o.params.etype = 'Core.NotifyType';
+                                              o.params.active = 1;
+                                          }
+                                },
+                                items : [
+
+                                ]
+
+                            },
+                            '|xns' : 'Roo.form',
+                            listWidth : 400,
+                            triggerAction : 'all',
+                            forceSelection : true,
+                            selectOnFocus : true,
+                            pageSize : 20,
+                            displayField : 'display_name',
+                            emptyText : "Select notify type",
+                            minChars : 2,
+                            valueField : 'name',
+                            xtype : 'ComboBox',
+                            allowBlank : true,
+                            editable : true,
+                            width : 200,
+                            xns : Roo.form,
+                            qtip : "Select type",
+                            queryParam : 'query[name]',
+                            tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b></div>',
+                            loadingText : "Searching...",
+                            listeners : {
+                               render : function (_self)
+                                  {
+                                     _this.typeCombo = _self;
+                                  },
+                               select : function (combo, record, index)
+                                  {
+                                     _this.grid.footer.onClick('first');
+                                  }
+                            },
+                            items : [
+
+                            ]
+
+                        },
+                       {
+                            '|xns' : 'Roo.Toolbar',
+                            xtype : 'Separator',
+                            xns : Roo.Toolbar
+                        },
+                       {
+                            '|xns' : 'Roo.Toolbar',
+                            text : "From",
+                            xtype : 'TextItem',
+                            xns : Roo.Toolbar
+                        },
+                       {
+                            '|xns' : 'Roo.form',
+                            format : 'd/M/Y',
+                            xtype : 'DateField',
+                            width : 100,
+                            xns : Roo.form,
+                            listeners : {
+                               render : function (_self)\r
+                                  {\r
+                                      _this.fromDateSel = _self;\r
+                                     //_self.setValue(  new Date() );\r
+                                  },
+                               select : function (combo, date)
+                                  {
+                                      _this.grid.footer.onClick('first');
+                                  }
+                            }
+                        },
+                       {
+                            '|xns' : 'Roo.Toolbar',
+                            xtype : 'Separator',
+                            xns : Roo.Toolbar
+                        },
+                       {
+                            '|xns' : 'Roo.Toolbar',
+                            text : "To",
+                            xtype : 'TextItem',
+                            xns : Roo.Toolbar
+                        },
+                       {
+                            '|xns' : 'Roo.form',
+                            format : 'd/M/Y',
+                            xtype : 'DateField',
+                            width : 100,
+                            xns : Roo.form,
+                            listeners : {
+                               render : function (_self)\r
+                                  {\r
+                                      _this.toDateSel = _self;\r
+                                     //_self.setValue(  new Date() );\r
+                                  },
+                               select : function (combo, date)
+                                  {
+                                      _this.grid.footer.onClick('first');
+                                  }
+                            }
+                        },
                        {
                             '|xns' : 'Roo.Toolbar',
                             xtype : 'Fill',