提交 8b3d706d 编写于 作者: 蔡祥熠

Merge branch 'fix/forum' into 'develop'

Merge of fix/forum 论坛增加匿名发帖、设置帖子编辑者、禁言功能,修复主题类别搜索问题 to develop

See merge request o2oa/o2oa!658
......@@ -49,6 +49,7 @@ o2.widget.O2Identity = new Class({
this.node.set("text", this.data.displayName || disply );
},
load: function(){
this.fireEvent("queryLoad");
var style = ( layout.mobile && this.style.identityNode_mobile ) ?
this.style.identityNode_mobile : this.style.identityNode;
......@@ -101,6 +102,7 @@ o2.widget.O2Identity = new Class({
}.bind(this)
});
}
this.fireEvent("postLoad");
},
setEvent: function(){
if( this.open ){
......
......@@ -6443,15 +6443,15 @@ var Request = this.Request = new Class({
if ((/*<1.4compat>*/this.options.user || /*</1.4compat>*/this.options.withCredentials) && 'withCredentials' in xhr) xhr.withCredentials = true;
//modify by Tommy--
if (Browser.name=="firefox"){
if (this.options.async){
if (isWithCredentials) xhr.withCredentials = true;
}else{
xhr.setRequestHeader(o2.tokenName, Cookie.read(o2.tokenName));
}
}else{
// if (Browser.name=="firefox"){
// if (this.options.async){
// if (isWithCredentials) xhr.withCredentials = true;
// }else{
// xhr.setRequestHeader(o2.tokenName, Cookie.read(o2.tokenName));
// }
// }else{
if (isWithCredentials) xhr.withCredentials = true;
}
// }
//-----------------
xhr.onreadystatechange = this.onStateChange.bind(this);
......
......@@ -34,7 +34,7 @@
},
"creatorName" : {
"value" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"event" : "mouseover^^function( node, ev ){ node.setStyles( this.css.documentItemNode_rcm_person_over ) }##mouseout^^function( node, ev ){ node.setStyles( this.css.documentItemNode_rcm_person )}##click^^function(){this.app.openPerson( this.data.creatorName ) }"
"event" : "mouseover^^function( node, ev ){ node.setStyles( this.css.documentItemNode_rcm_person_over ) }##mouseout^^function( node, ev ){ node.setStyles( this.css.documentItemNode_rcm_person )}##click^^function(){this.app.openPerson( this.data.creatorName, this.data ) }"
},
"sectionName": {
"value" : "function(d){ return d.sectionName.length > 8 ? d.sectionName.substr(0,8)+'...' : d.sectionName }",
......
......@@ -93,7 +93,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"},
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"},
"createTime" : {
"value" : "function(d){ return MWFForum.getDateDiff( d.createTime ) }"
}
......
{
"viewSetting": {
"html": "<table width='100%' border='0' cellpadding='5' cellspacing='0' styles='editTable'></table>"
},
"headSetting": {
"html": "<tr styles='viewHeadNode'></tr>"
},
"documentSetting": {
"html": "<tr styles='documentNode'></tr>",
"mouseoverStyles": "documentNode_over",
"action": "open"
},
"items": [
{
"name": "person",
"head": {
"html": "<th styles='normalThNode' lable='mutePerson'></th>",
"width": "15%"
},
"content": {
"html": "<td styles='normalTdCenterNode' item='person'></td>",
"items": {
"person" : {
"value": "function(d){ return d.person.split('@')[0] }"
}
}
}
},
{
"name": "unmuteDate",
"head": {
"html": "<th styles='normalThNode' lable='unmuteDate'></th>",
"width": "15%"
},
"content": {
"html": "<td styles='normalTdCenterNode' item='unmuteDate'></td>",
"items": {
"unmuteDate" : {}
}
}
},
{
"name": "reason",
"head": {
"html": "<th styles='normalThNode' lable='multReason'></th>",
"width": "40%"
},
"content": {
"html": "<td styles='normalTdCenterNode' item='reason'></td>",
"items": {
"reason" : {}
}
}
},
{
"name": "createTime",
"head": {
"html": "<th styles='normalThNode' lable='muteTime'></th>",
"width": "15%"
},
"content": {
"html": "<td styles='normalTdCenterNode' item='createTime'></td>",
"items": {
"createTime" : {}
}
}
},
{
//"access": "admin",
"head": {
"html": "<th styles='normalThNode' lable='action'></th>",
"width": "15%"
},
"content": {
"html": "<td styles='normalTdCenterNode'>" +
" <span styles='documentActionNode' item='action_co'></span>" +
" <span styles='documentActionNode' item='remove'></span>" +
"</td>",
"items": {
"action_edit": {
//"access": "admin",
"title": "edit",
"text": "edit",
"action": "action_edit",
"condition": "function( d ){ return MWF.AC.isBBSManager() }",
"styles": "documentActionNode",
"mouseoverStyles": "documentActionNode_over",
"mousedownStyles": "documentActionNode_down"
},
"remove": {
"title": "unmute",
"text": "unmute",
"action": "unmute",
"condition": "function( d ){ return MWF.AC.isBBSManager() }",
"styles": "documentActionNode",
"mouseoverStyles": "documentActionNode_over",
"mousedownStyles": "documentActionNode_down"
}
}
}
}
]
}
\ No newline at end of file
......@@ -285,8 +285,8 @@ MWF.xApplication.Forum.ColumnTemplate.Document = new Class({
}
}
},
openPerson : function( userName ){
MWFForum.openPersonCenter(userName)
openPerson : function( userName, data ){
MWFForum.openPersonCenter(userName, data)
},
createPersonNode : function( container, personName ){
var persons = typeOf(personName) === "array" ? personName : personName.split(",");
......
......@@ -54,6 +54,44 @@ MWFForum.BBS_LOGO_NAME = "BBS_LOGO_NAME";
MWFForum.BBS_SUBJECT_TYPECATAGORY = "BBS_SUBJECT_TYPECATAGORY";
MWFForum.BBS_TITLE_TAIL = "BBS_TITLE_TAIL";
MWFForum.BBS_USE_NICKNAME = "BBS_USE_NICKNAME";
MWFForum.BBS_ANONYMOUS_PERMISSION = "BBS_ANONYMOUS_PERMISSION";
MWFForum.enableAnonymousSubject = function(){
return MWFForum.getSystemConfigValue( MWFForum.BBS_ANONYMOUS_PERMISSION ) === "YES";
}
MWFForum.isSubjectMuted = function( usecache ){
if( usecache && o2.typeOf( MWFForum.isMuted ) === "boolean" ){
return MWFForum.isMuted;
}
o2.Actions.load("x_bbs_assemble_control").ShutupAction.getShutup(function(json){
debugger;
// json.data = {
// "id": "a13843ac-0700-4a94-b7d9-a85e6fca131b",
// "operator": "蔡祥熠@cxy@P",
// "person": "龚新民@91eed25b-8891-4ba6-b234-a70ed97c42ae@P",
// "unmuteDate": "2022-05-25",
// "reason": "888",
// "createTime": "2022-05-24 16:09:48",
// "updateTime": "2022-05-24 16:09:48"
// };
var d = json.data || {};
MWFForum.muteData = d;
if( d.unmuteDate && (new Date(d.unmuteDate + " 00:00:00") > new Date())){
MWFForum.isMuted = true;
}else{
MWFForum.isMuted = false;
}
}, null, false);
if( o2.typeOf( MWFForum.isMuted ) !== "boolean" ){
MWFForum.isMuted = false;
}
return MWFForum.isMuted;
}
MWFForum.isReplyMuted = function(){
return MWFForum.isSubjectMuted( true );
}
MWFForum.isUseNickName = function(){
return MWFForum.getSystemConfigValue( MWFForum.BBS_USE_NICKNAME ) === "YES";
......@@ -91,11 +129,19 @@ MWFForum.getLastReplyUserName = function(d){
return o2.name.cn( MWFForum.isUseNickName() ? (d.latestReplyUserNickName || d.latestReplyUser): d.latestReplyUser );
};
MWFForum.isSubjectEditor = function(d){
var dn = layout.desktop.session.user.distinguishedName;
return d.creatorName === dn || (d.editorList || []).contains(dn);
};
MWFForum.getReplyCreatorName = function(d){
return o2.name.cn( MWFForum.isUseNickName() ? (d.nickName || d.creatorName): d.creatorName );
};
MWFForum.openPersonCenter = function( userName ){
MWFForum.openPersonCenter = function( userName, data ){
if( data && ( data.anonymousSubject || data.anonymousReply ) ){
return;
}
if( MWFForum.isUseNickName() && userName!=="xadmin" ){
o2.Actions.load("x_organization_assemble_express").PersonAction.listObject(
{ personList : [userName]}
......
......@@ -318,8 +318,8 @@ MWF.xApplication.Forum.Main = new Class({
}
return status;
},
openPerson : function( userName ){
MWFForum.openPersonCenter( userName );
openPerson : function( userName, data ){
MWFForum.openPersonCenter( userName, data );
},
createPersonNode : function( container, personName ){
var persons = personName.split(",");
......
......@@ -97,6 +97,12 @@ MWF.xApplication.Forum.Setting = new Class({
"icon" :"squared.png",
"action" : "openSectionSetting",
"enable": this.app.access.isAdmin() || permission.bbsAdmin || permission.bbsForumAdmin || permission.bbsSectionAdmin
},
{
"title" : MWF.xApplication.Forum.LP.muteSettingFormTitle,
"icon" :"mute.png",
"action" : "openMuteSetting",
"enable": this.app.access.isAdmin() || permission.bbsAdmin
}
].filter(function(data){
return data.enable;
......@@ -165,6 +171,15 @@ MWF.xApplication.Forum.Setting = new Class({
this.explorer = new MWF.xApplication.Forum.Setting.RoleSettingExplorer(this.contentDiv, this.app, this,{style:this.options.style});
this.explorer.load();
},
openMuteSetting: function(){
if( this.contentDiv )this.contentDiv.empty();
if( this.explorer ){
this.explorer.destroy();
delete this.explorer;
}
this.explorer = new MWF.xApplication.Forum.Setting.MuteSettingExplorer(this.contentDiv, this.app, this,{style:this.options.style});
this.explorer.load();
},
openPermissionSetting: function(){
if( this.contentDiv )this.contentDiv.empty();
if( this.explorer ){
......@@ -1737,6 +1752,238 @@ MWF.xApplication.Forum.Setting.SystemSettingForm = new Class({
MWF.xApplication.Forum.Setting.MuteSettingExplorer = new Class({
Extends: MWF.widget.Common,
Implements: [Options, Events],
options: {
"style": "default"
},
initialize: function (container, app, parent, options) {
this.container = container;
this.parent = parent;
this.app = app;
this.css = this.parent.css;
this.lp = this.app.lp;
},
load: function () {
this.container.empty();
if( this.app.access.isAdmin() ){
this.loadToolbar();
}
this.loadView();
},
destroy : function(){
if(this.resizeWindowFun)this.app.removeEvent("resize",this.resizeWindowFun);
this.view.destroy();
},
loadToolbar: function(){
this.toolbar = new Element("div",{
styles : this.css.toolbar
}).inject(this.container);
this.createActionNode = new Element("div",{
styles : this.css.toolbarActionNode,
text: this.lp.addMutePerson
}).inject(this.toolbar);
this.createActionNode.addEvent("click",function(){
var form = new MWF.xApplication.Forum.Setting.MuteSettingForm(this, {}, {
onPostOk : function(){
// this.app.access.getUserPermission(function () {
this.view.page = 0;
this.view.reload();
// }.bind(this), true);
}.bind(this)});
form.create();
}.bind(this));
this.fileterNode = new Element("div",{
styles : this.css.fileterNode
}).inject(this.toolbar);
},
loadView : function(){
this.viewContainer = Element("div",{
"styles" : this.css.viewContainer
}).inject(this.container);
this.resizeWindow();
this.resizeWindowFun = this.resizeWindow.bind(this);
this.app.addEvent("resize", this.resizeWindowFun );
this.view = new MWF.xApplication.Forum.Setting.MuteSettingView( this.viewContainer, this.app, this, {
templateUrl : this.parent.path+"listItemMute.json",
scrollEnable : true
} );
this.view.load();
},
resizeWindow: function(){
var size = this.container.getSize();
if( this.toolbar ){
this.viewContainer.setStyles({"height":(size.y-65)+"px"});
}else{
this.viewContainer.setStyles({"height":(size.y)+"px"});
}
}
});
MWF.xApplication.Forum.Setting.MuteSettingView = new Class({
Extends: MWF.xApplication.Template.Explorer.ComplexView,
_createDocument: function(data){
return new MWF.xApplication.Forum.Setting.MuteSettingDocument(this.viewNode, data, this.explorer, this);
},
_getCurrentPageData: function(callback, count){
if (!count)count = 50;
if( !this.page ){
this.page = 1;
}else{
this.page ++;
}
o2.Actions.load("x_bbs_assemble_control").ShutupAction.listPaging(this.page, count, {}, function (json) {
if (callback)callback(json);
}.bind(this))
},
_removeDocument: function(documentData, all){
o2.Actions.load("x_bbs_assemble_control").ShutupAction.delete(documentData.id, function(json){
this.page = 0;
this.reload();
this.app.notice(this.app.lp.unmuteSuccess, "success");
}.bind(this));
},
_openDocument: function( documentData ){
var form = new MWF.xApplication.Forum.Setting.MuteSettingForm(this, documentData, {
onPostOk : function(){
debugger;
this.page = 0;
this.reload();
}.bind(this)
});
if( MWF.AC.isBBSManager() ){
form.edit();
}else{
form.open();
}
}
});
MWF.xApplication.Forum.Setting.MuteSettingDocument = new Class({
Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
_queryCreateDocumentNode:function( itemData ){
},
_postCreateDocumentNode: function( itemNode, itemData ){
},
unmute: function (e) {
var lp = this.lp || this.view.lp || this.app.lp;
var text = lp.unmuteDocument.replace(/{person}/g, this.data.person.split("@")[0]);
var _self = this;
this.node.setStyles(this.css.documentNode_remove);
this.readyRemove = true;
this.view.lockNodeStyle = true;
this.app.confirm("warn", e, lp.unmuteTitle, text, 350, 120, function () {
_self.view._removeDocument(_self.data, false);
_self.view.lockNodeStyle = false;
this.close();
}, function () {
_self.node.setStyles(_self.css.documentNode);
_self.readyRemove = false;
_self.view.lockNodeStyle = false;
this.close();
});
}
});
MWF.xApplication.Forum.Setting.MuteSettingForm = new Class({
Extends: MPopupForm,
Implements: [Options, Events],
options: {
"style": "default",
"width": "600",
"height": "320",
"hasTop": true,
"hasIcon": false,
"hasTopIcon" : true,
"hasTopContent" : true,
"hasBottom": true,
"title": MWF.xApplication.Forum.LP.mute1SettingFormTitle,
"draggable": true,
"closeAction": true
},
_createTableContent: function () {
var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>" +
"<tr><td styles='formTableTitle' lable='createTime' width='20%'></td>" +
" <td styles='formTableValue' item='createTime' width='80%'></td></tr>" +
"<tr><td styles='formTableTitle' lable='person' width='20%'></td>" +
" <td styles='formTableValue' item='person' width='80%'></td></tr>" +
"<tr><td styles='formTableTitle' lable='reason'></td>" +
" <td styles='formTableValue' item='reason'></td></tr>" +
"<tr><td styles='formTableTitle' lable='unmuteDate'></td>" +
" <td styles='formTableValue' item='unmuteDate'></td></tr>" +
"<tr><td styles='formTableTitle'></td>" +
" <td styles='formTableValue'>"+this.lp.unmuteDateNote+"</td></tr>" +
"</table>";
this.formTableArea.set("html", html);
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.formTableArea, this.data, {
style: "execution",
isEdited: this.isEdited || this.isNew,
itemTemplate: {
createTime: {text: this.lp.muteTime, type : "innerText", defaultValue: new Date().format("db") },
person: {text: this.lp.mutePerson, type : "org", notEmpty: true, orgOptions: {
onPostLoadItem: function(item){
if(item.data.nickName){
item.textNode.set("text", item.data.name + "("+ item.data.nickName +")")
}else{
item.textNode.set("text", item.data.name)
}
},
onPostLoadItemSelected: function(item){
if(item.data.nickName){
item.textNode.set("text", item.data.name + "("+ item.data.nickName +")")
}else{
item.textNode.set("text", item.data.name)
}
}
}, orgWidgetOptions: {
onPostLoad: function(){
if(this.data.nickName){
this.node.set("text", this.data.name + "("+ this.data.nickName +")")
}else{
this.node.set("text", this.data.name)
}
}
}
},
unmuteDate: {text: this.lp.unmuteDate, notEmpty: true, tType : "date", defaultValue: function(){
return new Date().increment("day", 7).format("%Y-%m-%d");
}, validRule: {
time: function(value, item){
debugger;
if( new Date(value + " 00:00:00") < new Date() ){
return false;
}else{
return true;
}
}
}, validMessage:{
time: this.lp.unmuteTimeUnvalid
} },
reason: {text: this.lp.multReason, notEmpty: true, type : "textarea" }
}
}, this.app);
this.form.load();
}.bind(this), true);
},
_ok: function (data, callback) {
o2.Actions.load("x_bbs_assemble_control").ShutupAction.save( data, function(json){
if( callback )callback(json);
this.fireEvent("postOk")
}.bind(this));
}
});
MWF.xApplication.Forum.Setting.SelectOrgForm = new Class({
Extends: MPopupForm,
Implements: [Options, Events],
......
......@@ -320,8 +320,8 @@ MWF.xApplication.Forum.TopNode = new Class({
});
}
},
openPerson : function( userName ){
MWFForum.openPersonCenter( userName );
openPerson : function( userName, data ){
MWFForum.openPersonCenter( userName, data );
},
openLoginForm : function(){
MWF.require("MWF.xDesktop.Authentication", null, false);
......
......@@ -140,6 +140,8 @@ MWF.xApplication.Forum.LP = {
"subSectionCreateAble": "Allow the creation of subsections",
"sectionStatus": "Status",
"sectionStatusValue": "Enable, Disable",
"sectionGrade" : "Grade",
"sectionGradeValue" : "No,Yes",
"sectionIcon": "Section Icon",
"uploadIcon": "Upload local icon",
"selectIcon": "Select Icon",
......@@ -175,6 +177,7 @@ MWF.xApplication.Forum.LP = {
"subjectType": "Subject Type Option",
"subjectTypeDefaultValue": "Discussion|News|News|Knowledge|Watering",
"vote": "Vote",
"sectionApp" : "App Market",
"typeCategoryDefaultValue": "Information|Question|Vote",
"typeCatagory": "Theme Type Option",
"typeCategorySelectValue": "Information|Question|Vote",
......@@ -182,6 +185,7 @@ MWF.xApplication.Forum.LP = {
"summary": "Summary",
"content": "Content",
"createSubject": "Post",
"anonymousSubject" : "Post anonymously",
"saveSubject": "Post",
"selectCurrentDocumentFile": "Select Post Picture",
"selectCloudFile": "Select Cloud File Picture",
......@@ -338,7 +342,28 @@ MWF.xApplication.Forum.LP = {
"selectTargetSection": "Select the section to move to",
"moveSuccess": "The post has been moved to {section}",
"poster": "Poster",
"replyAbbr": "reply"
"replyAbbr": "reply",
"editPermissionFormTitle": "Set edit permission",
"editorSetting": "Editor",
"setEditorSuccess": "Set editing permission successfully!",
"setEditorFail": "Error setting editing permissions!",
"muteSettingFormTitle": "Mute Management",
"addMutePerson": "Add Mute Person",
"mute1SettingFormTitle": "Mute Person Settings",
"mutePerson": "Mute Person",
"muteTime": "Mute Time",
"unmuteDate": "Unmute Date",
"unmuteDateNote": "Automatically unmute after expiration",
"unmute": "unmute",
"unmuteTitle": "Unmute Confirmation",
"unmuteDocument": "Are you sure you want to unmute:{person}?",
"multReason": "Mute Reason",
"unmuteSuccess": "Unmute Success!",
"unmuteTimeUnvalid": "Unblock date needs to be later than today",
"muteNote": "You have been muted to post and reply.",
"muteInfor": "Unblock Date: {unmuteDate}, Mute Reason: {reason}.",
"poster": "Poster"
};
\ No newline at end of file
......@@ -54,6 +54,7 @@ MWF.xApplication.Forum.LP = {
"createSection" : "创建版块",
"categoryFormTitle" : "分区设置",
"sectionFormTitle" : "版块设置",
"muteSettingFormTitle": "禁言管理",
"baseSetting" : "基本设置",
"permissionSetting" : "权限设置",
......@@ -185,6 +186,7 @@ MWF.xApplication.Forum.LP = {
"summary" : "摘要",
"content" : "内容",
"createSubject" : "发帖",
"anonymousSubject" : "匿名发帖",
"saveSubject" : "发表帖子",
"selectCurrentDocumentFile" : "选择帖子图片",
"selectCloudFile" : "选择云文件图片",
......@@ -343,6 +345,27 @@ MWF.xApplication.Forum.LP = {
"gradeNotice":"请评分后提交",
"selectTargetSection" : "选择移动到的版块",
"moveSuccess": "帖子已经移动到{section}"
"moveSuccess": "帖子已经移动到{section}",
"editPermissionFormTitle": "设置编辑权限",
"editorSetting": "编辑者",
"setEditorSuccess": "设置编辑权限成功!",
"setEditorFail": "设置编辑权限出错!",
"addMutePerson": "添加禁言人员",
"mute1SettingFormTitle": "禁言人员设置",
"mutePerson": "禁言人员",
"muteTime": "禁言时间",
"unmuteDate": "解封日期",
"unmuteDateNote": "到期后自动解除禁言",
"unmute": "解除禁言",
"unmuteTitle": "解除禁言确认",
"unmuteDocument": "确定要解除禁言:{person}?",
"multReason": "禁言理由",
"unmuteSuccess": "解除禁言成功!",
"unmuteTimeUnvalid": "解封日期需要晚于今天",
"muteNote": "您被禁言了,无法发帖和回复。",
"muteInfor": "解封日期:{unmuteDate},禁言原因:{reason}。",
"poster": "发帖人"
};
\ No newline at end of file
......@@ -381,8 +381,8 @@ MWF.xApplication.ForumCategory.Main = new Class({
noteHidden : this.noteNodeHidden
};
},
openPerson : function( userName ){
MWFForum.openPersonCenter( userName );
openPerson : function( userName, data ){
MWFForum.openPersonCenter( userName, data );
},
createPersonNode : function( container, personName ){
var persons = personName.split(",");
......
......@@ -960,7 +960,7 @@
"formTopTextNodeTopSetting" : {
"font-size": "16px",
"float": "left",
"width" : "80px",
"width" : "100px",
"overflow" : "hidden",
"text-overflow" : "ellipsis",
"white-space":"nowrap"
......@@ -1279,5 +1279,10 @@
},
"sidebarPrev_over" : {
"opacity" : "1"
},
"muteInfor": {
"padding": "15px 20px",
"font-size": "14px",
"color": "#999"
}
}
\ No newline at end of file
{
"viewSetting": {
"html": "<div styles='subjectListNode'></div>"
},
"documentSetting": {
"html": "<div styles='subjectNode'></div>",
"action": "open"
},
"items": [
{
"name": "subjectContent",
"content": {
"html": "<div styles='itemNode'>"+
" <div styles='itemLeftNode'>"+
//" <div styles='itemLeftArrow'></div>"+
" <div styles='itemUserName' item='creatorName'>"+
" </div>"+
" <div styles='itemUserFace' item='userFace'>"+
" <div styles='itemUserIcon'>"+
" <img styles='itemUserIcon2' item='userIcon'/>"+
" </div>"+
" </div>"+
" <div styles='itemToolsLeft'>"+
// " <div styles='messageAction' item='messageAction'></div>"+
" </div>"+
" </div>"+
" <div styles='itemRightNode'>"+
//" <div styles='itemPrime' item='isPrime'></div>"+
" <div styles='itemRightTop'>"+
" <div styles='itemTime' lable='publishAt'></div>"+
" <div styles='itemTime' item='createTime'></div>"+
" <div styles='itemFloor' lable='mainFloor'></div><div styles='itemFloor' item='index'></div>"+
" <div styles='itemSubjectTools' item='itemSubjectTools'></div>"+
" </div>"+
" <div styles='itemRightMidle'>"+
" <div style='padding-bottom:60px'>" +
" <div styles='itemSummaryContainer' item='summaryContainer'>"+
" <span styles='itemSummaryLabel' item='summaryLabel'></span>"+
" <span styles='itemSummary' item='summary'></span>"+
" </div>"+
" <div styles='itemBody' item='content'></div>"+
" <div styles='itemAttachment' item='attachment'></div>"+
" <div styles='itemVote' item='vote'></div>"+
" </div>"+
" <div styles='itemSignature' item='signatureContainer'>"+
" <div styles='itemSignatureIcon'></div>"+
" <div styles='itemSignatureText' item='signature'></div>"+
" </div>"+
" </div>"+
" <div styles='itemRightBottom'>"+
" <div styles='itemTools'>"+
" <div styles='replyAction' item='replyAction'></div>"+
" </div>"+
" </div>"+
" </div>"+
"</div>",
"items": {
"isPrime" : {
"value": "",
"attr" : "title^^function( d ){ if( d.isCreamSubject ){ return (d.screamSetterName || '').split('@')[0] + this.lp.at + d.screamSetterTime + this.lp.setPrime } }",
"show": "function( d ){ return d.isCreamSubject ? true : false }"
},
"creatorName" : {
"value" : "function( d ){ return MWFForum.getSubjectCreatorName(d); }",
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
"subject": {},
"reply" : {},
"accessed": {},
"prime": {},
"todaySubject": {},
"todayReply": {},
"createTime" : { "value" : "function( d ){ return MWFForum.getDateDiff2( d.createTime || d.updateTime )}" ,
"title" : "function( d ){ return d.createTime || d.updateTime }" },
"summaryContainer" : {
"value": "",
"show": "function( d ){ return ( d.summary && d.summary!='' ) ? true : false }"
},
"signatureContainer" : {
"value": "",
"show": "function( d ){ return ( d.signature && d.signature!='' ) ? true : false }"
},
"signature" : {},
"summaryLabel" : { "value" : "function(d){ return ( d.summary && d.summary!='' ) ? (this.lp.summary + ':' ): '' }" },
"summary" : { },
// "content": { "type" : "html" },
"remove" : { "action" : "remove" },
"userIcon" : {
"value": "",
"attr" : "src^^function( d ){ if( d.userIcon ){ return d.userIcon }else{ return '../x_component_ForumDocument/$Main/default/icon/noavatar_big.gif' } }"
},
//"index" : { "value" : "function(d){ return d.index + 1 }" },
"messageAction": {
"text" : "sendMessage",
"action": "sendMessage",
"condition": "function( d ){ return d.creatorName != this.app.userName && !this.app.access.isAnonymous() && !this.app.inBrowser }",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.messageAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.messageAction ) }"
},
"replyAction": {
"text" : "reply",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher && !MWFForum.isReplyMuted() }",
"action": "createReply",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction ) }"
}
}
}
}
]
}
\ No newline at end of file
......@@ -76,7 +76,7 @@
"title" : "function( d ){ return MWFForum.getReplyCreatorName(d); }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
// "subject": { "value" : "function(d){ return 8 }" },
// "reply" : { "value" : "function(d){ return 66 }"},
......@@ -104,7 +104,7 @@
"replyAction": {
"text" : "reply",
"action": "createReply",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher }",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher && !MWFForum.isReplyMuted() }",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction ) }"
},
"editAction": {
......
......@@ -80,7 +80,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
// "subject": { "value" : "function(d){ return 8 }" },
// "reply" : { "value" : "function(d){ return 66 }"},
......@@ -108,7 +108,7 @@
"replyAction": {
"text" : "reply",
"action": "createReply",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher }",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher && !MWFForum.isReplyMuted() }",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction ) }"
},
"editAction": {
......
......@@ -91,7 +91,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
"subject": {},
"reply" : {},
......@@ -127,7 +127,7 @@
},
"replyAction": {
"text" : "reply",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher }",
"condition": "function( d ){ return !d.stopReply && this.explorer.isReplyPublisher && !MWFForum.isReplyMuted() }",
"action": "createReply",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction ) }"
}
......
{
"viewSetting": {
"html": "<div styles='subjectListNode'></div>"
},
"documentSetting": {
"html": "<div styles='subjectNode'></div>",
"action": "open"
},
"items": [
{
"name": "subjectContent",
"content": {
"html": "<div styles='itemNode'>"+
" <div styles='itemTopNode'>"+
" <div styles='itemUserFace_subject' item='userFace'>"+
" <div styles='itemUserIcon_subject'>"+
" <img styles='itemUserIcon2' item='userIcon'/>"+
" </div>"+
" </div>"+
" <div styles='itemUserInfor_subject'>"+
" <div style='overflow:hidden'>"+
" <span styles='itemUserLabel'>"+MWF.xApplication.Forum.LP.poster+"</span>"+
" <span styles='itemUserName_subject' item='creatorName'></span>"+
" </div>"+
" <div>"+
" <div styles='itemTime_subject' item='createTime'></div>"+
" </div>"+
" </div>"+
" <div styles='itemPrime' item='isPrime'></div>"+
" <div styles='itemReplyCount' item='replyTotal'></div>"+
" </div>"+
" <div styles='itemBottomNode'>"+
" <div styles='itemRightMidle'>"+
" <div styles='itemSummaryContainer' item='summaryContainer'>"+
" <span styles='itemSummaryLabel' item='summaryLabel'></span>"+
" <span styles='itemSummary' item='summary'></span>"+
" </div>"+
" <div styles='itemBody' item='content'></div>"+
" <div styles='itemVote' item='vote'></div>"+
" </div>"+
" </div>"+
"</div>",
"items": {
"isPrime" : {
"value": "",
"attr" : "title^^function( d ){ if( d.isCreamSubject ){ return d.screamSetterName + this.lp.at + d.screamSetterTime + this.lp.setPrime } }",
"show": "function( d ){ return d.isCreamSubject ? true : false }"
},
"creatorName" : {
"value": "function( d ){ return MWFForum.getSubjectCreatorName(d) }"
},
"createTime" : { "value" : "function( d ){ return MWFForum.getDateDiff2( d.createTime || d.updateTime )}" , "title" : "function( d ){ return d.createTime || d.updateTime }" },
"summaryContainer" : {
"value": "",
"show": "function( d ){ return ( d.summary && d.summary!='' ) ? true : false }"
},
"summaryLabel" : { "value" : "function(d){ return ( d.summary && d.summary!='' ) ? (this.lp.summary + ':' ): '' }" },
"summary" : { },
// "content": { "type" : "html" },
"remove" : { "action" : "remove" },
"replyTotal" : {
"value": "function( d ){ return ( d.replyTotal + MWF.xApplication.Forum.LP.replyAbbr ) || '' }"
},
"userIcon" : {
"value": "",
"attr" : "src^^function( d ){ return this.explorer.getUserIcon( d.creatorName, true ) }"
},
"replyAction": {
"text" : "reply",
"condition": "function( d ){ return !d.stopReply && !MWFForum.isReplyMuted() }",
//"condition": "function( d ){ return this.explorer.isReplyPublisher }",
"action": "createReply",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction ) }"
}
}
}
}
]
}
\ No newline at end of file
......@@ -61,7 +61,7 @@
"index" : { "value" : "function(d){ return d.orderNumber || (d.index + 2) }" },
"replyAction": {
"action": "createReply",
"condition": "function( d ){ return this.explorer.permission.replyPublishAble }"
"condition": "function( d ){ return this.explorer.permission.replyPublishAble && !MWFForum.isReplyMuted() }"
}
}
}
......
......@@ -61,7 +61,7 @@
"index" : { "value" : "function(d){ return d.orderNumber || (d.index + 2) }" },
"replyAction": {
"action": "createReply",
"condition": "function( d ){ return this.explorer.permission.replyPublishAble }"
"condition": "function( d ){ return this.explorer.permission.replyPublishAble && !MWFForum.isReplyMuted() }"
}
}
}
......
......@@ -59,14 +59,15 @@
// "content": { "type" : "html" },
"remove" : { "action" : "remove" },
"replyTotal" : {
"value": "function( d ){ return d.replyTotal + MWF.xApplication.Forum.LP.replyAbbr }"
"value": "function( d ){ return ( d.replyTotal + MWF.xApplication.Forum.LP.replyAbbr ) || '' }"
},
"userIcon" : {
"value": "",
"attr" : "src^^function( d ){ return this.explorer.getUserIcon( d.creatorName ) }"
"attr" : "src^^function( d ){ return this.explorer.getUserIcon( d.creatorName, true ) }"
},
"replyAction": {
"text" : "reply",
"condition": "function( d ){ return !d.stopReply && !MWFForum.isReplyMuted() }",
//"condition": "function( d ){ return this.explorer.isReplyPublisher }",
"action": "createReply",
"event" : "mouseover^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction_over ) }##mouseout^^function( itemNode, ev ){ itemNode.setStyles( this.css.replyAction ) }"
......
......@@ -328,7 +328,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
" <td item='voteContainer' colspan='3'></td>" +
"</tr><tr>" +
" <td styles='formTableTitle' lable=''></td>" +
" <td item='action' colspan='3'></td>" +
" <td colspan='3'><div item='action' style='float:left;'></div><div item='anonymousSubject' style='float:left;margin-top:25px;margin-left:20px;'></div></td>" +
"</tr>"+
"</table>";
this.contentDiv.set("html", html);
......@@ -398,6 +398,11 @@ MWF.xApplication.ForumDocument.Main = new Class({
reference : this.advanceId || this.data.id,
referenceType: "forumDocument"
},
anonymousSubject: { type: "checkbox",
disable: !MWFForum.enableAnonymousSubject(),
selectValue: ['true'],
selectText: [this.lp.anonymousSubject]
},
content: {text: this.lp.content, type : "rtf", notEmpty : true, RTFConfig : {
isSetImageMaxWidth : true,
reference : this.advanceId || this.data.id,
......@@ -625,7 +630,22 @@ MWF.xApplication.ForumDocument.Main = new Class({
if( this.access.isAnonymous() ){
this.createReplyEditor_Anonymous()
}else{
this.createReplyEditor();
if( MWFForum.isReplyMuted() ){
var d = MWFForum.muteData;
if( d ){
new Element("div", {
styles: this.css.muteInfor,
text: this.lp.muteNote + this.lp.muteInfor.replace("{unmuteDate}", d.unmuteDate).replace("{reason}", d.reason)
}).inject( this.middleNode )
}else{
new Element("div", {
styles: this.css.muteInfor,
text: this.lp.muteNote
}).inject( this.middleNode )
}
}else{
this.createReplyEditor();
}
}
}
//this.createTurnSubjectNode();
......@@ -642,7 +662,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
}
//if( this.access.isSubjectPublisher( this.sectionData ) ){
if( this.sectionPermission.subjectPublishAble ){
if( this.sectionPermission.subjectPublishAble && !MWFForum.isSubjectMuted() ){
var createActionNode = new Element("div",{
styles : this.css.pagingActionNode,
text: this.lp.createSubject
......@@ -885,6 +905,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
form.create()
},
createActionBar : function( container ){
var action;
this.actionBar = new Element("div", { "styles" : this.css.actionBar, "html" : "&nbsp;"}).inject(container);
//var action = new Element("div", {
......@@ -985,6 +1006,17 @@ MWF.xApplication.ForumDocument.Main = new Class({
});
//}
action = new Element("div", {
"styles" : this.css.actionItem,
"text" : this.lp.editorSetting
}).inject( this.actionBar );
action.setStyle("background-image" , "url("+this.path+"icon/action_person.png)");
action.addEvents({
"mouseover" : function(){ this.itemNode.setStyles( this.obj.css.actionItem_over ) }.bind({ obj : this, itemNode : action }),
"mouseout" : function(){ this.itemNode.setStyles( this.obj.css.actionItem ) }.bind({ obj : this, itemNode : action }),
"click" : function(){ this.setEditPermission() }.bind(this)
});
}
if( MWF.AC.isHotPictureManager() ){
......@@ -1029,7 +1061,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
}
if( this.permission.manageAble || this.permission.editAble || this.data.creatorName == this.userName ){
if( this.permission.manageAble || this.permission.editAble || this.data.creatorName == this.userName || MWFForum.isSubjectEditor(this.data)){
action = new Element("div", {
"styles" : this.css.actionItem,
"text" : this.lp.delete
......@@ -1043,7 +1075,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
}
if( this.data.typeCategory != this.lp.vote && this.data.typeCategory!="投票"){
if( this.permission.manageAble || this.permission.editAble || this.data.creatorName == this.userName ){
if( this.permission.manageAble || this.permission.editAble || this.data.creatorName == this.userName || MWFForum.isSubjectEditor(this.data) ){
action = new Element("div", {
"styles" : this.css.actionItem,
"text" : this.lp.edit
......@@ -1057,7 +1089,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
}
}
if( !this.data.stopReply ){
if( !this.data.stopReply && !MWFForum.isReplyMuted()){
if( this.isReplyPublisher ){
action = new Element("div", {
"styles" : this.css.actionItem,
......@@ -1117,6 +1149,16 @@ MWF.xApplication.ForumDocument.Main = new Class({
});
form.create()
},
setEditPermission: function(){
var form = new MWF.xApplication.ForumDocument.EditorSettingForm(this, this.data, {
onPostOk : function( id ){
this.reload();
}.bind(this)
},{
app : this, lp : this.lp, css : this.css, actions : this.restActions
});
form.create();
},
setTop : function(){
var form = new MWF.xApplication.ForumDocument.TopSettingForm(this, this.data, {
onPostOk : function( id ){
......@@ -1151,7 +1193,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
},
createSubject : function(){
this.subjectView = new MWF.xApplication.ForumDocument.SubjectView( this.subjectConainer, this, this, {
templateUrl : this.path + "listItemSubject.json",
templateUrl : this.path + (this.data.anonymousSubject ? "listItemAnonymousSubject.json" : "listItemSubject.json"),
scrollEnable : false
} );
this.subjectView.data = this.data;
......@@ -1497,7 +1539,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
}
);
if( this.sectionPermission.subjectPublishAble ){
if( this.sectionPermission.subjectPublishAble && !MWFForum.isSubjectMuted()){
count++;
var createActionNode = new Element("div",{
styles : this.css.sidebarCreate,
......@@ -1524,7 +1566,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
)
}
if( !this.data.stopReply ){
if( !this.data.stopReply && !MWFForum.isReplyMuted() ){
if( this.isReplyPublisher ){
count++;
var action = new Element("div", {
......@@ -1584,8 +1626,8 @@ MWF.xApplication.ForumDocument.Main = new Class({
this.sideBar.setStyle( "height" , (count * 30 + 5 ) +"px" );
},
openPerson : function( userName ){
MWFForum.openPersonCenter( userName );
openPerson : function( userName, data ){
MWFForum.openPersonCenter( userName, data );
},
createPersonNode : function( container, personName ){
var persons = personName.split(",");
......@@ -1677,8 +1719,13 @@ MWF.xApplication.ForumDocument.SubjectView = new Class({
data.index = index;
var document;
this.getUserData( data.creatorName, function(json ){
data.userIcon = json.data.icon;
data.signature = json.data.signature;
if( data.anonymousSubject ){
data.userIcon = '../x_component_ForumDocument/$Main/default/icon/noavatar_big.gif';
data.signature = "";
}else{
data.userIcon = json.data.icon;
data.signature = json.data.signature;
}
this.actions.getUserInfor( {"userName":data.creatorName}, function( json ){
data.subject = json.data.subjectCount;
data.reply = json.data.replyCount;
......@@ -2478,3 +2525,66 @@ MWF.xApplication.ForumDocument.TopSettingForm = new Class({
}
}
});
MWF.xApplication.ForumDocument.EditorSettingForm = new Class({
Extends: MWF.xApplication.ForumDocument.TopSettingForm,
Implements: [Options, Events],
options: {
"style": "default",
"width": "420",
"height": "250",
"hasTop": true,
"hasIcon": false,
"hasTopIcon" : true,
"hasTopContent" : true,
"hasBottom": true,
"title": MWF.xApplication.Forum.LP.editPermissionFormTitle,
"draggable": true,
"closeAction": true
},
_createTableContent: function () {
var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>" +
"<tr>" +
" <td styles='formTableValue' item='editorList'></td>" +
"</tr>" +
"</table>";
this.formTableArea.set("html", html);
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.formTableArea, this.data, {
style: "forum",
isEdited: this.isEdited || this.isNew,
itemTemplate: {
editorList: { type: "org", style: {height:"100px"}, count: 0 }
}
}, this.app, this.css);
this.form.load();
}.bind(this), true);
},
ok: function (e) {
this.fireEvent("queryOk");
debugger;
var data = this.form.getResult(true, ",", true, false, true);
if (data) {
var flag = true;
this.data.editorList = data.editorList.split(",");
o2.Actions.load("x_bbs_assemble_control").SubjectInfoManagerUserAction.save( this.data , function( json ){
if (json.type == "error") {
this.app.notice(json.message, "error");
flag = false;
}
}, function(){
flag = false;
}, false )
if( flag ){
if(this.formMaskNode)this.formMaskNode.destroy();
this.formAreaNode.destroy();
this.app.notice( this.app.lp.setEditorSuccess );
this.fireEvent("postOk");
}else{
this.app.notice( this.app.lp.setEditorFail , "error");
}
}
}
});
......@@ -68,7 +68,7 @@ MWF.xApplication.ForumDocument.Mobile = new Class({
},
createSubject : function(){
this.subjectView = new MWF.xApplication.ForumDocument.Mobile.SubjectView( this.subjectConainer, this.app, this, {
templateUrl : this.path + "listItemSubject.json",
templateUrl : this.path + (this.data.anonymousSubject ? "listItemAnonymousSubject.json" : "listItemSubject.json"),
scrollEnable : false
} );
this.subjectView.data = this.data;
......@@ -130,14 +130,20 @@ MWF.xApplication.ForumDocument.Mobile = new Class({
this.satisfiedReplyView.data = this.data;
this.satisfiedReplyView.load();
},
getUserIcon: function( name ){
getUserIcon: function( name, isSubject ){
var icon = "";
var url = MWF.Actions.get("x_organization_assemble_personal").getIcon(name);
if( url ){
icon = url;
if( isSubject && this.data.anonymousSubject ){
icon = '../x_component_ForumDocument/$Main/default/icon/noavatar_big.gif';
}else{
icon = "../x_component_ForumDocument/$Main/default/icon/noavatar_big.gif";
var url = MWF.Actions.get("x_organization_assemble_personal").getIcon(name);
if( url ){
icon = url;
}else{
icon = "../x_component_ForumDocument/$Main/default/icon/noavatar_big.gif";
}
}
//MWF.Actions.get("x_organization_assemble_control").getPersonIcon(name, function(url){
// icon = url;
//}.bind(this), function(){
......
......@@ -56,7 +56,7 @@ MWF.xApplication.ForumPerson.Main = new Class({
if( !this.options.personName && this.status && this.status.personName ){
this.options.personName = this.status.personName;
}
if( !this.options.p && this.p && this.status.p ){
if( !this.options.p && this.status && this.status.p ){
this.options.p = this.status.p;
}
this.loadController(function(){
......@@ -319,10 +319,10 @@ MWF.xApplication.ForumPerson.Main = new Class({
});
this.explorer.load();
},
openPerson : function( userName ){
openPerson : function( userName, data ){
if( !userName || userName == "" ){
}else{
MWFForum.openPersonCenter( userName );
MWFForum.openPersonCenter( userName, data );
}
},
setContentSize: function () {
......@@ -336,18 +336,31 @@ MWF.xApplication.ForumPerson.Main = new Class({
this.contentContainerNode.setStyle("height", "" + height + "px");
},
recordStatus: function(){
debugger;
if( this.options.p ){
return {
type : this.explorer.options.type,
p : this.options.p,
viewPageNum : this.explorer.view.getCurrentPageNum()
};
if( this.explorer && this.explorer.options ){
return {
type : this.explorer.options.type,
p : this.options.p,
viewPageNum : this.explorer.view.getCurrentPageNum()
};
}else{
return {
p : this.options.p
}
}
}else{
return {
type : this.explorer.options.type,
personName : this.options.personName,
viewPageNum : this.explorer.view.getCurrentPageNum()
};
if( this.explorer && this.explorer.options ) {
return {
type: this.explorer.options.type,
personName: this.options.personName,
viewPageNum: this.explorer.view.getCurrentPageNum()
};
}else{
return {
personName: this.options.personName
};
}
}
}
});
......@@ -561,6 +574,9 @@ MWF.xApplication.ForumPerson.SubjectView = new Class({
this.actions.listUserSubjectPage( pageNum, count, filter, function(json){
if( !json.data )json.data = [];
if( !json.count )json.count=0;
json.data = json.data.filter(function(d){
return !d.anonymousSubject;
})
if( callback )callback(json);
}.bind(this))
}
......
......@@ -93,7 +93,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"},
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"},
"createTime" : {
"value" : "function(d){ return MWFForum.getDateDiff( d.createTime ) }"
}
......@@ -129,7 +129,7 @@
"title" : "function(d){ return MWFForum.getLastReplyUserName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.latestReplyUser ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.latestReplyUser, this.data ) }"
},
"latestReplyTime2" : {
"show": "function( d ){ return !d.latestReplyUser ? false : true }",
......@@ -155,18 +155,18 @@
//"access": "admin",
"title": "edit",
"action": "edit",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.isAdmin() || (d.creatorName == this.app.userName)) }",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.isAdmin() || MWFForum.isSubjectEditor(d)) }",
"styles": "actionEditNode",
"mouseoverStyles": "actionEditNode_over",
"mousedownStyles": "actionEditNode_over"
},
"placeholder" : {
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.isAdmin() || (d.creatorName == this.app.userName))) }"
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.isAdmin() || MWFForum.isSubjectEditor(d))) }"
},
"remove": {
"title": "remove",
"action": "remove",
"condition": "function( d ){ return this.isAdmin() || (d.creatorName == this.app.userName) }",
"condition": "function( d ){ return this.isAdmin() || MWFForum.isSubjectEditor(d) }",
"styles": "actionDeleteNode",
"mouseoverStyles": "actionDeleteNode_over",
"mousedownStyles": "actionDeleteNode_down"
......
......@@ -195,10 +195,10 @@ MWF.xApplication.ForumSearch.Main = new Class({
viewPageNum : this.explorer.view.getCurrentPageNum()
};
},
openPerson : function( userName ){
openPerson : function( userName, data ){
if( !userName || userName == "" ){
}else{
MWFForum.openPersonCenter( userName );
MWFForum.openPersonCenter( userName, data );
}
},
createPersonNode : function( container, personName ){
......@@ -338,8 +338,8 @@ MWF.xApplication.ForumSearch.Explorer = new Class({
});
}
},
openPerson : function( userName ){
MWFForum.openPersonCenter( userName );
openPerson : function( userName, data ){
MWFForum.openPersonCenter( userName, data );
},
createPersonNode : function( container, personName ){
var persons = personName.split(",");
......
......@@ -61,7 +61,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
"createTime" : {
"value" : "function(d){ return MWFForum.getDateDiff( d.createTime ) }"
......@@ -125,19 +125,19 @@
"title": "edit",
//"text": "edit",
"action": "edit",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || (d.creatorName == this.app.userName)) }",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || MWFForum.isSubjectEditor(d) ) }",
"styles": "actionEditNode",
"mouseoverStyles": "actionEditNode_over",
"mousedownStyles": "actionEditNode_over"
},
"placeholder" : {
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || (d.creatorName == this.app.userName))) }"
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || MWFForum.isSubjectEditor(d))) }"
},
"remove": {
"title": "remove",
//"text": "remove",
"action": "remove",
"condition": "function( d ){ return this.app.isAdmin || (d.creatorName == this.app.userName) }",
"condition": "function( d ){ return this.app.isAdmin || MWFForum.isSubjectEditor(d) }",
"styles": "actionDeleteNode",
"mouseoverStyles": "actionDeleteNode_over",
"mousedownStyles": "actionDeleteNode_down"
......
......@@ -61,7 +61,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
"createTime" : {
"value" : "function(d){ return MWFForum.getDateDiff( d.createTime ) }"
......@@ -125,19 +125,19 @@
"title": "edit",
//"text": "edit",
"action": "edit",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || (d.creatorName == this.app.userName)) }",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || MWFForum.isSubjectEditor(d)) }",
"styles": "actionEditNode",
"mouseoverStyles": "actionEditNode_over",
"mousedownStyles": "actionEditNode_over"
},
"placeholder" : {
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || (d.creatorName == this.app.userName))) }"
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || MWFForum.isSubjectEditor(d))) }"
},
"remove": {
"title": "remove",
//"text": "remove",
"action": "remove",
"condition": "function( d ){ return this.app.isAdmin || (d.creatorName == this.app.userName) }",
"condition": "function( d ){ return this.app.isAdmin || MWFForum.isSubjectEditor(d) }",
"styles": "actionDeleteNode",
"mouseoverStyles": "actionDeleteNode_over",
"mousedownStyles": "actionDeleteNode_down"
......
......@@ -61,7 +61,7 @@
"title" : "function(d){ return MWFForum.getSubjectCreatorName(d) }",
"styles" : "person",
"mouseoverStyles": "person_over",
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
"event" : "click^^function(node){ this.app.openPerson( this.data.creatorName, this.data ) }"
},
"createTime" : {
"value" : "function(d){ return MWFForum.getDateDiff( d.createTime ) }"
......@@ -125,19 +125,19 @@
"title": "edit",
//"text": "edit",
"action": "edit",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || (d.creatorName == this.app.userName)) }",
"condition": "function( d ){ return (d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || MWFForum.isSubjectEditor(d)) }",
"styles": "actionEditNode",
"mouseoverStyles": "actionEditNode_over",
"mousedownStyles": "actionEditNode_over"
},
"placeholder" : {
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || (d.creatorName == this.app.userName))) }"
"show": "function( d ){ return !((d.typeCategory!='投票' && d.typeCategory!=this.app.lp.vote) && (this.app.isAdmin || MWFForum.isSubjectEditor(d))) }"
},
"remove": {
"title": "remove",
//"text": "remove",
"action": "remove",
"condition": "function( d ){ return this.app.isAdmin || (d.creatorName == this.app.userName) }",
"condition": "function( d ){ return this.app.isAdmin || MWFForum.isSubjectEditor(d) }",
"styles": "actionDeleteNode",
"mouseoverStyles": "actionDeleteNode_over",
"mousedownStyles": "actionDeleteNode_down"
......
......@@ -482,10 +482,10 @@ MWF.xApplication.ForumSection.Main = new Class({
noteHidden : this.noteNodeHidden
};
},
openPerson : function( userName ){
openPerson : function( userName, data ){
if( !userName || userName == "" ){
}else{
MWFForum.openPersonCenter( userName );
MWFForum.openPersonCenter( userName, data );
}
},
createPersonNode : function( container, personName ){
......@@ -588,7 +588,7 @@ MWF.xApplication.ForumSection.Explorer = new Class({
}
//if( this.parent.access.isSubjectPublisher( this.parent.sectionData ) ){
if( this.app.sectionPermission.subjectPublishAble ){
if( this.app.sectionPermission.subjectPublishAble && !MWFForum.isSubjectMuted()){
var createActionNode = new Element("div",{
styles : this.css.toolbarActionNode,
text: this.lp.createSubject
......@@ -804,7 +804,7 @@ MWF.xApplication.ForumSection.Explorer = new Class({
"value" : selectNotice,
"text" : selectNotice
}).inject(select);
var subjectTypeList = this.app.sectionData.subjectTypeList;
var subjectTypeList = (this.app.sectionData.subjectType || "").split("|"); //this.app.sectionData.subjectTypeList;
subjectTypeList.each( function(subjectType, i){
if( !subjectType )return;
if(subjectTypeName!="" && subjectTypeName==subjectType){
......
......@@ -1910,6 +1910,8 @@ MWF.xApplication.Selector.Person.Item = new Class({
load: function(){
if( this.clazz === "Item" ){
this.selector.fireEvent("queryLoadItem",[this]);
}else if( this.clazz === "ItemSelected" ){
this.selector.fireEvent("queryLoadItemSelected",[this]);
}
if( !this.node ){
......@@ -1973,6 +1975,8 @@ MWF.xApplication.Selector.Person.Item = new Class({
if( this.clazz === "Item" ) {
this.selector.fireEvent("postLoadItem", [this]);
}else if( this.clazz === "ItemSelected" ){
this.selector.fireEvent("postLoadItemSelected",[this]);
}
},
loadSubItem: function(){},
......
......@@ -2428,7 +2428,7 @@ bind.Table = function(name){
* var table = new this.Table("table1");
*
* //查询字段name等于zhangsan的数据,结果按updateTime倒序
* table.rowCountWhere( "o.name='zhangsan", function(data){
* table.rowCountWhere( "o.name='zhangsan'", function(data){
* //data 形如
* //{
* // "type": "success",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册