This topic is locked

List page - search not working with where clause

11/27/2012 5:40:33 AM
PHPRunner General questions
S
StefanoF author

Hi everyone.
I'm working on PHP Runner 6.2.
I've a page list that has to be filtered depending on the user role. At the moment the roles are 2 and the filter is applied only to one of them. So I've inserted in the "Before SQL query" the following code :
if ($_SESSION['ROLE_ID'] != 1)

$strWhereClause = "reviewer_id = ".$_SESSION['EMP_NUMBER'];
therefore, if role is not '1', the user can see only his own records.

When I log in with role '1' everything works perfectly.

With the other role, once the filter is applied, the search function does not work anymore. With the Ajax functionality the text to be searched in found, but when I press the search button nothing happens. I've also tried with the advanced search but no results.

So far I've solved it by moving the where clause in the "After table initialized", but I'm sure that the search funtion should work even with a where clause in the "Before SQL query".

So what am I missing ???
Thanks.
Stefano