Pman.Dialog.BAdminEmail.bjs
authorbenny <benny@roojs.com>
Mon, 23 Jul 2018 04:16:04 +0000 (12:16 +0800)
committerbenny <benny@roojs.com>
Mon, 23 Jul 2018 04:16:04 +0000 (12:16 +0800)
Pman.Dialog.BAdminEmail.js

Pman.Dialog.BAdminEmail.bjs
Pman.Dialog.BAdminEmail.js

index f6f6cb4..0133b55 100644 (file)
@@ -95,7 +95,7 @@
      "items" : [
       {
        "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                   Roo.bootstrap.MessageBox.confirm('Confirm Save', 'No member found in To Group: ' + _this.combo_to_group.getRawValue() ,function(ret) {\n                       if(ret == 'no'){\n                           return;\n                       }\n                       _this.form.findField('_ignore_group_count').setValue('1');\n                       _this.form.doAction(\"submit\");                       \n                   }, this);\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}",
+        "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                   Roo.bootstrap.MessageBox.buttonText.yes = \"try\";\n                   Roo.bootstrap.MessageBox.buttonText.no = \"tryno\";\n                   Roo.bootstrap.MessageBox.confirm('Confirm Save', 'No member found in To Group: ' + _this.combo_to_group.getRawValue() ,function(ret) {\n                       if(ret == 'no'){\n                           return;\n                       }\n                       _this.form.findField('_ignore_group_count').setValue('1');\n                       _this.form.doAction(\"submit\");                       \n                   }, this);\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",
         "render" : "function (_self)\n{\n    _this.form = this;\n}"
        },
index a900fd8..241b810 100644 (file)
@@ -366,6 +366,8 @@ Roo.apply(Pman.Dialog.BAdminEmail.prototype, {
                  if(action.result.errors.errcode) {
                      switch (action.result.errors.errcode) {
                          case 100:
+                             Roo.bootstrap.MessageBox.buttonText.yes = "try";
+                             Roo.bootstrap.MessageBox.buttonText.no = "tryno";
                              Roo.bootstrap.MessageBox.confirm('Confirm Save', 'No member found in To Group: ' + _this.combo_to_group.getRawValue() ,function(ret) {
                                  if(ret == 'no'){
                                      return;