[Vtigercrm-developers] DetailJson.php
Stefan Warnat
ich at stefanwarnat.de
Wed May 15 19:43:43 UTC 2013
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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130515/09b7d889/attachment.html>
More information about the vtigercrm-developers
mailing list