[Vtigercrm-developers] DetailJson.php

Adam Heinz amh at metricwise.net
Wed May 15 20:24:10 UTC 2013


Thanks for the tip!  We don't allow any unauthenticated access, so I always
have global $current_user handy.  Then it's just a matter of
using vtws_getWebserviceEntityId to combine $record+$module to get $wsid.

It does seem kind of backwards though, as VtigerModuleOperation.retrieve is
just going to split the id apart again, then call VtigerCRMObject.read,
which calls CRMEntity.retrieve_entity_info, which is what I'm already doing!


On Wed, May 15, 2013 at 3:43 PM, Stefan Warnat <ich at stefanwarnat.de> wrote:

>  Hy Adam,
>
> You could do this easier.
> If you use vtws_retrieve($wsid, $user), you get the date and number
> formats like the user use it.
> The only challenge is, you needs an valid user object, which makes this
> way slower.
>
> Stefan
>
> Am 15.05.2013 21:06, schrieb Adam Heinz:
>
>  I don't know why I didn't think of this earlier, but it certainly is
> handy to be able to grab arbitrary entity data as JSON.  The only thing
> I've noticed is that dates come out with the back end format, so I've been
> casing those out with DateTimeField::convertToUserFormat.
>
>  <?php
> global $module, $record;
> if ($record && isPermitted($module, 'DetailView', $record) == 'yes') {
>  $focus = CRMEntity::getInstance($module);
>  $focus->retrieve_entity_info($record, $module);
>  header("Content-type: text/javascript");
>   echo json_encode($focus->column_fields);
> }
>
>
>
> _______________________________________________http://www.vtiger.com/
>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130515/c2bc8da2/attachment.html>


More information about the vtigercrm-developers mailing list