/** * get masterdata tables * * @return array */ function churchdb_getMasterDataTables() { $tables = churchdb_getMasterDataTablenames(); foreach ($tables as $t) { $res[$t["shortname"]] = churchcore_getTableData($t["tablename"], $t["sql_order"]); // auth data needed? if (isset($t["special_func"]) && $t["special_func"]["func"] == "editAuth") { foreach ($res[$t["shortname"]] as $data) { $data->auth = getAuthForDomain($data->id, $t["shortname"]); } } } return $res; }
/** * Get all groups * * @return object db result containing groups */ function getAllGroups() { $arr = churchcore_getTableData("cdb_gruppe", "bezeichnung"); if (!$arr) { return null; } foreach ($arr as $val) { $tags = db_query("SELECT tag_id FROM {cdb_gruppe_tag} gt WHERE gruppe_id=:gruppe_id", array(":gruppe_id" => $val->id)); $ids = array(); foreach ($tags as $tag) { $ids[] = $tag->tag_id; } $arr[$val->id]->tags = $ids; $arr[$val->id]->auth = getAuthForDomain($val->id, "gruppe"); } return $arr; }