Hi,
you can't get that kind of filter using plain sql because you can't write a sql query dependant on active user ID. You will need to write a more complex query, filtering only the record ids containing the user id, and a code tweak able to introduce the active user at the query. So, you will need a query where you use userid with a special enclosure,like:
select........where.....fielduser=##userid##
and introduce a change at source code before launching the query:
joomla\modules\mod_listmanager\helper.php
about line 159 you will find the function
public function getExecuteQuery($query) {
//introduce this line to replace ##userid## for actual user id
$query= str_replace("##userid##",JFactory::getUser()->id,$query);
$db->setQuery($query);
return $db->loadRowList();
}
Hope this helps, regards
FYI - Experimenting with that technique, it seems that one must place ' ' marks around ##userid## in "select........where.....fielduser=##userid##", i.e., "select........where.....fielduser='##userid##'"
Edited by moon_1371 - 07.03.2014 18:44
I have a similar problem with the userids of rows in a View of a List that has 3 fields:
User Id - type User internal name "user"
Description - type Text
fname - type Option List with SQL Action" "Select id,firstname from ove83_comprofiler where id = '##user##'"
I want to list the first name of the user for that row of the List. How can I do that please?
Will the helper.php revision be lost with each new release of ListManager and have to be reentered each update? Or can you make support of "##user##" a feature of the next release?
FYI - Experimenting with that technique, it seems that one must place ' ' marks around ##userid## in "select........where.....fielduser=##userid##", i.e., "select........where.....fielduser='##userid##'"
Edited by moon_1371 - 07.03.2014 18:44
I have a similar problem with the userids of rows in a View of a List that has 3 fields:
User Id - type User internal name "user"
Description - type Text
fname - type Option List with SQL Action" "Select id,firstname from ove83_comprofiler where id = '##user##'"
I want to list the first name of the user for that row of the List. How can I do that please?
Will the helper.php revision be lost with each new release of ListManager and have to be reentered each update? Or can you make support of "##user##" a feature of the next release?
Hi,
I have two lists ( A and B)
The list A has ID,VALUE, User fields (only own records)
In the B list I want to create a custom option list with the values of A list
I put the sql stament for populate the option list, but the list appears with all the values of A inclusive values from others users,
How can i create the option list with the values of A but only the own records not all records.