/** Function to load the user Group details * @returns boolean * @private */ function _loadGroupTable() { // Load the first group because it is the Global Group $sql = DB::limit("SELECT * FROM tblGroup", 0, 1); $tab = new DBTable(DB::DEF, $sql, null, DB::FETCH_ASSOC); if ($tab->isEmpty()) { return false; } $fldGroup = []; $fldGroup[$tab->getValue("fldGroupID")] = $tab->getValue("fldName"); // get the groups that are related to this client $sql = "SELECT g.* FROM tblGroup g, tblUserGroupMap map " . "WHERE map.fldUserID='" . $this->prefs->get("fldIserID") . "' " . "AND map.fldGroupID=g.fldGroupID "; $tab = new DBTable(DB::DEF, $sql, null, DB::FETCH_ASSOC); if (!$tab->isEmpty()) { for ($i = 0; $i < $tab->getRowCount(); $i++) { $fldGroup[$tab->getValue("fldGroupID", $i)] = $tab->getValue("fldName", $i); } } $this->prefs->put("fldGroup", $fldGroup); // return true/success return TRUE; }