diff --git a/o2web/source/x_component_Forum/Attachment.js b/o2web/source/x_component_Forum/Attachment.js index c7f3b5c67d1fafd49c9c31fb94e1b69c3f48e652..e3070ce8107afb19e96f7872c0aa536d67be005d 100644 --- a/o2web/source/x_component_Forum/Attachment.js +++ b/o2web/source/x_component_Forum/Attachment.js @@ -124,12 +124,6 @@ MWF.xApplication.Forum.AttachmentController.Attachment = new Class({ initialize: function(data, controller, messageId, isCheckPosition){ this.data = data; - if(MWFForum.isUseNickName()){ - this.data.person = this.data.nickName; - }else if(!this.data.person && this.data.creatorUid ){ - this.data.person = this.data.creatorUid; - } - this.controller = controller; this.css = this.controller.css; this.listStyle = this.controller.options.listStyle; @@ -143,6 +137,14 @@ MWF.xApplication.Forum.AttachmentController.Attachment = new Class({ this.message = this.controller.messageItemList[messageId]; } + if( this.controller.isAnonymous && this.data.creatorUid === this.controller.anonymousPerson ){ + this.data.person = this.controller.anonymousName; + }else if(MWFForum.isUseNickName()){ + this.data.person = this.data.nickName; + }else if(!this.data.person && this.data.creatorUid ){ + this.data.person = this.data.creatorUid; + } + this.load(); }, createInforNode: function(callback){ @@ -158,7 +160,8 @@ MWF.xApplication.Forum.AttachmentController.Attachment = new Class({ } this.inforNode = new Element("div", {"styles": this.css.attachmentInforNode}); - var person = MWFForum.isUseNickName()?this.data.nickName:( this.data.person || this.data.creatorUid ); + //var person = MWFForum.isUseNickName()?this.data.nickName:( this.data.person || this.data.creatorUid ); + var person = this.data.person; var html = "
"; html += " "; @@ -177,12 +180,6 @@ MWF.xApplication.Forum.AttachmentController.AttachmentMin = new Class({ initialize: function(data, controller, messageId, isCheckPosition){ this.data = data; - if(MWFForum.isUseNickName()){ - this.data.person = this.data.nickName; - }else if(!this.data.person && this.data.creatorUid ){ - this.data.person = this.data.creatorUid; - } - // if( !this.data.person && this.data.creatorUid )this.data.person = this.data.creatorUid; this.controller = controller; @@ -196,6 +193,14 @@ MWF.xApplication.Forum.AttachmentController.AttachmentMin = new Class({ this.message = this.controller.messageItemList[messageId]; } + if( this.controller.isAnonymous && this.data.creatorUid === this.controller.anonymousPerson ){ + this.data.person = this.controller.anonymousName; + }else if(MWFForum.isUseNickName()){ + this.data.person = this.data.nickName; + }else if(!this.data.person && this.data.creatorUid ){ + this.data.person = this.data.creatorUid; + } + this.load(); }, load: function(){ @@ -423,6 +428,9 @@ MWF.xApplication.Forum.Attachment = new Class({ "readonly": (!this.options.isNew && !this.options.isEdited ) }; this.attachmentController = new MWF.xApplication.Forum.AttachmentController(this.node, this, options); + this.attachmentController.isAnonymous = this.isAnonymous; + this.attachmentController.anonymousPerson = this.anonymousPerson; + this.attachmentController.anonymousName = this.anonymousName; this.attachmentController.load(); //this.actions.listAttachmentInfo.each(function (att) { diff --git a/o2web/source/x_component_ForumDocument/Main.js b/o2web/source/x_component_ForumDocument/Main.js index d9f7e5882bbcbe5cab15daa455d605d11a6361b8..e49be1d5f2d74b8985c80bd47d1502c97a5dde02 100644 --- a/o2web/source/x_component_ForumDocument/Main.js +++ b/o2web/source/x_component_ForumDocument/Main.js @@ -738,6 +738,10 @@ MWF.xApplication.ForumDocument.Main = new Class({ //} }.bind(this) }); + + this.attachment.isAnonymous = this.data.anonymousSubject; + this.attachment.anonymousPerson = this.data.creatorName; + this.attachment.anonymousName = this.data.nickName; this.attachment.load(); }, createToolbar_read : function(){