From 71cd907ba5ba843a3ac5a5775ec642db176f5f0f Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 28 Sep 2020 12:13:21 +0800 Subject: [PATCH] fix notification view --- Pman.Tab.AdminNotify.bjs | 4 ++-- Pman.Tab.AdminNotify.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Pman.Tab.AdminNotify.bjs b/Pman.Tab.AdminNotify.bjs index 9475c42..919bd2b 100644 --- a/Pman.Tab.AdminNotify.bjs +++ b/Pman.Tab.AdminNotify.bjs @@ -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, @@ -114,7 +114,7 @@ }, { "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, diff --git a/Pman.Tab.AdminNotify.js b/Pman.Tab.AdminNotify.js index 1451ce7..3e397ec 100644 --- a/Pman.Tab.AdminNotify.js +++ b/Pman.Tab.AdminNotify.js @@ -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" }); -- 2.39.2