3 * List of all groups in the system.
5 * Copyright 1999-2000 (c) The SourceForge Crew
7 * This file is part of GForge.
9 * GForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * GForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with GForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 require_once('../env.inc.php');
25 require_once $gfwww.'include/pre.php';
26 require_once $gfwww.'admin/admin_utils.php';
28 site_admin_header(array('title'=>_('Project List')));
29 echo '<h1>' . _('Project List') . '</h1>';
31 $form_catroot = getStringFromRequest('form_catroot');
32 $form_pending = getStringFromRequest('form_pending');
33 $sortorder = getStringFromRequest('sortorder');
34 $group_name_search = getStringFromRequest('group_name_search');
35 $status = getStringFromRequest('status');
37 // start from root if root not passed in
42 $sortorder = util_ensure_value_in_set ($sortorder,
51 if ($form_catroot == 1) {
52 if (isset($group_name_search)) {
53 echo "<p>"._('Groups that begin with'). " <strong>".$group_name_search."</strong></p>\n";
54 $res = db_query_params ('SELECT group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name,COUNT(user_group.group_id) AS members
56 LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses
57 WHERE license_id=license
58 AND lower(group_name) LIKE $1
59 AND (status=$2 OR 1!=$3)
60 GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name
61 ORDER BY '.$sortorder,
62 array (strtolower ("$group_name_search%"),
64 $form_pending ? 1 : 0)) ;
66 $qpa = db_construct_qpa (false, 'SELECT group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name, COUNT(user_group.group_id) AS members FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses WHERE license_id=license') ;
68 $qpa = db_construct_qpa ($qpa, ' AND status=$1', array ($status)) ;
70 $qpa = db_construct_qpa ($qpa, ' GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name ORDER BY '.$sortorder) ;
71 $res = db_query_qpa ($qpa) ;
74 echo "<p>"._('Group List for Category:').' ';
75 echo "<strong>" . category_fullname($form_catroot) . "</strong></p>\n";
76 $res = db_query_params('SELECT groups.group_name,groups.register_time,groups.unix_group_name,groups.group_id,groups.is_public,licenses.license_name,groups.status, count(user_group.group_id) AS members FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id,group_category,licenses WHERE groups.group_id=group_category.group_id AND group_category.category_id=$1 AND licenses.license_id=groups.license GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name ORDER BY '.$sortorder,
77 array($form_catroot));
81 _('Group Name (click to edit)'),
91 '/admin/grouplist.php?sortorder=group_name',
92 '/admin/grouplist.php?sortorder=register_time',
93 '/admin/grouplist.php?sortorder=unix_group_name',
94 '/admin/grouplist.php?sortorder=status',
95 '/admin/grouplist.php?sortorder=is_public',
96 '/admin/grouplist.php?sortorder=license_name',
97 '/admin/grouplist.php?sortorder=members'
100 echo $HTML->listTableTop($headers, $headerLinks);
103 while ($grp = db_fetch_array($res)) {
105 if ($grp['status']=='A'){
108 if ($grp['status']=='P'){
111 if ($grp['status']=='D'){
116 if ($grp['register_time'] != 0) {
117 $time_display = date(_('Y-m-d H:i'),$grp['register_time']);
119 echo '<tr '.$HTML->boxGetAltRowStyle($i).'>';
120 echo '<td><a href="groupedit.php?group_id='.$grp['group_id'].'">'.$grp['group_name'].'</a></td>';
121 echo '<td>'.$time_display.'</td>';
122 echo '<td>'.$grp['unix_group_name'].'</td>';
123 echo '<td class="'.$status.'">'.$grp['status'].'</td>';
124 echo '<td>'.$grp['is_public'].'</td>';
125 echo '<td>'.$grp['license_name'].'</td>';
126 echo '<td>'.$grp['members'].'</td>';
131 echo $HTML->listTableBottom();
133 site_admin_footer(array());
137 // c-file-style: "bsd"