[Vtigercrm-developers] Custom UItype (upload file field) working well except on Calendar/Events

Uma S uma.s at vtiger.com
Wed Jan 28 09:02:08 GMT 2015


Hi,

Thanks! for providing the information :)

The above given information will implies for all modules. What i mean in
previous thread is, when calendar edit-view is displayed there you need to
debug and check what is the field-model that's been generated for custom
field.

On Wed, Jan 28, 2015 at 1:38 PM, apcloic <apcloic at gmail.com> wrote:

> Hi Uma,
>
> Here's the model field :
>
>         /**
>          * Function to get the Template name for the current UI Type object
>          * @return <String> - Template Name
>          */
>         public function getTemplateName() {
>                 return 'uitypes/FileField.tpl';
>         }
>
>         /**
>          * Function to get the Display Value, for the current field type
> with given
> DB Insert Value
>          * @param <String> $value
>          * @param <Integer> $recordId
>          * @param <Vtiger_Record_Model>
>          * @return <String>
>          */
>         public function getDisplayValue($value, $recordId, $recordModel =
> false) {
>                 $moduleName = $this->get('field')->getModule()->getName();
>                 if(!$recordModel) {
>                         $recordModel =
> Vtiger_Record_Model::getInstanceById($recordId,
> $moduleName);
>                 }
>
>                 if($recordModel) {
>                         if(!empty($value)) {
>                                 $db = PearDatabase::getInstance();
>                                 $fileIdRes = $db->pquery('SELECT
> vtiger_attachments.name FROM
> vtiger_attachments
>                                                                 WHERE
> vtiger_attachments.attachmentsid=?', array($value));
>                                 //$fileId = $db->query_result($fileIdRes,
> 0, 'attachmentsid');
>                                 //if($fileId){
>                                         $value = '
> '.$db->query_result($fileIdRes, 0, 'name').'
>
> <index.php?module='.$moduleName.'&action=DownloadFile&record='.$recordId.'&fileid='.$value.'>
> ';
>                                 //}
>                         }
>                 }
>                 return $value;
>
> File.php <http://vtiger-crm.2324883.n4.nabble.com/file/n15057/File.php>
>
> Thanks ;)
> Regards,
>
>
>
> --
> View this message in context:
> http://vtiger-crm.2324883.n4.nabble.com/Custom-UItype-upload-file-field-working-well-except-on-Calendar-Events-tp15047p15057.html
> Sent from the vtigercrm-developers mailing list archive at Nabble.com.
> _______________________________________________
> http://www.vtiger.com/
>



-- 
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150128/419e7424/attachment.html>


More information about the vtigercrm-developers mailing list