diff --git a/layouts/v7/modules/Vtiger/Comment.tpl b/layouts/v7/modules/Vtiger/Comment.tpl index 0764a0dd502d6f7ff84e21944f46c521a76dc62e..56df0f3668a50450c91de5fd1be0ef6ed84cc186 100644 --- a/layouts/v7/modules/Vtiger/Comment.tpl +++ b/layouts/v7/modules/Vtiger/Comment.tpl @@ -7,6 +7,8 @@ * All Rights Reserved. ************************************************************************************} {strip} + {assign var="PRIVATE_COMMENT_MODULES" value=Vtiger_Functions::getPrivateCommentModules()} + <div class="commentDiv {if $COMMENT->get('is_private')}privateComment{/if}"> <div class="singleComment"> <input type="hidden" name="is_private" value="{$COMMENT->get('is_private')}"> @@ -47,7 +49,18 @@ {/if} <span class="commentTime text-muted cursorDefault"> <small title="{Vtiger_Util_Helper::formatDateTimeIntoDayString($COMMENT->getCommentedTime())}">{Vtiger_Util_Helper::formatDateDiffInStrings($COMMENT->getCommentedTime())}</small> - </span> + </span> + + {if in_array($MODULE_NAME, $PRIVATE_COMMENT_MODULES)} + <span> + {if $COMMENT->get('is_private')} + <i class="fa fa-lock" data-toggle="tooltip" data-placement="top" data-original-title="{vtranslate('LBL_INTERNAL_COMMENT_TOOTLTIP',$MODULE)}"></i> + {else} + <i class="fa fa-unlock" data-toggle="tooltip" data-placement="top" data-original-title="{vtranslate('LBL_EXTERNAL_COMMENT_TOOTLTIP',$MODULE)}"></i> + {/if} + </span> + {/if} + <div class="commentInfoContentBlock"> <span class="commentInfoContent"> {nl2br($COMMENT->get('commentcontent'))} diff --git a/layouts/v7/modules/Vtiger/ShowAllComments.tpl b/layouts/v7/modules/Vtiger/ShowAllComments.tpl index 3cab0f50d5311d2f193b35cbc59fa07c3580beb3..924fc2df4a288421ce7e21d705236ef826d5aca3 100644 --- a/layouts/v7/modules/Vtiger/ShowAllComments.tpl +++ b/layouts/v7/modules/Vtiger/ShowAllComments.tpl @@ -24,7 +24,7 @@ <div class="col-xs-4 pull-right"> <div class="pull-right"> {if in_array($MODULE_NAME, $PRIVATE_COMMENT_MODULES)} - <input type="checkbox" id="is_private"> {vtranslate('LBL_INTERNAL_COMMENT')} + <input type="checkbox" id="is_private" checked> {vtranslate('LBL_INTERNAL_COMMENT')} <i class="fa fa-question-circle cursorPointer" data-toggle="tooltip" data-placement="top" data-original-title="{vtranslate('LBL_INTERNAL_COMMENT_INFO')}"></i> {/if} <button class="btn btn-success btn-sm saveComment" type="button" data-mode="add"><strong>{vtranslate('LBL_POST', $MODULE_NAME)}</strong></button> @@ -66,7 +66,7 @@ </div> <div class="pull-right row"> {if in_array($MODULE_NAME, $PRIVATE_COMMENT_MODULES)} - <input type="checkbox" id="is_private"> {vtranslate('LBL_INTERNAL_COMMENT')} + <input type="checkbox" id="is_private" checked> {vtranslate('LBL_INTERNAL_COMMENT')} {/if} <button class="btn btn-success btn-sm saveComment" type="button" data-mode="add"><strong>{vtranslate('LBL_POST', $MODULE_NAME)}</strong></button> <a href="javascript:void(0);" class="cursorPointer closeCommentBlock cancelLink" type="reset">{vtranslate('LBL_CANCEL', $MODULE_NAME)}</a> diff --git a/layouts/v7/modules/Vtiger/resources/Detail.js b/layouts/v7/modules/Vtiger/resources/Detail.js index fc0f6890f9560660154668e1fa9737fd42e2db05..c15a077d24a82479439fb54af97cdae4597aa1db 100644 --- a/layouts/v7/modules/Vtiger/resources/Detail.js +++ b/layouts/v7/modules/Vtiger/resources/Detail.js @@ -2823,7 +2823,7 @@ Vtiger.Class("Vtiger_Detail_Js",{ var commentTextAreaElement = closestAddCommentBlock.find('.commentcontent'); var commentInfoBlock = currentTarget.closest('.singleComment'); commentTextAreaElement.val(''); - closestAddCommentBlock.find('#is_private').removeAttr('checked'); + if(mode == "add"){ var commentId = data['id']; var commentHtml = self.getCommentUI(commentId); diff --git a/modules/Vtiger/views/Detail.php b/modules/Vtiger/views/Detail.php index 5040b7e5897e702500f9e040bc9e544da65e06e8..1d8411a88852f214f6c158fa391777682ada2fe6 100644 --- a/modules/Vtiger/views/Detail.php +++ b/modules/Vtiger/views/Detail.php @@ -574,11 +574,13 @@ class Vtiger_Detail_View extends Vtiger_Index_View { $childComments = $parentCommentModel->getChildComments(); $currentUserModel = Users_Record_Model::getCurrentUserModel(); $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments'); + $moduleName = $parentCommentModel->getParentRecordModel()->getModuleName(); $viewer = $this->getViewer($request); $viewer->assign('PARENT_COMMENTS', $childComments); $viewer->assign('CURRENTUSER', $currentUserModel); $viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel); + $viewer->assign('MODULE_NAME', $moduleName); return $viewer->view('CommentsList.tpl', $moduleName, 'true'); } diff --git a/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php b/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php index bf8a3d429f7133479748662e0e592137a8689d25..ec616376b77281aaeb3f5c1af6c8e4468f5cfe78 100644 --- a/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php +++ b/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php @@ -20,6 +20,7 @@ class ModComments_DetailAjax_View extends Vtiger_IndexAjax_View { $viewer = $this->getViewer($request); $viewer->assign('CURRENTUSER', $currentUserModel); $viewer->assign('COMMENT', $recordModel); + $viewer->assign('MODULE_NAME', $recordModel->getParentRecordModel()->getModuleName()); $viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel); echo $viewer->view('Comment.tpl', $moduleName, true); }