Page 1 of 1

Default Filter Based on logged in member

Posted: 2019-03-27 12:20
by bescott53
Hello everyone, is there a way to apply a default filter based on who has looged in?

I have a table called people and another actions, what i want is to be able to filter the actions for 1 logged in member to see all actions entered by other users who have a title of RET Operations in the people table

has anyone done this before?

Re: Default Filter Based on logged in member

Posted: 2019-03-27 14:24
by kbarrett
Hi,

I had a similar dilemma. Have a look at this post. https://forums.appgini.com/phpbb/viewto ... f=7&t=2944

I finally got it to work using Hooks. You can use the memberInfo something like:

function MyTable_init(&$options, $memberInfo, &$args){

if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
$memberInfo = getMemberInfo();
addFilter( 1, 'and', 2, '==', $memberInfo['custom']['2']);
}
return TRUE;
}
Can you use something from the membership_users table? This way the view can be filtered. Just a thought.