fix notification view
authorAlan Knowles <alan@roojs.com>
Mon, 28 Sep 2020 04:13:21 +0000 (12:13 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 28 Sep 2020 04:13:21 +0000 (12:13 +0800)
Pman.Tab.AdminNotify.bjs
Pman.Tab.AdminNotify.js

index 9475c42..919bd2b 100644 (file)
@@ -86,7 +86,7 @@
          "items" : [
           {
            "listeners" : {
-            "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params._evtype_align = 1;\n    \n    if (!_this.toggleBtn.pressed) {\n        options.params['event_id'] = 0;\n    }\n    if (!_this.personCombo) {\n        return false;\n    }\n    var p = _this.personCombo.getValue();\n    if (p*1) { \n        options.params.person_id = p;\n    }\n    \n    var from = _this.fromDateSel.getValue();\n    \n    if(from){\n        options.params.from = from.format('Y-m-d');\n    }\n    \n    var to = _this.toDateSel.getValue();\n    \n    if(to){\n        options.params.to = to.format('Y-m-d');\n    }\n    \n    var type = _this.typeCombo.getValue();\n    \n    if(type.length){\n        options.params.evtype = type;\n    }\n}"
+            "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params._evtype_align = 1;\n    \n    if (!_this.toggleBtn.pressed) {\n        options.params['event_id'] = 0;\n    } else  {\n        options.params['!event_id'] = 0;\n    }\n    \n    if (!_this.personCombo) {\n        return false;\n    }\n    var p = _this.personCombo.getValue();\n    if (p*1) { \n        options.params.person_id = p;\n    }\n    \n    var from = _this.fromDateSel.getValue();\n    \n    if(from){\n        options.params.from = from.format('Y-m-d');\n    }\n    \n    var to = _this.toDateSel.getValue();\n    \n    if(to){\n        options.params.to = to.format('Y-m-d');\n    }\n    \n    var type = _this.typeCombo.getValue();\n    \n    if(type.length){\n        options.params.evtype = type;\n    }\n}"
            },
            "xtype" : "Store",
            "remoteSort" : true,
           },
           {
            "listeners" : {
-            "afterselectionchange" : "function (_self)\n{\n    // load detail log in _this.viewPanel;\n    if (!this.getSelected()) {\n        this.viewPanel.setContent(\"Nothing Selected\");\n        return;\n    }\n    var id = this.getSelected().data.event_id;\n    if (id *1 < 0) {\n    \n        this.viewPanel.setContent(\"No Event for this line\");    \n        return;\n    }\n    _this.viewPanel.load( { url : baseURL + \"/Admin/EventView/\" + id + \".html\" });\n    \n}"
+            "afterselectionchange" : "function (_self)\n{\n    // load detail log in _this.viewPanel;\n    if (!this.getSelected()) {\n        this.viewPanel.setContent(\"Nothing Selected\");\n        return;\n    }\n    var id = this.getSelected().data.event_id;\n    if (id *1 < 1) {\n    \n       _this.viewPanel.setContent(\"No Event for this line\");    \n        return;\n    }\n    _this.viewPanel.load( { url : baseURL + \"/Admin/EventView/\" + id + \".html\" });\n    \n}"
            },
            "xtype" : "RowSelectionModel",
            "singleSelect" : true,
index 1451ce7..3e397ec 100644 (file)
@@ -364,7 +364,10 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
               
               if (!_this.toggleBtn.pressed) {
                   options.params['event_id'] = 0;
+              } else  {
+                  options.params['!event_id'] = 0;
               }
+              
               if (!_this.personCombo) {
                   return false;
               }
@@ -566,9 +569,9 @@ Pman.Tab.AdminNotify = new Roo.XComponent({
                   return;
               }
               var id = this.getSelected().data.event_id;
-              if (id *1 < 0) {
+              if (id *1 < 1) {
               
-                  this.viewPanel.setContent("No Event for this line");    
+                 _this.viewPanel.setContent("No Event for this line");    
                   return;
               }
               _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });