3 * List of all groups in the system.
5 * Copyright 1999-2000 (c) The SourceForge Crew
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../env.inc.php');
27 require_once('pre.php');
28 require_once('www/admin/admin_utils.php');
30 site_admin_header(array('title'=>_('Group List')));
32 $form_catroot = getStringFromRequest('form_catroot');
33 $form_pending = getStringFromRequest('form_pending');
34 $sortorder = getStringFromRequest('sortorder');
35 $group_name_search = getStringFromRequest('group_name_search');
36 $status = getStringFromRequest('status');
38 // start from root if root not passed in
43 if (!isset($sortorder) || empty($sortorder)) {
44 $sortorder = "group_name";
46 if ($form_catroot == 1) {
47 if (isset($group_name_search)) {
48 echo "<p>"._('Groups that begin with'). " <strong>".$group_name_search."</strong></p>\n";
49 $res = db_query("SELECT group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name,COUNT(user_group.group_id) AS members "
50 . "FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses WHERE license_id=license AND group_name ILIKE '$group_name_search%' "
51 . "GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name "
52 . ($form_pending?"AND WHERE status='P' ":"")
53 . " ORDER BY $sortorder");
55 $res = db_query("SELECT group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name, COUNT(user_group.group_id) AS members "
56 . "FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses "
57 . "WHERE license_id=license "
58 . ($status?"AND status='$status' ":"")
59 . "GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name "
60 . "ORDER BY $sortorder");
63 echo "<p>"._('Group List for Category:').' ';
64 echo "<strong>" . category_fullname($form_catroot) . "</strong></p>\n";
65 $res = db_query("SELECT groups.group_name,groups.register_time,groups.unix_group_name,groups.group_id,"
67 . "licenses.license_name,"
69 . "COUNT(user_group.group_id) AS members "
70 . "FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id,group_category,licenses "
71 . "WHERE groups.group_id=group_category.group_id AND "
72 . "group_category.category_id=".$form_catroot." AND "
73 . "licenses.license_id=groups.license "
74 . "GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name "
75 . "ORDER BY $sortorder");
79 _('Group Name (click to edit)'),
89 '?sortorder=group_name',
90 '?sortorder=register_time',
91 '?sortorder=unix_group_name',
93 '?sortorder=is_public',
94 '?sortorder=license_name',
98 echo $HTML->listTableTop($headers, $headerLinks);
101 while ($grp = db_fetch_array($res)) {
103 if ($grp['status']=='A'){
106 if ($grp['status']=='P'){
109 if ($grp['status']=='D'){
114 if ($grp['register_time'] != 0) {
115 $time_display = date($sys_datefmt,$grp['register_time']);
117 echo '<tr '.$HTML->boxGetAltRowStyle($i).'>';
118 echo '<td><a href="groupedit.php?group_id='.$grp['group_id'].'">'.$grp['group_name'].'</a></td>';
119 echo '<td>'.$time_display.'</td>';
120 echo '<td>'.$grp['unix_group_name'].'</td>';
121 echo '<td class="'.$status.'">'.$grp['status'].'</td>';
122 echo '<td>'.$grp['is_public'].'</td>';
123 echo '<td>'.$grp['license_name'].'</td>';
124 echo '<td>'.$grp['members'].'</td>';
129 echo $HTML->listTableBottom();
131 site_admin_footer(array());