Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Menu item when user invovled 20 May 2015 18:24 #13130

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
If a user is set as a filter in a grid view, you have an option when you create the menu item to select the user you want to filter by

Can we have an extra option

- Dynamically filter by LOGGED IN USER at the time the menu item is clicked i.e JFactory::getUser();

Using ACL and some minor code changes this can be achieved but it would be sweet if we just had a menu item that did it. This allows us to have a dynamic filter that pulls off record auto filtered by whoever is logged in which for me has a lot of great uses as my last few projects have been callout systems, booking systems etc
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Last edit: by MorganL.

Menu item when user invovled 20 May 2015 18:27 #13131

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
um.. i think I am being stupid, that already looks in place... NO WAY! If that is the case I am cracking champagne.. um.. well tomorrow I am as I am on call tonight
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Menu item when user invovled 20 May 2015 18:56 #13132

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Yes, it is already in place. (for lists only)
$model->setState('filter.the_user', 'auto')

EDIT : And for menu item, just click on the user icon, it will select 'Auto'
Coding is now a piece of cake
The following user(s) said Thank You: MorganL

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Menu item when user invovled 20 May 2015 19:35 #13133

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
That really is an amazing functionality, I always though AUTO was just to take the id of the person logged into admin, never thought to click it.

This has saved me a LOT of time!
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Menu item when user invovled ( New Question ) 28 Aug 2015 07:52 #13424

Hi, I have set the menu item to filter by user name ( created by ) . But after entering a new item the list view defaults back to all. How do I get it to stay as the current user?? I've tried putting in the code above but get an error.

Fatal error: Call to a member function setState() on a non-object in /home/safer180/public_html/components/com_chemicals/views/chemregister/tmpl/default_grid.php on line

Man I wish I had more time to learn the code properly.

Please Log in or Create an account to join the conversation.

Last edit: by jonathanbell.
  • Page:
  • 1
Time to create page: 0.062 seconds

  I want to save the world...... let's cook a solution about it.
VeCrea (Forum)

Get Started