PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminEmail.bjs
index c6baae2..1d2c6ba 100644 (file)
@@ -2,7 +2,7 @@
  "name" : "Pman.Dialog.BAdminEmail",
  "parent" : "",
  "title" : "Pman.Dialog.BAdminEmail",
- "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminEmail.bjs",
+ "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Dialog.BAdminEmail.bjs",
  "permname" : "",
  "modOrder" : "001",
  "strings" : {
   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
   "c4ca4238a0b923820dcc509a6f75849b" : "1",
   "1e6d57e813355689e9c77e947d73ad8f" : "From:",
-  "292f75d54a6892cfe18a93e64230112a" : "Mailout Name:",
   "47a0be8d1015d526a1fbaa56c3102135" : "Subject:",
   "5feb9bf3c03b32635135006cbacb9542" : "Insert Field",
+  "292f75d54a6892cfe18a93e64230112a" : "Mailout Name:",
   "7038eac66e387c3b3a0834d786a88757" : "Insert Image",
   "e71c729cd7f3c6b6ebdb447e65952dfd" : "From email address:",
   "edddfc18b2ffb806573a1b3f341832cd" : "BCC to Group:",
   "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version",
   "e44b145bd8b49b06e0ad2ced1ad56466" : "Plain Text",
   "c9cc8cce247e49bae79f15173ce97354" : "Save",
+  "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
   "49ee3087348e8d44e1feda1917443987" : "Name",
   "28690be026c0bb9003aa58e45e5662ca" : "Enabled - will be sent out",
   "fb981fe689fbec75c6531eb7410971f4" : "To group:",
   "e05f77bdf3f659c1fd354a88526c03da" : "Select Group",
   "36a65bbd12f7586ea1f9b0be4e8848aa" : "HTML Editor"
  },
+ "named_strings" : {
+  "description_fieldLabel" : "b5a7adde1af5c87d7fd797b6245c2a39",
+  "active_boxLabel" : "28690be026c0bb9003aa58e45e5662ca",
+  "save_html" : "c9cc8cce247e49bae79f15173ce97354",
+  "to_group_id_display_name_loadingText" : "843627586c62e389041a4d8800143974",
+  "bcc_group_id_name_placeholder" : "2c466a2c159463f1d9ef5a7b57b52827",
+  "name_fieldLabel" : "292f75d54a6892cfe18a93e64230112a",
+  "cancel_html" : "ea4788705e6873b424c65e91c2846b19",
+  "from_email_fieldLabel" : "e71c729cd7f3c6b6ebdb447e65952dfd",
+  "to_group_id_display_name_fieldLabel" : "fb981fe689fbec75c6531eb7410971f4",
+  "preview_html" : "31fde7b05ac8952dacf4af8a704074ec",
+  "active_value" : "c4ca4238a0b923820dcc509a6f75849b",
+  "to_group_id_display_name_placeholder" : "e05f77bdf3f659c1fd354a88526c03da",
+  "send_html" : "5b8ef4e762c00a15a41cfc26dc3ef99c",
+  "from_name_fieldLabel" : "1e6d57e813355689e9c77e947d73ad8f",
+  "bcc_group_id_name_loadingText" : "843627586c62e389041a4d8800143974",
+  "bcc_group_id_name_fieldLabel" : "edddfc18b2ffb806573a1b3f341832cd",
+  "subject_fieldLabel" : "47a0be8d1015d526a1fbaa56c3102135",
+  "test_class_fieldLabel" : "3858712080cb3d846ea206d1d1070674"
+ },
  "items" : [
   {
    "listeners" : {
@@ -44,6 +65,7 @@
    "xtype" : "Modal",
    "$ xns" : "Roo.bootstrap",
    "String title" : "Edit / Create Message",
+   "Boolean bodyOverflow" : true,
    "items" : [
     {
      "listeners" : {
       {
        "listeners" : {
         "actionfailed" : "function (_self, action)\n{\n\n   var displayErr = function() {\n       if(action.result.errorMsg.length >= 200) {\n           Roo.bootstrap.MessageBox.alert(\"Error\", action.result.errorMsg.substring(0,199) + '...');\n       } else {\n           Roo.bootstrap.MessageBox.alert(\"Error\", action.result.errorMsg);\n       }\n   }\n   switch(action.failureType) {\n    case Roo.form.Action.SERVER_INVALID: \n       if(action.result.errors.errcode) {\n           switch (action.result.errors.errcode) {\n               case 100:\n                   \n                   Roo.bootstrap.MessageBox.show({\n                       title: 'Confirm Save',\n                       msg: 'No member found in To Group: '+ _this.combo_to_group.getRawValue(),\n                       buttons: {yes:'OK Save anyway', no:'Change to another group'},\n                       fn: function(ret){\n                           \n                           if(ret == 'no'){\n                               return;\n                           }\n                            \n                           _this.form.findField('_ignore_group_count').setValue('1');\n                           _this.form.doAction(\"submit\");                       \n                       }\n                   });\n                 \n                   \n               break;\n               \n               default:\n                   displayErr();\n                   break;\n           }\n           return;\n       }\n       displayErr();\n       \n       break;\n    case Roo.form.Action.CLIENT_INVALID: //for validation\n       break;\n    case Roo.form.Action.CONNECT_FAILURE:\n       Roo.bootstrap.MessageBox.alert(\"Connect Error\", action.result.errorMsg);\n       break;\n    default: \n       Roo.bootstrap.MessageBox.alert(\"Error\", action.result.errorMsg);\n       break;\n       \n    }\n}",
-        "actioncomplete" : "function(_self,action)\n{\n   \n    if (action.type == 'setdata') {\n        \n        _this.data.module = _this.data.module || 'crm_mailing_list_message';\n        this.url = baseURL + '/Roo/' + _this.data.module;\n        \n        if(_this.data.id*1 > 0){\n            _this.dialog.el.mask(\"Loading\");\n            this.doAction(\n                'load',\n                { method: 'GET', params: { '_id' : _this.data.id, '_with_css' : 1 }}\n            );\n            return;\n        }\n        \n        this.findField('name').setDisabled(false);\n        this.findField('test_class').setDisabled(false);\n        \n        this.reset();\n        \n        this.findField('to_group_id').setValue(-1);\n        this.findField('bodytext').setValue('');\n        \n        this.setValues({\n            'from_name' : Pman.Login.authUser.name,\n            'from_email' : Pman.Login.authUser.email\n        });\n        \n        this.clearInvalid();\n        \n        this.hideshow();\n        \n        return;\n    }\n    \n    if (action.type == 'load') {\n        \n        this.findField('name').setDisabled(false);\n        this.findField('test_class').setDisabled(false);\n        \n        if(action.result.data['is_system'] == 1) {\n            this.findField('name').setDisabled(true);\n            this.findField('test_class').setDisabled(true);\n        }\n        \n        _this.dialog.el.unmask();\n        \n        this.findField('bodytext').originalValue = this.findField('bodytext').getValue();\n        \n        _this.form_data = action.result.data;\n        \n        if(_this.form_data._css && _this.form_data._css.length){\n            _this.htmleditor.editorcore.setStyle(_this.form_data._css);\n        }\n        \n        this.findField('_ignore_group_count').setValue('0');\n        \n        this.hideshow();\n        \n        return;\n    }\n    \n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n        \n         if (_this.callback) {\n            _this.callback.call(_this, action.result.data);\n         }\n         \n         this.reset();\n         \n         return;\n    }\n}\n",
+        "actioncomplete" : "function(_self,action)\n{\n   \n    if (action.type == 'setdata') {\n        \n        _this.data.module = _this.data.module || 'crm_mailing_list_message';\n        this.url = baseURL + '/Roo/' + _this.data.module;\n        \n        if(_this.data.id*1 > 0){\n            _this.dialog.el.mask(\"Loading\");\n            this.doAction(\n                'load',\n                { method: 'GET', params: { '_id' : _this.data.id, '_with_css' : 1 }}\n            );\n            return;\n        }\n        \n        //this.findField('name').setDisabled(false);\n        //this.findField('test_class').setDisabled(false);\n        \n        this.reset();\n        \n        this.findField('to_group_id').setValue(-1);\n        this.findField('bodytext').setValue('');\n        \n        this.setValues({\n            'from_name' : Pman.Login.authUser.name,\n            'from_email' : Pman.Login.authUser.email\n        });\n        \n        this.clearInvalid();\n        \n        this.hideshow();\n        \n        return;\n    }\n    \n    if (action.type == 'load') {\n        \n        /*\n        this.findField('name').setDisabled(false);\n        this.findField('test_class').setDisabled(false);\n        \n        if(action.result.data['is_system'] == 1) {\n            this.findField('name').setDisabled(true);\n            this.findField('test_class').setDisabled(true);\n        }\n        */\n        \n        _this.dialog.el.unmask();\n        \n        this.findField('bodytext').originalValue = this.findField('bodytext').getValue();\n        \n        _this.form_data = action.result.data;\n        \n        if(_this.form_data._css && _this.form_data._css.length){\n            _this.htmleditor.editorcore.setStyle(_this.form_data._css);\n        }\n        \n        this.findField('_ignore_group_count').setValue('0');\n        \n        if(!_this.form_data.description.length){\n            _this.form_data.findField('description').setValue(_this.form_data.name);\n        }\n        \n        this.hideshow();\n        \n        return;\n    }\n    \n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n        \n         if (_this.callback) {\n            _this.callback.call(_this, action.result.data);\n         }\n         \n         this.reset();\n         \n         return;\n    }\n}\n",
         "render" : "function (_self)\n{\n    _this.form = this;\n}"
        },
        "| function hideshow" : "function()\n{\n    _this.to_group_row.hide();\n    \n    if (this.findField('to_group_id').getValue() == -1) {\n        return;\n    }\n    \n    _this.to_group_row.show();\n}",
            "items" : [
             {
              "Boolean allowBlank" : false,
-             "String name" : "name",
+             "String name" : "description",
              "xtype" : "Input",
-             "string fieldLabel" : "Mailout Name:",
+             "string fieldLabel" : "Description",
              "$ xns" : "Roo.bootstrap",
              "Number labelWidth" : 3,
              "String indicatorpos" : "right"
              "Boolean allowBlank" : true,
              "String loadingText" : "Searching",
              "Number pageSize" : 20,
-             "String name" : "to_group_id_name",
+             "String name" : "to_group_id_display_name",
              "Number minChars" : 2,
              "String valueField" : "id",
              "Boolean typeAhead" : true,
              "$ xns" : "Roo.bootstrap",
              "Number labelWidth" : 4,
              "String hiddenName" : "to_group_id",
-             "String displayField" : "name",
+             "String displayField" : "display_name",
              "Boolean forceSelection" : true,
              "String indicatorpos" : "right",
              "items" : [
               {
                "listeners" : {
-                "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._direct_return = 1;\n}\n"
+                "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._direct_return = 1;\n    o.params.limit = 100;\n}\n"
                },
                "$ Object sortInfo" : "{ direction : 'ASC', field: 'name' }",
                "xtype" : "Store",
                  "$ String url" : "baseURL + '/Roo/Core_group'"
                 },
                 {
-                 "$ Array fields" : "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"id\",\"type\":\"int\"}]",
+                 "$ Array fields" : "['name','display_name',{\"name\":\"id\",\"type\":\"int\"}]",
                  "xtype" : "JsonReader",
                  "String root" : "data",
                  "$ xns" : "Roo.data",
            "items" : [
             {
              "String header" : "HTML Editor",
-             "String panel" : "default",
              "xtype" : "Container",
+             "String panel" : "default",
              "$ xns" : "Roo.bootstrap",
              "items" : [
               {
                "items" : [
                 {
                  "listeners" : {
-                  "click" : "function (_self, e)\n{\n    if (!_this.form.findField('bodytext').editorcore.activated) {\n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select a place in the belowing text area where the image will insert at');\n        return;\n    }\n    \n    var id = _this.form.findField('id').getValue();\n    \n    if(id*1 < 1){\n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please save the email template first');\n        return;\n    }\n    \n    var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';\n    \n    Pman.Dialog.BAdminImageManager.show({\n        id : 0,\n        onid: id,\n        ontable: ontable\n    }, function(img){\n        _this.form.findField('bodytext').editorcore.insertAtCursor(\n            String.format(\n                '<img src=\"{0}/Images/{1}/{2}#image-{1}\" height=\"{3}\" width=\"{4}\" alt=\"{5}\" align=\"{6}\">',\n                baseURL,\n                img.id,\n                img.filename,\n                img.height,\n                img.width,\n                img.alt,\n                img.align\n            )\n        )\n    });\n    \n}"
+                  "click" : "function (_self, e)\n{\n    if (!_this.form.findField('bodytext').editorcore.activated) {\n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select a place in the belowing text area where the image will insert at');\n        return;\n    }\n    \n    var id = _this.form.findField('id').getValue();\n    \n    if(id*1 < 1){\n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please save the email template first');\n        return;\n    }\n    \n    var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';\n    \n    Pman.Dialog.BAdminImageManager.show({\n        id: 0,\n        onid: id,\n        ontable: ontable\n    }, function(img){\n        _this.form.findField('bodytext').editorcore.insertAtCursor(\n            String.format(\n                '<img src=\"{0}/Images/{1}/{2}#image-{1}\" height=\"{3}\" width=\"{4}\" alt=\"{5}\" align=\"{6}\">',\n                baseURL,\n                img.id,\n                img.filename.replace('%', '-'),\n                img.height,\n                img.width,\n                img.descript,\n                img.align\n            )\n        )\n    });\n    \n}"
                  },
                  "Boolean toggle" : false,
                  "xtype" : "Button",
           {
            "Number md" : 6,
            "xtype" : "Column",
-           "$ xns" : "Roo.bootstrap"
+           "$ xns" : "Roo.bootstrap",
+           "items" : [
+            {
+             "Boolean allowBlank" : false,
+             "String name" : "name",
+             "xtype" : "Input",
+             "string fieldLabel" : "Mailout Name:",
+             "String labelAlign" : "top",
+             "Boolean disabled" : true,
+             "$ xns" : "Roo.bootstrap",
+             "String indicatorpos" : "right"
+            }
+           ]
           },
           {
            "Number md" : 6,
              "xtype" : "Input",
              "string fieldLabel" : "Test Class (for system reference only):",
              "String labelAlign" : "top",
+             "Boolean disabled" : true,
              "$ xns" : "Roo.bootstrap"
             }
            ]