Kaynağa Gözat

密码过期界面

unknown 5 yıl önce
ebeveyn
işleme
6353423785

+ 2 - 1
o2web/source/o2_core/o2/lp/zh-cn.js

@@ -418,7 +418,8 @@ o2.LP.authentication = {
     "oldPassword" : "原密码",
     "oldPassword" : "原密码",
     "inputYourOldPassword" : "请输入原密码",
     "inputYourOldPassword" : "请输入原密码",
     "newPassword" : "新密码",
     "newPassword" : "新密码",
-    "inputYourNewPassword" : "请输入新密码"
+    "inputYourNewPassword" : "请输入新密码",
+    "changePasswordSuccess" : "修改密码成功"
 
 
 
 
 };
 };

+ 93 - 82
o2web/source/o2_core/o2/xDesktop/Authentication.js

@@ -2075,26 +2075,35 @@ MWF.xDesktop.Authentication.ChangePasswordForm = new Class({
         "closeAction": true
         "closeAction": true
     },
     },
     _createTableContent: function () {
     _createTableContent: function () {
+        var self = this;
 
 
+        this.actions = MWF.Actions.get("x_organization_assemble_personal");
 
 
         var html = "<table width='100%' bordr='0' cellpadding='0' cellspacing='0' styles='formTable'>" +
         var html = "<table width='100%' bordr='0' cellpadding='0' cellspacing='0' styles='formTable'>" +
-            "<tr><td styles='formTableValue' item='password'></td></tr>" +
-            "<tr><td styles='formTableValue' item='newPassword'></td>" +
-            "<tr><td styles='formTableValue'><div item='passwordStrengthArea'></div></div><div item='passwordTip'></div></td></tr>" +
-            "<tr><td styles='formTableValue' item='confirmPassword'></td>" +
-            "<tr><td styles='formTableValue' item='confirmPasswordTip'></td></tr>" +
+            "<tr><td styles='formTableValueTop20' item='password'></td></tr>" +
+            "<tr><td styles='formTableValueTop20' item='newPassword'></td>" +
+            "<tr><td styles='formTableValue'><div item='passwordTip'></div></td></tr>" +
+            "<tr><td styles='formTableValueTop20' item='confirmPassword'></td>" +
             "<tr><td styles='formTableValueTop20' item='submitAction'></td></tr>" +
             "<tr><td styles='formTableValueTop20' item='submitAction'></td></tr>" +
-            "<tr><td><div item='forgetPassword'></div></td></tr>"+
+            "<tr><td><div item='forgetPassword'></div><div item='gotoLoginAction'></div></td></tr>"+
             "<tr><td  styles='formTableValue' item='errorArea'></td></tr>" +
             "<tr><td  styles='formTableValue' item='errorArea'></td></tr>" +
             "</table>";
             "</table>";
 
 
         this.formTableArea.set("html", html);
         this.formTableArea.set("html", html);
 
 
+        this.errorArea = this.formTableArea.getElement("[item=errorArea]");
+
         MWF.xDesktop.requireApp("Template", "MForm", function () {
         MWF.xDesktop.requireApp("Template", "MForm", function () {
             this.form = new MForm(this.formTableArea, this.data, {
             this.form = new MForm(this.formTableArea, this.data, {
                 style: this.options.popupStyle,
                 style: this.options.popupStyle,
                 verifyType: "single",	//batch一起校验,或alert弹出
                 verifyType: "single",	//batch一起校验,或alert弹出
                 isEdited: this.isEdited || this.isNew,
                 isEdited: this.isEdited || this.isNew,
+                onPostLoad: function () {
+                    var form = this.form;
+                    form.getItem("password").tipNode = this.errorArea;
+                    form.getItem("newPassword").tipNode = this.errorArea;
+                    form.getItem("confirmPassword").tipNode = this.errorArea;
+                }.bind(this),
                 itemTemplate: {
                 itemTemplate: {
                     password: {
                     password: {
                         text: this.lp.oldPassword,
                         text: this.lp.oldPassword,
@@ -2103,13 +2112,14 @@ MWF.xDesktop.Authentication.ChangePasswordForm = new Class({
                         notEmpty: true,
                         notEmpty: true,
                         defaultValueAsEmpty: true,
                         defaultValueAsEmpty: true,
                         emptyTip: this.lp.inputYourOldPassword,
                         emptyTip: this.lp.inputYourOldPassword,
-                        attr : { "placeholder" : this.lp.oldPassword },
+                        attr: {"placeholder": this.lp.oldPassword},
                         event: {
                         event: {
                             focus: function (it) {
                             focus: function (it) {
                                 if ("password" === it.getValue()) it.setValue("");
                                 if ("password" === it.getValue()) it.setValue("");
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputActive);
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputActive);
                             }.bind(this),
                             }.bind(this),
                             blur: function (it) {
                             blur: function (it) {
+                                // it.verify(true);
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputPassword);
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputPassword);
                             }.bind(this),
                             }.bind(this),
                             keyup: function (it, ev) {
                             keyup: function (it, ev) {
@@ -2126,74 +2136,103 @@ MWF.xDesktop.Authentication.ChangePasswordForm = new Class({
                     newPassword: {
                     newPassword: {
                         text: this.lp.newPassword,
                         text: this.lp.newPassword,
                         type: "password",
                         type: "password",
-                        attr : { "placeholder" : this.lp.newPassword },
                         className: "inputPassword",
                         className: "inputPassword",
                         notEmpty: true,
                         notEmpty: true,
                         defaultValueAsEmpty: true,
                         defaultValueAsEmpty: true,
                         emptyTip: this.lp.inputYourNewPassword,
                         emptyTip: this.lp.inputYourNewPassword,
+                        attr: {"placeholder": this.lp.newPassword},
+                        validRule: {
+                            passwordIsWeak: function (value, it) {
+                                return !this.getPasswordRule(it.getValue());
+                            }.bind(this)
+                        },
+                        validMessage: {
+                            passwordIsWeak: function () {
+                                return self.getPasswordRule(this.getValue());
+                            }
+                        },
                         event: {
                         event: {
                             focus: function (it) {
                             focus: function (it) {
-                                if ("password" === it.getValue()) it.setValue("");
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputActive);
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputActive);
                             }.bind(this),
                             }.bind(this),
                             blur: function (it) {
                             blur: function (it) {
-                                if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputPassword);
+                                // it.verify(true);
                             }.bind(this),
                             }.bind(this),
                             keyup: function (it, ev) {
                             keyup: function (it, ev) {
-                                if (ev.event.keyCode === 13) this.ok();
+                                if (ev.event.keyCode === 13)this.ok();
                             }.bind(this)
                             }.bind(this)
                         },
                         },
                         onEmpty: function (it) {
                         onEmpty: function (it) {
                             it.getElements()[0].setStyles(this.css.inputEmpty);
                             it.getElements()[0].setStyles(this.css.inputEmpty);
                         }.bind(this),
                         }.bind(this),
-                        onUnempty: function (it) {
+                         onUnempty: function (it) {
                             it.getElements()[0].setStyles(this.css.inputPassword);
                             it.getElements()[0].setStyles(this.css.inputPassword);
                         }.bind(this)
                         }.bind(this)
                     },
                     },
                     confirmPassword: {
                     confirmPassword: {
-                        text: this.lp.confirmPassword,
+                        text: this.lp.confirmNewPassword,
                         type: "password",
                         type: "password",
-                        attr : { "placeholder" : this.lp.confirmPassword },
-                        className: "inputPassword",
+                        className: "inputComfirmPassword",
                         notEmpty: true,
                         notEmpty: true,
                         defaultValueAsEmpty: true,
                         defaultValueAsEmpty: true,
-                        emptyTip: this.lp.inputYourNewPassword,
+                         emptyTip: this.lp.inputComfirmPassword,
+                        attr: {"placeholder": this.lp.confirmPassword},
+                        validRule: {
+                            passwordNotEqual: function (value, it) {
+                                if (it.getValue() === this.form.getItem("newPassword").getValue()) return true;
+                            }.bind(this)
+                        },
+                        validMessage: {passwordNotEqual: this.lp.passwordNotEqual},
                         event: {
                         event: {
                             focus: function (it) {
                             focus: function (it) {
-                                if ("password" === it.getValue()) it.setValue("");
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputActive);
                                 if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputActive);
                             }.bind(this),
                             }.bind(this),
                             blur: function (it) {
                             blur: function (it) {
-                                if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputPassword);
+                                // it.verify(true);
+                                if (!it.warningStatus) it.getElements()[0].setStyles(this.css.inputComfirmPassword);
                             }.bind(this),
                             }.bind(this),
                             keyup: function (it, ev) {
                             keyup: function (it, ev) {
-                                if (ev.event.keyCode === 13) this.ok();
+                                if (ev.event.keyCode === 13)this.ok();
                             }.bind(this)
                             }.bind(this)
                         },
                         },
                         onEmpty: function (it) {
                         onEmpty: function (it) {
                             it.getElements()[0].setStyles(this.css.inputEmpty);
                             it.getElements()[0].setStyles(this.css.inputEmpty);
                         }.bind(this),
                         }.bind(this),
-                        onUnempty: function (it) {
-                            it.getElements()[0].setStyles(this.css.inputPassword);
+                         onUnempty: function (it) {
+                            it.getElements()[0].setStyles(this.css.inputComfirmPassword);
                         }.bind(this)
                         }.bind(this)
                     },
                     },
-                    submitAction: {
-                        value: this.lp.submitAction,
-                        type: "button",
-                        className: "inputLogin",
+
+                    forgetPassword: {
+                        value: this.lp.forgetPassword,
+                        type: "innerText",
+                        className: "forgetPassword",
                         event: {
                         event: {
                             click: function () {
                             click: function () {
-                                this.ok();
+                                this.gotoResetPassword();
                             }.bind(this)
                             }.bind(this)
                         }
                         }
                     },
                     },
-                    forgetPassword: {
-                        value: this.lp.forgetPassword,
+                    gotoLoginAction: {
+                        value: this.lp.loginAction,
+                        type: "innerText",
+                        className: "signUpAction",
+                        event: {
+                            click: function () { this.gotoLogin() }.bind(this)
+                        }
+                    },
+                    passwordTip: {
                         type: "innerText",
                         type: "innerText",
                         className: "forgetPassword",
                         className: "forgetPassword",
+                        defaultValue: layout.config.passwordRegexHint || ""
+                    },
+                    submitAction: {
+                        value: this.lp.submitAction,
+                        type: "button",
+                        className: "inputLogin",
                         event: {
                         event: {
                             click: function () {
                             click: function () {
-                                this.gotoResetPassword();
+                                this.ok();
                             }.bind(this)
                             }.bind(this)
                         }
                         }
                     }
                     }
@@ -2203,6 +2242,17 @@ MWF.xDesktop.Authentication.ChangePasswordForm = new Class({
         }.bind(this), true);
         }.bind(this), true);
 
 
     },
     },
+    gotoLogin: function () {
+        this.explorer.openLoginForm({}, function () { window.location.reload(); });
+        this.close();
+    },
+    getPasswordRule: function (password) {
+        var str = "";
+        this.actions.checkRegisterPassword(password, function (json) {
+            str = json.data.value || "";
+        }.bind(this), null, false);
+        return str;
+    },
     gotoResetPassword: function () {
     gotoResetPassword: function () {
         this.explorer.openResetPasswordForm();
         this.explorer.openResetPasswordForm();
         this.close();
         this.close();
@@ -2210,38 +2260,18 @@ MWF.xDesktop.Authentication.ChangePasswordForm = new Class({
     ok: function () {
     ok: function () {
         this.fireEvent("queryOk");
         this.fireEvent("queryOk");
         this.errorArea.empty();
         this.errorArea.empty();
-        var captchaItem = null;
-        var codeItem = null;
-        if (this.loginType === "captcha") {
-            this.form.getItem("password").options.notEmpty = true;
-
-            if (this.captchaLogin) {
-                captchaItem = this.form.getItem("captchaAnswer");
-                if (captchaItem) captchaItem.options.notEmpty = true;
-            }
-
-            codeItem = this.form.getItem("codeAnswer");
-            if (codeItem) codeItem.options.notEmpty = false;
-        } else if (this.loginType === "code") {
-            this.form.getItem("password").options.notEmpty = false;
-            if (this.captchaLogin) {
-                captchaItem = this.form.getItem("captchaAnswer");
-                if (captchaItem) captchaItem.options.notEmpty = false;
-            }
-            codeItem = this.form.getItem("codeAnswer");
-            if (codeItem) codeItem.options.notEmpty = true;
-        }
         var data = this.form.getResult(true, ",", true, false, true);
         var data = this.form.getResult(true, ",", true, false, true);
         if (data) {
         if (data) {
             this._ok(data, function (json) {
             this._ok(data, function (json) {
                 if (json.type === "error") {
                 if (json.type === "error") {
                     if (this.app) this.app.notice(json.message, "error");
                     if (this.app) this.app.notice(json.message, "error");
                 } else {
                 } else {
+
                     this._close();
                     this._close();
                     if (this.formMaskNode) this.formMaskNode.destroy();
                     if (this.formMaskNode) this.formMaskNode.destroy();
                     this.formAreaNode.destroy();
                     this.formAreaNode.destroy();
                     if (this.explorer && this.explorer.view) this.explorer.view.reload();
                     if (this.explorer && this.explorer.view) this.explorer.view.reload();
-                    if (this.app) this.app.notice(this.lp.loginSuccess, "success");
+                    if (this.app) this.app.notice(this.lp.changePasswordSuccess, "success");
                     this.fireEvent("postOk", json);
                     this.fireEvent("postOk", json);
                 }
                 }
             }.bind(this));
             }.bind(this));
@@ -2255,37 +2285,18 @@ MWF.xDesktop.Authentication.ChangePasswordForm = new Class({
         }).inject(this.errorArea);
         }).inject(this.errorArea);
     },
     },
     _ok: function (data, callback) {
     _ok: function (data, callback) {
-        var d = null;
-        if (this.loginType === "captcha") {
-            d = {
-                credential: data.credential,
-                password: data.password
-            };
-            if (this.captchaLogin) {
-                d.captchaAnswer = data.captchaAnswer;
-                d.captcha = this.captcha;
-            }
-            this.actions.loginByCaptcha(d, function (json) {
-                if (callback) callback(json);
-                //this.fireEvent("postOk")
-            }.bind(this), function (errorObj) {
-                var error = JSON.parse(errorObj.responseText);
-                this.setWarning(error.message);
-                this.setCaptchaPic();
-                if (this.form.getItem("captchaAnswer")) this.form.getItem("captchaAnswer").setValue("");
-            }.bind(this));
-        } else if (this.loginType === "code") {
-            d = {
-                credential: data.credential,
-                codeAnswer: data.codeAnswer
-            };
-            this.actions.loginByCode(d, function (json) {
-                if (callback) callback(json);
-                //this.fireEvent("postOk")
-            }.bind(this), function (errorObj) {
-                var error = JSON.parse(errorObj.responseText);
-                this.setWarning(error.message);
-            }.bind(this));
+        debugger;
+        var d = {
+            oldPassword : data.password,
+            newPassword : data.newPassword,
+            confirmPassword : data.confirmPassword
         }
         }
+        o2.Actions.load("x_organization_assemble_personal").PasswordAction.changePassword( d, function (json) {
+            if (callback) callback(json);
+            //this.fireEvent("postOk")
+        }.bind(this), function (errorObj) {
+            var error = JSON.parse(errorObj.responseText);
+            this.setWarning(error.message);
+        }.bind(this) )
     }
     }
 });
 });

+ 12 - 2
o2web/source/x_component_Calendar/Common.js

@@ -1232,8 +1232,18 @@ MWFCalendar.CalendarForm = new Class({
             form.load();
             form.load();
         }.bind(this), true);
         }.bind(this), true);
     },
     },
-    deleteCalendar : function(){
-
+    deleteCalendar : function( e ){
+        var _self = this;
+        _self.app.confirm("warn", e,  "删除确认", "删除后无法恢复,确定要删除“"+ _self.data.name +"”?", 300, 120, function(){
+            _self.app.actions.deleteCalendar( _self.data.id, function( json ){
+                _self.close();
+                _self.app.notice("删除成功");
+                _self.app.leftNavi.reload();
+            }.bind(this));
+            this.close();
+        }, function(){
+            this.close();
+        }, null);
     },
     },
     editCalendar : function(){
     editCalendar : function(){
         this.formTopNode = null;
         this.formTopNode = null;

+ 1 - 0
o2web/source/x_component_Org/UnitExplorer.js

@@ -591,6 +591,7 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({
                         var _dutyData = this.data;
                         var _dutyData = this.data;
                         this.data.woIdentityList.each(function(identity, i){
                         this.data.woIdentityList.each(function(identity, i){
                             new MWF.widget.O2Identity(identity, contentNode, {
                             new MWF.widget.O2Identity(identity, contentNode, {
+                                "lazy" : true,
                                 "canRemove": _self.data.control.allowEdit,
                                 "canRemove": _self.data.control.allowEdit,
                                 "onRemove": function(O2Identity, e){
                                 "onRemove": function(O2Identity, e){
                                     _self.deleteDutyIdentity(_dutyData, e, O2Identity);
                                     _self.deleteDutyIdentity(_dutyData, e, O2Identity);

+ 7 - 2
o2web/source/x_component_Selector/Person.js

@@ -1743,10 +1743,8 @@ MWF.xApplication.Selector.Person.Item = new Class({
         }else{
         }else{
             if (this.isSelected){
             if (this.isSelected){
                 this.unSelected();
                 this.unSelected();
-                this.selector.fireEvent("unselectItem",[this])
             }else{
             }else{
                 this.selected();
                 this.selected();
-                this.selector.fireEvent("selectItem",[this])
             }
             }
         }
         }
     },
     },
@@ -1799,6 +1797,9 @@ MWF.xApplication.Selector.Person.Item = new Class({
                 if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
                 if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
                     this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
                     this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
                 }
                 }
+
+                this.selector.fireEvent("selectItem",[this])
+
             }.bind(this));
             }.bind(this));
         }else {
         }else {
             this.unSelectedSingle();
             this.unSelectedSingle();
@@ -1820,6 +1821,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
         if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
         if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
             this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
             this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
         }
         }
+        this.selector.fireEvent("unselectItem",[this])
     },
     },
     selected: function(){
     selected: function(){
         var count = this.selector.options.maxCount || this.selector.options.count;
         var count = this.selector.options.maxCount || this.selector.options.count;
@@ -1843,6 +1845,8 @@ MWF.xApplication.Selector.Person.Item = new Class({
             this.selectedItem = this.selector._newItemSelected(this.data, this.selector, this);
             this.selectedItem = this.selector._newItemSelected(this.data, this.selector, this);
             this.selectedItem.check();
             this.selectedItem.check();
             this.selector.selectedItems.push(this.selectedItem);
             this.selector.selectedItems.push(this.selectedItem);
+
+            this.selector.fireEvent("selectItem",[this])
         }else{
         }else{
             MWF.xDesktop.notice("error", {x: "right", y:"top"}, "最多可选择"+count+"个选项", this.node);
             MWF.xDesktop.notice("error", {x: "right", y:"top"}, "最多可选择"+count+"个选项", this.node);
         }
         }
@@ -1911,6 +1915,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
             this.selectedItem.destroy();
             this.selectedItem.destroy();
             this.selectedItem = null;
             this.selectedItem = null;
         }
         }
+        this.selector.fireEvent("unselectItem",[this])
     },
     },
     postLoad : function(){},
     postLoad : function(){},
     getParentCategoryByLevel : function( level ){
     getParentCategoryByLevel : function( level ){

+ 3 - 2
o2web/source/x_component_process_Application/WorkExplorer.js

@@ -1468,10 +1468,11 @@ MWF.xApplication.process.Application.WorkExplorer.Task = new Class({
     flow: function(e){
     flow: function(e){
         this.node.setStyles(this.css.taskItemNode_action);
         this.node.setStyles(this.css.taskItemNode_action);
         this.processNode = new Element("div", {"styles": this.css.taskItemFlowNode}).inject(this.explorer.app.content);
         this.processNode = new Element("div", {"styles": this.css.taskItemFlowNode}).inject(this.explorer.app.content);
+        this.processNode.setStyles({"overflow":"auto"});
 
 
         MWF.require("MWF.xDesktop.Dialog", function(){
         MWF.require("MWF.xDesktop.Dialog", function(){
-            var width = 540;
-            var height = 260;
+            var width = 560;
+            var height = 400;
             var size = this.explorer.app.content.getSize();
             var size = this.explorer.app.content.getSize();
             var x = size.x/2-width/2;
             var x = size.x/2-width/2;
             var y = size.y/2-height/2;
             var y = size.y/2-height/2;

+ 7 - 7
o2web/source/x_component_process_FormDesigner/Module/Subform.js

@@ -246,14 +246,14 @@ MWF.xApplication.process.FormDesigner.Module.Subform = MWF.FCSubform = new Class
 		this.iconNode.getFirst("div").setStyles(this.css.iconNodeIcon);
 		this.iconNode.getFirst("div").setStyles(this.css.iconNodeIcon);
 		this.iconNode.getLast("div").setStyles(this.css.iconNodeText);
 		this.iconNode.getLast("div").setStyles(this.css.iconNodeText);
 	},
 	},
-    _setEditStyle: function(name, input, oldValue){
-		if (name==="subformSelected"){
-			if (this.json.subformSelected!==oldValue){
+    _setEditStyle_custom : function(name, input, oldValue){
+        if (name==="subformSelected"){
+            if (this.json.subformSelected!==oldValue){
                 this.redoSelectedSubform(name, input, oldValue);
                 this.redoSelectedSubform(name, input, oldValue);
-			}
-		}
+            }
+        }
         if (name==="subformType"){
         if (name==="subformType"){
-		    if (this.json.subformType!==oldValue){
+            if (this.json.subformType!==oldValue){
                 if (this.json.subformType !== "script"){
                 if (this.json.subformType !== "script"){
                     this.redoSelectedSubform(name, $(this.property.data.pid+"selectSubform").getElement("select"), "");
                     this.redoSelectedSubform(name, $(this.property.data.pid+"selectSubform").getElement("select"), "");
                 }
                 }
@@ -265,7 +265,7 @@ MWF.xApplication.process.FormDesigner.Module.Subform = MWF.FCSubform = new Class
                 }
                 }
             }
             }
         }
         }
-	},
+    },
     redoSelectedSubform: function(name, input, oldValue){
     redoSelectedSubform: function(name, input, oldValue){
         if (this.json.subformSelected==="none") this.json.subformSelected="";
         if (this.json.subformSelected==="none") this.json.subformSelected="";
         if (this.json.subformSelected && this.json.subformSelected!=="none"){
         if (this.json.subformSelected && this.json.subformSelected!=="none"){