/** * Function to get comment fields list which are useful in tasks * @param <Vtiger_Module_Model> $moduleModel * @return <Array> list of Field models <Vtiger_Field_Model> */ public static function getCommentFieldsListForTasks($moduleModel) { $commentsFieldsInfo = array('lastComment' => 'Last Comment', 'last5Comments' => 'Last 5 Comments', 'allComments' => 'All Comments'); $commentFieldModelsList = array(); foreach ($commentsFieldsInfo as $fieldName => $fieldLabel) { $commentField = new Vtiger_Field_Model(); $commentField->setModule($moduleModel); $commentField->set('name', $fieldName); $commentField->set('label', $fieldLabel); $commentFieldModelsList[$fieldName] = $commentField; } return $commentFieldModelsList; }