Just to add to ticket and extend a little further something from one of my other posts
can i suggest to have an additional option in the menu filters
- the current user (if its not already done)
Have not tested below code but should be close to what is needed
SELECT
a.name AS 'name'
, if(a.id = (int) JFactory::getUser()->id , "CUID", a.id) AS 'ID' // values for id column
, if(a.id = (int) JFactory::getUser()->id , "Current User", a.username) AS 'username' // values for username column
, if(a.id = (int) JFactory::getUser()->id , "a.id = (int) JFactory::getUser()->id", a.id , 'filter.' . $fieldname . 'text' ) AS 'filtertext' // the default value for setState('filter.somefield')
FROM #__dbprefix_users AS 'a'
WHERE a.id=the_filter_id_selected
OR a.id=(int) JFactory::getUser()->id
This would then display a list like
ID | name | username |
1 | Alexander Admin | mr.admin |
2 | Elizabeth Editor | mrs.editor |
3 | Mary Manager | miss.manager |
4 | Garry Guest | mr.guest |
CUID | Current User | currentuser |
the filtertext field needs to take into account the current field as you can have multiple instances of Joomla User field
such as created_by, modified_by, my_juser, my_juser_wife, my_juser_brother...
hence the code
'filter.' . $fieldname . 'text'
This would allow practically all filter fields of juser to be set to the current user
an example would be
show all records
created by me OR modified by me OR checked out by me
AND WHERE Freds brother is me OR Marys brother is me
....
i think you get the picture
but this would also mean you could show more complex scenarios
As always just another thought