From be7d79ea339d3b075c5cfd5846712f9d9cb82fd8 Mon Sep 17 00:00:00 2001
From: Akshath <akshath.t@vtiger.com>
Date: Mon, 15 Oct 2018 12:26:59 +0530
Subject: [PATCH] Fix #1061

---
 layouts/v7/modules/Vtiger/AddCommentFooter.tpl | 4 +++-
 layouts/v7/modules/Vtiger/RecentComments.tpl   | 8 +++++---
 layouts/v7/modules/Vtiger/ShowAllComments.tpl  | 8 +++++---
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/layouts/v7/modules/Vtiger/AddCommentFooter.tpl b/layouts/v7/modules/Vtiger/AddCommentFooter.tpl
index 24387c8b..9986e67a 100644
--- a/layouts/v7/modules/Vtiger/AddCommentFooter.tpl
+++ b/layouts/v7/modules/Vtiger/AddCommentFooter.tpl
@@ -13,7 +13,9 @@
     <div class="modal-footer">
         <div class="row-fluid">
             <div class="col-xs-6">
-                {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE_NAME)}
+                {if $FIELD_MODEL->getProfileReadWritePermission()}
+                    {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE_NAME)}
+                {/if}
             </div>
             <div class="col-xs-6">
                 <div>
diff --git a/layouts/v7/modules/Vtiger/RecentComments.tpl b/layouts/v7/modules/Vtiger/RecentComments.tpl
index a12f69e1..5ec4bdb7 100644
--- a/layouts/v7/modules/Vtiger/RecentComments.tpl
+++ b/layouts/v7/modules/Vtiger/RecentComments.tpl
@@ -38,9 +38,11 @@
 							<button class="btn btn-success btn-sm detailViewSaveComment" type="button" data-mode="add">{vtranslate('LBL_POST', $MODULE_NAME)}</button>
 						</div>
 					</div>
-					<div class="col-xs-6 pull-left">
-						{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE_NAME) MODULE="ModComments"}
-					</div>
+                                        {if $FIELD_MODEL->getProfileReadWritePermission()}
+                                            <div class="col-xs-6 pull-left">
+                                                    {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE_NAME) MODULE="ModComments"}
+                                            </div>
+                                        {/if}
 				</div>
 			</div>
 		{/if}
diff --git a/layouts/v7/modules/Vtiger/ShowAllComments.tpl b/layouts/v7/modules/Vtiger/ShowAllComments.tpl
index ec07af50..3cab0f50 100644
--- a/layouts/v7/modules/Vtiger/ShowAllComments.tpl
+++ b/layouts/v7/modules/Vtiger/ShowAllComments.tpl
@@ -30,9 +30,11 @@
 								<button class="btn btn-success btn-sm saveComment" type="button" data-mode="add"><strong>{vtranslate('LBL_POST', $MODULE_NAME)}</strong></button>
 							</div>
 						</div>
-						<div class="col-xs-8 pull-left">
-							{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE_NAME) MODULE="ModComments"}
-						</div>
+                                                {if $FIELD_MODEL->getProfileReadWritePermission()}
+                                                    <div class="col-xs-8 pull-left">
+                                                            {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE_NAME) MODULE="ModComments"}
+                                                    </div>
+                                                {/if}
 					</div>
 				</div>
 			</div>
-- 
GitLab