function getGroupsList($iCompanyId = null, $selectedId = null, $default = 'All')
 {
     $results = '';
     if ($this->eRights == 1) {
         $results = "<input type='hidden' id='" . $this::groupValueFilterName . "' name='" . $this::groupValueFilterName . "'  value='" . $_SESSION["sess_iSGroupIds"][0]['iSGroupId'] . "'>" . $_SESSION["sess_iSGroupId"][0][1];
     } else {
         $user = new User();
         if ($this->eRights < 4) {
             $iCompanyId = $_SESSION['sess_iCompanyId'];
         }
         $list = $user->getGroupsListForUser($this->eRights, $this->iUserId, $iCompanyId, $default == 'Default Group' ? true : false);
         $results = $this->genDynamicDropeDown($list, $this::groupValueFilterName, 'changeGroupList()', $selectedId, $default == 'NO' || $default == 'Default Group' ? null : $default);
     }
     return $results;
     $list = $this->getGroupsListForUser($this->eRights, $this->iUserId, $iCompanyId);
 }
 function getGroupsList($iCompanyId = null, $selectedId = null)
 {
     $results = '';
     if ($this->eRights == 1) {
         $results = "<input type='hidden' id='" . 'iSGroupId' . "' name='" . 'iSGroupId' . "'  value='" . $_SESSION["sess_iSGroupIds"][0]['iSGroupId'] . "'>" . $_SESSION["sess_iSGroupId"][0]['iSGroupId'];
     } else {
         $user = new User();
         if ($this->eRights < 4) {
             $iCompanyId = $_SESSION['sess_iCompanyId'];
         } else {
             $iCompanyId = $this->iCompanyId;
         }
         $list = $user->getGroupsListForUser($this->eRights, $this->iUserId, $iCompanyId, false);
         $results = $this->genDynamicDropeDown($list, 'iSGroupId', 'changeGroupList()', $selectedId);
     }
     return $results;
     $list = $this->getGroupsListForUser($this->eRights, $this->iUserId, $iCompanyId);
 }