Ejemplo n.º 1
0
 /**
  * Function sends all the comments for a parent(Accounts, Contacts etc)
  * @param Vtiger_Request $request
  * @return <type>
  */
 function showAllComments(Vtiger_Request $request)
 {
     $parentRecordId = $request->get('record');
     $commentRecordId = $request->get('commentid');
     $moduleName = $request->getModule();
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
     $parentCommentModels = ModComments_Record_Model::getAllParentComments($parentRecordId);
     if (!empty($commentRecordId)) {
         $currentCommentModel = ModComments_Record_Model::getInstanceById($commentRecordId);
     }
     $viewer = $this->getViewer($request);
     $viewer->assign('CURRENTUSER', $currentUserModel);
     $viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel);
     $viewer->assign('PARENT_COMMENTS', $parentCommentModels);
     $viewer->assign('CURRENT_COMMENT', $currentCommentModel);
     return $viewer->view('ShowAllComments.tpl', $moduleName, 'true');
 }