Setting current user view in Custom Views – vTiger

Thanks to this forum post on vTiger, one additional change needs to be made to the CustomView code in order to get the CURRENTUSER variable to work (I don’t know which versions of vTiger it applies to, but I think to all version of 5.x):

function getRealValues($tablename,$fieldname,$comparator,$value,$datatype)
        {
                if($fieldname == "smownerid" || $fieldname == "inventorymanager")
                {
                        /* HACK - to get current user */
                        global $current_user;
                        if ($value == "CURRENTUSER")
                                $value = $current_user->user_name;
                        /* End HACK */ 

                        $value = $tablename.".".$fieldname.$this->getAdvComparator($comparator,getUserId_Ol($value),$datatype);
                } else if($fieldname == "parentid")

No comments yet

Leave a reply