Default Filter Based on logged in member

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
bescott53

Default Filter Based on logged in member

Post by bescott53 » 2019-03-27 12:20

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?

kbarrett
Veteran Member
Posts: 50
Joined: 2019-02-24 16:35
Location: Calgary Alberta

Re: Default Filter Based on logged in member

Post by kbarrett » 2019-03-27 14:24

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.

Post Reply