CoreBOSBB
corebosCP : custom module show all records - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: Administrator Support (https://discussions.corebos.org/forumdisplay.php?fid=8)
+--- Thread: corebosCP : custom module show all records (/showthread.php?tid=107)



corebosCP : custom module show all records - saidmsl - 03-29-2015

Hi,

i have created a custom module with field link (uitype =10) to organisations

however, in the CP, i see all records although they are not related to the logged contact

any ideas to debug?

rgds


Re: corebosCP : custom module show all records - joebordes - 03-30-2015

I created a ticket and did some testing:

<!-- m --><a class="postlink" href="http://corebos.org/development/view.php?id=280">http://corebos.org/development/view.php?id=280</a><!-- m -->

try that and let me know how it goes.


Re: corebosCP : custom module show all records - saidmsl - 03-30-2015

Hi,

it's a custom module - not the existing one which works

module Points :
id
Name
accountid --> uitype 10 related to Organisations

when i enable the Module Points in CP , i see all records but it should be filtered to only accountid

i'll try to debug it


Re: corebosCP : custom module show all records - joebordes - 03-30-2015

I think it should work the same. Please try to get the SQL to see if it is constructing it correctly.


Re: corebosCP : custom module show all records - saidmsl - 03-30-2015

Found it

in VTActiveResource.php
function defaultScope :

add the condition in the switch

case 'Points': //MSL
$condition = array('condition'=>"accountid='".Yii::app()->user->accountId."'");
break;

it does not construct the condition automatically using the field definition (ex : if uipte =10 and reltabid = 6) ==> $fieldname ==> ...


Re: corebosCP : custom module show all records - joebordes - 03-30-2015

I was tempted to tell you to add that but since you were capturing accounts I thought the switch would be applying the "Accounts" entry.

Glad you got it working. I will see if we can make this part of the application more generic