[Fusionforge-commits] r16122 - trunk/src/common/include

Olivier Berger olberger at fusionforge.org
Tue Aug 21 16:50:35 CEST 2012


Author: olberger
Date: 2012-08-21 16:50:35 +0200 (Tue, 21 Aug 2012)
New Revision: 16122

Modified:
   trunk/src/common/include/Group.class.php
Log:
Extract from trove's full list the query for public active projects

Modified: trunk/src/common/include/Group.class.php
===================================================================
--- trunk/src/common/include/Group.class.php	2012-08-21 14:50:07 UTC (rev 16121)
+++ trunk/src/common/include/Group.class.php	2012-08-21 14:50:35 UTC (rev 16122)
@@ -150,6 +150,32 @@
 	return group_get_object(db_result($res, 0, 'group_id'), $res);
 }
 
+/**
+ * get_public_active_projects_asc() - Get a list of rows for public active projects (initially in trove/full_list)
+ *
+ * @param	   int	 Opional Maximum number of rows to limit query length 
+ */
+function get_public_active_projects_asc($max_query_limit = -1) {
+
+	$res_grp = db_query_params ('
+			SELECT group_id, group_name, unix_group_name, short_description, register_time
+			FROM groups
+			WHERE status = $1 AND type_id=1 AND group_id>4 AND register_time > 0
+			ORDER BY group_name ASC
+			',
+			array ('A'),
+			$max_query_limit);
+	$projects = array();
+	while ($row_grp = db_fetch_array($res_grp)) {
+		if (!forge_check_perm ('project_read', $row_grp['group_id'])) {
+			continue ;
+		}
+		$projects[] = $row_grp;
+	}
+	return $projects;
+}
+
+
 class Group extends Error {
 	/**
 	 * Associative array of data from db.




More information about the Fusionforge-commits mailing list