• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

Filter records based on user's company

I'm trying to find the best way to filter lists to show only records from where the record shares the user's company value. I currently have a fabrik_users table that stores a company name (databasejoin) and also creates new juser records. Two parts to this problem, I think:
Storing the user's company name in...session? Since there are multiple tables where the same sort of filter will be applied, it'd be nice if I could access a value from the user object or a session object so that I don't constantly need to re-query each time the user wants to see another table.

Filtering the list: I've been able to create a canviewrow plug-in filter. But that plugin only removes the link to the details view. It doesn't actually remove the row from the records displayed in the list view. Other places I've tried to put a filter (menu item, menu url, table pre-filter) only show one little input field to store a filter. My filter will require multiple lines of code, so none of these places seem right.

So two questions:
  • what's the best way to make the user's company value accessible?
  • what's the best way to show only records that match the user's company?
 
Ah, thanks! I didn't even notice the plus sign and was trying to stuff my whole query into the PreQuery Filter input field. Following that thread, I was able to update the query style and get the right result. Cheers!
 

Members online

No members online now.
Back
Top