Hi,
I am trying to hide menu(s) for users who meet the following two conditions. I tried the conditions individually and it seems the second condition is not working.
- User security group (e.g. Employee) <---- Working
- The user has no record in a custom view (e.g. TS_Delegate_VW) <---- Not Working
I have the following code in the "Menu Item: Modify" event
$rs = DB::Query("select count(DelegateEmpNo) as cnt from TS_Delegate_VW where DelegateEmpNo=".$_SESSION["EmpNo"]." ");
$data = $rs->fetchAssoc();
if (Security::getUserGroup()=="Employee" && $data["cnt"] = 0) {
$title = $menuItem->getTitle();
if ($title=="Leave Approval" || $title=="Timesheet Approval")
return false;
}
return true;
I am using the above SQL query in other page events and it's working for me. Unable to figure out why it's not working here.
Any help/direction is greatly appreciated.
Thank you,
Abhi