[Vtigercrm-developers] Help on Related List

Richard Hills - Technologywise richard at tw.co.nz
Wed Apr 22 21:18:24 GMT 2015


Good work Christophe

The only thing missing:
variables when used need to be prefixed with $, so you can use:
> {assign var="ParentRecordMd" value= 
> Vtiger_Record_Model::getInstanceById($RECORD->getId(), 
> $MODULE_MODEL->get('name'))}
> {assign var="RelationListVw" value= 
> Vtiger_RelationListView_Model::getInstance(*$Par**entRecordMd*, 
> $RELATED_LINK->getRelatedModuleName(), $RELATED_LINK->getLabel())}
> {assign var="TotalCountRr" 
> value=*$RelationListVw*->getRelatedEntriesCount()}
(I don't know why, but mine wouldn't parse correctly with the single {} 
containing semi colons..)

And finally you can show the count somewhere with {$TotalCountRr}


On 23/04/15 08:12, Christophe Humbert wrote:
> Hello Richard and All
>
> I have never developed in PHP so please excuse my newbee question but 
> I think I am onto something
> in the file you mentionned after the line mentionned below i.e line 36 
> I have added some code
> {* Assuming most of the related link label would be module name - we 
> perform dual translation *}
>                             {assign var="DETAILVIEWRELATEDLINKLBL" 
> value= vtranslate($RELATED_LINK->getLabel(), 
> $RELATED_LINK->getRelatedModuleName());
> assign var="ParentRecordMd" value= 
> Vtiger_Record_Model::getInstanceById($RECORD->getId(), 
> $MODULE_MODEL->get('name'));
> assign var="RelationListVw" value= 
> Vtiger_RelationListView_Model::getInstance(ParentRecordMd, 
> $RELATED_LINK->getRelatedModuleName(), $RELATED_LINK->getLabel());
> assign var="TotalCountRr" value= 
> RelationListVw->getRelatedEntriesCount();}
>
> But it does not work
> I know that $Record->getId() is working as well as $MODULE... and 
> $RELATED_LINK...
>
> Any further tip would be appreciated
>
> Christophe Humbert
>
>
>
> On Mon, Apr 20, 2015 at 12:37 AM, Richard Hills - Technologywise 
> <richard at tw.co.nz <mailto:richard at tw.co.nz>> wrote:
>
>     layout: layouts/vlayout/modules/Vtiger/DetailViewPostProcess.tpl
>     then you can likely adjust getDetailViewRelatedLinks() inside of
>     ./modules/Vtiger/models/DetailView.php to find the count and pass
>     it through to the template.
>
>     Should be relatively easy to do and you could even chuck in a
>     config switch and submit it to the project.
>
>     This was just a two minute look after seeing the question here, I
>     may be missing some better way to do it, but this is at least one
>     way you should be able to achieve what you want.
>
>     Good luck
>
>
>
>     On 19/04/15 21:59, Simone Travaglini wrote:
>>     +1
>>
>>     2015-04-19 10:46 GMT+02:00 Christophe Humbert
>>     <chrissc.humbert at gmail.com <mailto:chrissc.humbert at gmail.com>>:
>>
>>         Anyone...a tip to guide me in the right direction?
>>
>>         Thanks a lot
>>
>>
>>
>>
>>
>>         On Fri, Apr 17, 2015 at 10:57 AM, Christophe Humbert
>>         <chrissc.humbert at gmail.com
>>         <mailto:chrissc.humbert at gmail.com>> wrote:
>>
>>             Hello Alan
>>
>>             Yes it is present on on-demand version and for me it
>>             should not be too complicated...once you know where to
>>             look at..
>>
>>             and it is clearly a nice plus..
>>
>>
>>             On Fri, Apr 17, 2015 at 10:42 AM, Alan Lord
>>             <alanslists at gmail.com <mailto:alanslists at gmail.com>> wrote:
>>
>>                 On 17/04/15 09:34, Christophe Humbert wrote:
>>
>>                     Hello
>>
>>                     On community Edition, I would like to add in the
>>                     right panel where you
>>                     have all related modules the number of records
>>                     for each modules....
>>
>>
>>                 I have been asking for that for *years*...
>>
>>                 The developers seemed a bit reticent about doing it
>>                 for performance reasons but I noted (I think) that it
>>                 is possible in the On Demand version.
>>
>>                 Al
>>
>>
>>                 _______________________________________________
>>                 http://www.vtiger.com/
>>
>>
>>
>>
>>         _______________________________________________
>>         http://www.vtiger.com/
>>
>>
>>
>>
>>     -- 
>>     Simone Travaglini
>>     328 5499846 <tel:5499846>
>>     Linkedin: Simone Travaglini
>>
>>
>>     Rispetta l'ambiente: non stampare questa mail se non ti è
>>     veramente necessario!
>>
>>
>>     _______________________________________________
>>     http://www.vtiger.com/
>
>     -- 
>     Richard Hills
>     TechnologyWise Ltd, Tauranga, NZ
>     richard at tw.co.nz  <mailto:richard at tw.co.nz>
>     www.technologywise.co.nz  <http://www.technologywise.co.nz>
>     ph:+64 (0)7 571 1060  <tel:%2B64%20%280%297%20571%201060>
>     fax:+64 (0)7 571 1061  <tel:%2B64%20%280%297%20571%201061>
>
>
>     _______________________________________________
>     http://www.vtiger.com/
>
>
>
>
> _______________________________________________
> http://www.vtiger.com/

-- 
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
richard at tw.co.nz
www.technologywise.co.nz
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150423/814edfda/attachment-0001.html>


More information about the vtigercrm-developers mailing list