Welcome, Guest
Username: Password: Remember me

TOPIC: [FAQ] Menu item when user invovled

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

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 437
  • Thank you received: 53
  • Karma: 20
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
Last Edit: 20 May 2015 18:25 by MorganL.
The administrator has disabled public write access.

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

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 437
  • Thank you received: 53
  • Karma: 20
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
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3701
  • Thank you received: 972
  • Karma: 140
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
Last Edit: 20 May 2015 18:59 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: MorganL

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

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 437
  • Thank you received: 53
  • Karma: 20
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
The administrator has disabled public write access.

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

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 127
  • Thank you received: 4
  • Karma: 1
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.
Last Edit: 28 Aug 2015 07:54 by jonathanbell.
The administrator has disabled public write access.
Time to create page: 0.074 seconds

Get Started