DataObjects/core.sql
[Pman.Core] / Pman.Dialog.CoreMailingListMessage.bjs
index 944d8ca..532b97c 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "id": "roo-file-315",
+    "id": "roo-file-178",
     "name": "Pman.Dialog.CoreMailingListMessage",
     "parent": "",
     "title": "",
@@ -60,7 +60,7 @@
                                             "items": [
                                                 {
                                                     "listeners": {
-                                                        "click": "function (_self, e)\n{\n    Pman.Dialog.CoreImportUrl.show({\n        target : '/Crm/ImportHtml.php'\n    }, function(data) {\n        if  (data) {\n          //  Roo.log(data);\n            _this.form.findField('bodytext').setValue(data);\n\n        }\n    });\n}"
+                                                        "click": "function (_self, e)\n{\n    Pman.Dialog.CoreImportUrl.show({\n        target : '/Crm/ImportHtml.php'\n    }, function(data) {\n        if  (data) {\n          //  Roo.log(data);\n            _this.form.findField('bodytext').setValue(data);\n        }\n    });\n}"
                                                     },
                                                     "text": "URL",
                                                     "xtype": "Item",
@@ -70,7 +70,7 @@
                                                     "listeners": {
                                                         "click": "function (_self, e)\n{\n    Pman.Dialog.Image.show({\n        _url : baseURL + '/Crm/ImportHtml.php'\n    }, function(data) {\n        if  (data) {\n            _this.form.findField('bodytext').setValue(data);\n        }\n    });\n}"
                                                     },
-                                                    "text": "File",
+                                                    "text": "Html File",
                                                     "xtype": "Item",
                                                     "|xns": "Roo.menu"
                                                 }
                                         }
                                     ]
                                 },
+                                {
+                                    "listeners": {
+                                        "select": "function (combo, record, index)\n{\n    Roo.log(record);\n/*\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n*/    \n    _this.form.findField('bodytext').setValue(record.data.content);\n\n}"
+                                    },
+                                    "allowBlank": true,
+                                    "alwaysQuery": true,
+                                    "displayField": "file",
+                                    "editable": false,
+                                    "emptyText": "Select Template",
+                                    "fieldLabel": "Template",
+                                    "forceSelection": true,
+                                    "hiddenName": "template",
+                                    "listWidth": 400,
+                                    "loadingText": "Searching...",
+                                    "minChars": 2,
+                                    "name": "template",
+                                    "pageSize": 20,
+                                    "qtip": "Select Template",
+                                    "selectOnFocus": true,
+                                    "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{file}</b> </div>",
+                                    "triggerAction": "all",
+                                    "typeAhead": true,
+                                    "valueField": "file",
+                                    "width": 200,
+                                    "xtype": "ComboBox",
+                                    "|xns": "Roo.form",
+                                    "items": [
+                                        {
+                                            "listeners": {
+                                                "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
+                                            },
+                                            "*prop": "store",
+                                            "remoteSort": true,
+                                            "xtype": "Store",
+                                            "|sortInfo": "{ direction : 'DESC', field: 'file' }",
+                                            "|xns": "Roo.data",
+                                            "items": [
+                                                {
+                                                    "*prop": "proxy",
+                                                    "method": "GET",
+                                                    "xtype": "HttpProxy",
+                                                    "|url": "baseURL + '/Core/MailTemplateList.php'",
+                                                    "|xns": "Roo.data"
+                                                },
+                                                {
+                                                    "*prop": "reader",
+                                                    "id": "name",
+                                                    "root": "data",
+                                                    "totalProperty": "total",
+                                                    "xtype": "JsonReader",
+                                                    "|fields": "[{\"name\":\"file\",\"type\":\"string\"},{\"name\":\"content\",\"type\":\"string\"}]",
+                                                    "|xns": "Roo.data"
+                                                }
+                                            ]
+                                        }
+                                    ]
+                                },
                                 {
                                     "|xns": "Roo.Toolbar",
                                     "xtype": "Fill"
                                                                                     "items": [
                                                                                         {
                                                                                             "listeners": {
-                                                                                                "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n\n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save press release first\");\n        return false;\n    }\n    o.params.onid = id\n    o.params.ontable = 'crm_mailing_list_message';\n    \n   // o.params.imgtype = 'PressRelease';\n    //o.params['query[imagesize]'] = '150x150';\n    // set more here\n}\n"
+                                                                                                "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n\n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save email template first\");\n        return false;\n    }\n    o.params.onid = id\n    o.params.ontable = 'core_mailing_list_message';\n    \n   // o.params.imgtype = 'PressRelease';\n    //o.params['query[imagesize]'] = '150x150';\n    // set more here\n}\n"
                                                                                             },
                                                                                             "*prop": "store",
                                                                                             "remoteSort": true,