Changed NotifySend.phpPman.Dialog.CoreEmailPreview.bjsPman.Dialog.CoreEmailPreview.js
authorAlan <alan@roojs.com>
Thu, 29 Sep 2022 07:17:37 +0000 (15:17 +0800)
committerAlan <alan@roojs.com>
Thu, 29 Sep 2022 07:17:37 +0000 (15:17 +0800)
NotifySend.php
Pman.Dialog.CoreEmailPreview.bjs
Pman.Dialog.CoreEmailPreview.js

index e32fc6c..8053239 100644 (file)
@@ -102,7 +102,7 @@ class Pman_Core_NotifySend extends Pman
             $this->errorHandler("invalid id\n");
         }
 
-        if (!$force && strtotime($w->act_when) < strtotime($w->sent)) {
+        if (!$force && !empty($w->sent) && strtotime($w->act_when) < strtotime($w->sent)) {
             
             
             $this->errorHandler("send repeat to early\n");
index addc15a..7220d1e 100644 (file)
 {
- "name" : "Pman.Dialog.CoreEmailPreview",
- "parent" : "",
- "title" : "",
- "path" : "/home/johns/gitlive/Pman.Core/Pman.Dialog.CoreEmailPreview.bjs",
- "permname" : "",
- "modOrder" : "001",
- "strings" : {
-  "4cd8413207629a963225f4314b53adcd" : "Plain",
-  "4c4ad5fca2e7a3f74dbb1ced00381aa4" : "HTML",
-  "006c82ffdd63692a84a259c4f8732842" : "Email Preview",
-  "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
- },
  "items" : [
   {
-   "listeners" : {
-    "show" : "function (_self)\n{\n    \n    _self.layout.getRegion('center').showPanel(0);\n    _this.panel.load({ \n        url: baseURL + '/Core/MessagePreview', \n        params  : {\n            _id : _this.data.id,\n            _table : _this.data.module\n        },\n        method : 'GET'\n    });\n    _this.hpanel.load({ \n        url: baseURL + '/Core/MessagePreview', \n        params  : {\n            _as_html : 1,\n            _id : _this.data.id,\n            _table : _this.data.module\n        },\n        method : 'GET'\n    });\n        \n}"
-   },
-   "shadow" : true,
-   "autoScroll" : true,
-   "title" : "Email Preview",
-   "xtype" : "LayoutDialog",
-   "width" : 1200,
    "$ xns" : "Roo",
+   "autoScroll" : true,
    "closable" : true,
    "height" : 800,
    "items" : [
     {
+     "$ xns" : "Roo",
+     "* prop" : "center",
      "autoScroll" : true,
-     "xtype" : "LayoutRegion",
      "tabPosition" : "top",
-     "$ xns" : "Roo",
-     "* prop" : "center"
+     "xtype" : "LayoutRegion"
     },
     {
+     "$ xns" : "Roo",
+     "fitContainer" : true,
+     "fitToFrame" : true,
      "listeners" : {
-      "render" : "function (_self)\n{\n    _this.panel = _self;\n}"
+      "render" : [
+       "function (_self)",
+       "{",
+       "    _this.hpanel = _self;",
+       "}"
+      ]
      },
      "region" : "center",
-     "fitToFrame" : true,
-     "title" : "Plain",
-     "xtype" : "ContentPanel",
-     "fitContainer" : true,
-     "$ xns" : "Roo"
+     "title" : "HTML",
+     "xtype" : "ContentPanel"
     },
     {
+     "$ xns" : "Roo",
+     "fitContainer" : true,
+     "fitToFrame" : true,
      "listeners" : {
-      "render" : "function (_self)\n{\n    _this.hpanel = _self;\n}"
+      "render" : [
+       "function (_self)",
+       "{",
+       "    _this.panel = _self;",
+       "}"
+      ]
      },
      "region" : "center",
-     "fitToFrame" : true,
-     "title" : "HTML",
-     "xtype" : "ContentPanel",
-     "fitContainer" : true,
-     "$ xns" : "Roo"
+     "title" : "Plain",
+     "xtype" : "ContentPanel"
     },
     {
+     "$ xns" : "Roo",
+     "* prop" : "buttons[]",
      "listeners" : {
-      "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
+      "click" : [
+       "function (_self, e)",
+       "{",
+       "    _this.dialog.hide();",
+       "}"
+      ]
      },
      "text" : "OK",
-     "xtype" : "Button",
-     "$ xns" : "Roo",
-     "* prop" : "buttons[]"
+     "xtype" : "Button"
     }
-   ]
+   ],
+   "listeners" : {
+    "show" : [
+     "function (_self)",
+     "{",
+     "    ",
+     "    _self.layout.getRegion('center').showPanel(0);",
+     "    _this.panel.load({ ",
+     "        url: baseURL + '/Core/MessagePreview', ",
+     "        params  : {",
+     "            _id : _this.data.id,",
+     "            _table : _this.data.module,",
+     "            ontable : _this.data.ontable,",
+     "            onid : _this.data.onid",
+     "        },",
+     "        method : 'GET'",
+     "    });",
+     "    _this.hpanel.load({ ",
+     "        url: baseURL + '/Core/MessagePreview', ",
+     "        params  : {",
+     "            _as_html : 1,",
+     "            _id : _this.data.id,",
+     "            _table : _this.data.module,",
+     "            ontable : _this.data.ontable,",
+     "            onid : _this.data.onid",
+     "        },",
+     "        method : 'GET'",
+     "    });",
+     "        ",
+     "}"
+    ]
+   },
+   "shadow" : true,
+   "title" : "Email Preview",
+   "width" : 1200,
+   "xtype" : "LayoutDialog"
   }
- ]
+ ],
+ "modOrder" : "001",
+ "name" : "Pman.Dialog.CoreEmailPreview",
+ "parent" : "",
+ "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.CoreEmailPreview.bjs",
+ "permname" : "",
+ "strings" : {
+  "006c82ffdd63692a84a259c4f8732842" : "Email Preview",
+  "4c4ad5fca2e7a3f74dbb1ced00381aa4" : "HTML",
+  "4cd8413207629a963225f4314b53adcd" : "Plain",
+  "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
+ },
+ "title" : ""
 }
\ No newline at end of file
index c045eb0..fb063e2 100644 (file)
@@ -24,7 +24,7 @@ Pman.Dialog.CoreEmailPreview = {
 
   this.callback = cb;
   this.data = data;
-  this.dialog.show(this.data._el);
+  this.dialog.show.apply(this.dialog,  Array.prototype.slice.call(arguments).slice(2));
   if (this.form) {
    this.form.reset();
    this.form.setValues(data);
@@ -53,7 +53,9 @@ Pman.Dialog.CoreEmailPreview = {
               url: baseURL + '/Core/MessagePreview', 
               params  : {
                   _id : _this.data.id,
-                  _table : _this.data.module
+                  _table : _this.data.module,
+                  ontable : _this.data.ontable,
+                  onid : _this.data.onid
               },
               method : 'GET'
           });
@@ -62,7 +64,9 @@ Pman.Dialog.CoreEmailPreview = {
               params  : {
                   _as_html : 1,
                   _id : _this.data.id,
-                  _table : _this.data.module
+                  _table : _this.data.module,
+                  ontable : _this.data.ontable,
+                  onid : _this.data.onid
               },
               method : 'GET'
           });
@@ -98,11 +102,11 @@ Pman.Dialog.CoreEmailPreview = {
       fitContainer : true,
       fitToFrame : true,
       region : 'center',
-      title : _this._strings['4cd8413207629a963225f4314b53adcd'] /* Plain */,
+      title : _this._strings['4c4ad5fca2e7a3f74dbb1ced00381aa4'] /* HTML */,
       listeners : {
        render : function (_self)
         {
-            _this.panel = _self;
+            _this.hpanel = _self;
         }
       },
       xns : Roo,
@@ -113,11 +117,11 @@ Pman.Dialog.CoreEmailPreview = {
       fitContainer : true,
       fitToFrame : true,
       region : 'center',
-      title : _this._strings['4c4ad5fca2e7a3f74dbb1ced00381aa4'] /* HTML */,
+      title : _this._strings['4cd8413207629a963225f4314b53adcd'] /* Plain */,
       listeners : {
        render : function (_self)
         {
-            _this.hpanel = _self;
+            _this.panel = _self;
         }
       },
       xns : Roo,