- Template Name */ public function getTemplateName() { return 'uitypes/DocumentsFileUpload.tpl'; } /** * Function to get the Display Value, for the current field type with given DB Insert Value * @param $value * @param $recordId * @param * @return */ public function getDisplayValue($value, $recordId=false, $recordModel=false) { if($recordModel) { $fileLocationType = $recordModel->get('filelocationtype'); $fileStatus = $recordModel->get('filestatus'); if(!empty($value) && $fileStatus) { if($fileLocationType == 'I') { $db = PearDatabase::getInstance(); $fileIdRes = $db->pquery('SELECT attachmentsid FROM vtiger_seattachmentsrel WHERE crmid = ?', array($recordId)); $fileId = $db->query_result($fileIdRes, 0, 'attachmentsid'); if($fileId){ $value = ''.$value.''; } } else { $value = ''.$value.''; } } } return $value; } }