Fix #6628 - searching on notification history
[Pman.Admin] / Pman.Tab.AdminNotify.bjs
index 8537178..08dd07a 100644 (file)
@@ -2,10 +2,11 @@
  "name" : "Pman.Tab.AdminNotify",
  "parent" : "Pman.Tab.AdminWatchNotify",
  "title" : "Pman.Tab.AdminNotify",
- "path" : "/home/benny/gitlive/web.hhyc_membership_system/Pman.Admin/Pman.Tab.AdminNotify.bjs",
+ "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminNotify.bjs",
  "permname" : "",
  "modOrder" : "001",
  "strings" : {
+  "aed6676e8238afe7cf55e3baf2ad72a2" : "Search Subject",
   "136fac3c5c5881e0a7d0039e57decd68" : "Select notify type",
   "bf1cb7e2a337a5e2ebf614009cbce9cc" : "Current Notifications",
   "8535bcc0f05358a583bb432bbadf7e0d" : "Select type",
@@ -30,6 +31,9 @@
  },
  "items" : [
   {
+   "listeners" : {
+    "render" : "function (_self)\n{\n    _this.nest = this;\n}"
+   },
    "xtype" : "NestedLayoutPanel",
    "String region" : "center",
    "$ xns" : "Roo",
@@ -62,7 +66,7 @@
        "listeners" : {
         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n    \n}"
        },
-       "bool background" : true,
+       "bool background" : false,
        "region" : "center",
        "fitToframe" : true,
        "title" : "Current Notifications",
@@ -83,7 +87,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    options.params['search[contains]'] = _this.searchBox.getValue();\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,
            "$ xns" : "Roo",
            "* prop" : "toolbar",
            "items" : [
+            {
+             "listeners" : {
+              "specialkey" : "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}",
+              "render" : "function (_self)\n{\n    _this.searchBox = this;\n}"
+             },
+             "xtype" : "TextField",
+             "String emptyText" : "Search Subject",
+             "$ xns" : "Roo.form"
+            },
             {
              "listeners" : {
               "render" : "function (_self)\n{\n   _this.personCombo = _self;\n}",
            "xtype" : "ColumnModel",
            "sortable" : true,
            "header" : "Method",
-           "width" : 100,
+           "width" : 70,
            "$ renderer" : "function(v,x,r) \n{ \n    var vv = (typeof(r.data.evtype_align) != 'undefined' && r.data.evtype_align) ? r.data.evtype_align : v;\n    return String.format('<span qtip=\"{0}\">{1}</span>', v, vv ); \n}",
            "$ xns" : "Roo.grid",
            "* prop" : "colModel[]",
            "xtype" : "ColumnModel",
            "sortable" : true,
            "header" : "Act when",
-           "width" : 150,
+           "width" : 130,
            "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
            "$ xns" : "Roo.grid",
            "* prop" : "colModel[]",
            "xtype" : "ColumnModel",
            "sortable" : true,
            "header" : "Sent",
-           "width" : 150,
+           "width" : 130,
            "$ renderer" : "function(v,x,r) {\n    if (r.data.event_id *1 == 0) {\n        return '';\n    }\n     return String.format('{0}', v ? v.format('d/M/Y H:i:s') : '');\n  }",
            "$ xns" : "Roo.grid",
            "* prop" : "colModel[]",
           {
            "xtype" : "ColumnModel",
            "header" : "Msgid",
-           "width" : 200,
+           "width" : 50,
            "$ renderer" : "function(v) { return String.format('{0}', v); }",
            "$ xns" : "Roo.grid",
            "* prop" : "colModel[]",