Explorar o código

Merge branch 'feature/CMS.comment_disable_comment' into 'wrdp'

Merge of feature/CMS.comment_disable_comment 增加内容管理评论的发布开关 to wrdp

See merge request o2oa/o2oa!2308
蔡祥熠 %!s(int64=5) %!d(string=hai) anos
pai
achega
ad48ccdb6c

+ 9 - 2
o2web/source/x_component_cms_FormDesigner/Module/Comment/comment.html

@@ -25,11 +25,18 @@
 			</tr>
 			<tr>
 				<td class="editTableValue" colspan="2">
-					<b>发后允许修改:</b>
-					<input class="editTableRadio" name="isAllowModified" text{($.isAllowModified==true)?'checked':''} type="radio" value="true"/>是
+					<b>发后允许修改:</b>
+					<input class="editTableRadio" name="isAllowModified" text{($.isAllowModified!=false)?'checked':''} type="radio" value="true"/>是
 					<input class="editTableRadio" name="isAllowModified" text{($.isAllowModified==false)?'checked':''} type="radio" value="false"/>否
 				</td>
 			</tr>
+			<tr>
+				<td class="editTableValue" colspan="2">
+					<b>允许发表评论:</b>
+					<input class="editTableRadio" name="isAllowPublish" text{($.isAllowPublish!=false)?'checked':''} type="radio" value="true"/>是
+					<input class="editTableRadio" name="isAllowPublish" text{($.isAllowPublish==false)?'checked':''} type="radio" value="false"/>否
+				</td>
+			</tr>
 		</table>
 
 		<!--<div class="MWFMaplist" name="styles" title="样式"></div>-->

+ 1 - 0
o2web/source/x_component_cms_Xform/Comment.js

@@ -25,6 +25,7 @@ MWF.xApplication.cms.Xform.Comment = MWF.CMSComment =  new Class({
             "documentId" : this.form.businessData.document.id,
             "countPerPage" : this.json.countPerPage || 10,
             "isAllowModified" : this.json.isAllowModified,
+            "isAllowPublish" : this.json.isAllowPublish,
             "isAdmin" : this.form.app.isAdmin,
             "editorProperties" : config
         });

+ 5 - 2
o2web/source/x_component_cms_Xform/widget/Comment.js

@@ -8,7 +8,8 @@ var O2CMSComment = MWF.xApplication.cms.Xform.widget.Comment = new Class({
         "style": "simple",
         "documentId" : "",
         "anonymousAccess" : false,
-        "countPerPage" : 10
+        "countPerPage" : 10,
+        "isAllowPublish" : true
     },
     initialize: function (app, node, options) {
         this.setOptions(options);
@@ -44,7 +45,9 @@ var O2CMSComment = MWF.xApplication.cms.Xform.widget.Comment = new Class({
         this.loadContent();
         //this.loadElementList();
         //this.loadBottom();
-        this.loadEditor();
+        if( this.options.isAllowPublish !== false ){
+            this.loadEditor();
+        }
     },
     loadTitle : function(){
         this.titleNode = new Element("div", {"styles": this.css.titleNode, "text": this.lp.commentTitle}).inject(this.container);