3 * Copyright (C) 2008-2009 Alcatel-Lucent
4 * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
6 * This file is part of FusionForge.
8 * FusionForge is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Gforge; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Standard Alcatel-Lucent disclaimer for contributing to open source
26 * "The Full List ("Contribution") has not been tested and/or
27 * validated for release as or in products, combinations with products or
28 * other commercial use. Any use of the Contribution is entirely made at
29 * the user's own responsibility and the user can not rely on any features,
30 * functionalities or performances Alcatel-Lucent has attributed to the
33 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
34 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
36 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
37 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
38 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
39 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
41 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
46 require_once('../env.inc.php');
47 require_once $gfcommon.'include/pre.php';
48 require_once $gfwww.'include/trove.php';
50 if (!forge_get_config('use_project_full_list')) {
54 $HTML->header(array('title'=>_('Software Map'),'pagename'=>'softwaremap'));
55 $HTML->printSoftwareMapLinks();
57 $res_grp = db_query_params ('
58 SELECT group_id, group_name, unix_group_name, short_description, register_time
60 WHERE status = $1 AND is_public=1 AND type_id=1 AND group_id>4 AND register_time > 0
61 ORDER BY group_name ASC
64 $TROVE_HARDQUERYLIMIT);
66 $querytotalcount = db_numrows($res_grp);
68 // #################################################################
69 // limit/offset display
71 // no funny stuff with get vars
73 $page = isset($_GET['page'])?$_GET['page']:FALSE;
74 if (!is_numeric($page)) {
78 // store this as a var so it can be printed later as well
79 $html_limit = '<span style="text-align:center;font-size:smaller">';
80 if ($querytotalcount == $TROVE_HARDQUERYLIMIT){
81 $html_limit .= sprintf(_('More than <strong>%1$s</strong> projects in result set.'), $querytotalcount);
83 $html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $querytotalcount);
85 // only display pages stuff if there is more to display
86 if ($querytotalcount > $TROVE_BROWSELIMIT) {
87 $html_limit .= sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $TROVE_BROWSELIMIT).'<br/>';
89 // display all the numbers
90 for ($i=1;$i<=ceil($querytotalcount/$TROVE_BROWSELIMIT);$i++) {
93 $html_limit .= '<a href="'.$_SERVER['PHP_SELF'];
94 $html_limit .= '?page='.$i;
96 } else $html_limit .= '<strong>';
97 $html_limit .= '<'.$i.'>';
99 $html_limit .= '</a>';
100 } else $html_limit .= '</strong>';
105 $html_limit .= '</span>';
107 print $html_limit."<hr />\n";
109 // #################################################################
110 // print actual project listings
111 // note that the for loop starts at 1, not 0
112 for ($i_proj=1;$i_proj<=$querytotalcount;$i_proj++) {
113 $row_grp = db_fetch_array($res_grp);
115 // check to see if row is in page range
116 if (($i_proj > (($page-1)*$TROVE_BROWSELIMIT)) && ($i_proj <= ($page*$TROVE_BROWSELIMIT))) {
122 if ($row_grp && $viewthisrow) {
124 // Embed RDFa description for /projects/PROJ_NAME
125 $proj_uri = util_make_url_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id']);
126 print '<div typeof="doap:Project sioc:Space" about="'.$proj_uri.'" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:sioc="http://rdfs.org/sioc/ns#">'."\n";
127 print '<span rel="planetforge:hosted_by" resource="'. util_make_url ('/') .'"></span>'."\n";
129 print '<table border="0" cellpadding="0" width="100%">';
130 print '<tr valign="top"><td colspan="2">';
131 print util_make_link_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id'],'<strong>'
132 .'<span property="doap:name">'
133 .$row_grp['group_name']
137 if ($row_grp['short_description']) {
139 . '<span property="doap:short_desc">'
140 . $row_grp['short_description']
145 print '</td></tr><tr valign="top"><td>';
146 // list all trove categories
147 print trove_getcatlisting($row_grp['group_id'],0,1,1);
149 print '<td valign="bottom" style="text-align:right;"><br />'._('Register Date:').' <strong>'.date(_('Y-m-d H:i'),$row_grp['register_time']).'</strong></td>';
152 if ($row_grp['jobs_count']) {
153 print '<tr><td colspan="2" align="center">'
154 .'<a href="/people/?group_id='.$row_grp['group_id'].'">[This project needs help]</a></td></td>';
158 print '</div>'; // /doap:Project
160 } // end if for row and range chacking
163 // print bottom navigation if there are more projects to display
164 if ($querytotalcount > $TROVE_BROWSELIMIT) {
168 $HTML->footer(array());