[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gforge-commits] gforge/www/include project_summary.php,1.14,1.15
From: |
tom |
Subject: |
[Gforge-commits] gforge/www/include project_summary.php,1.14,1.15 |
Date: |
Thu, 11 Mar 2004 16:06:25 -0600 |
Update of /cvsroot/gforge/gforge/www/include
In directory db.perdue.net:/tmp/cvs-serv17921/www/include
Modified Files:
project_summary.php
Log Message:
Backed out deletion of project_summary(); it's referenced from
export/projhtml.php
Index: project_summary.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/include/project_summary.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- project_summary.php 11 Mar 2004 21:46:24 -0000 1.14
+++ project_summary.php 11 Mar 2004 22:06:22 -0000 1.15
@@ -83,4 +83,186 @@
function project_get_public_forum_message_count($group_id) {
return project_getaggvalue($group_id, 'fmsg');
}
+
+/**
+ * project_summary() - Build a project summary box that projects can insert
into their project pages
+ *
+ * @param int The group ID
+ * @param string How to return the results.
+ * @param bool Whether to return the results within an HTML
table or not
+ */
+function project_summary($group_id,$mode,$no_table) {
+ global $Language;
+ if (!$group_id) {
+ return 'Error - No Group ID';
+ }
+ if (!$mode) {
+ $mode='full';
+ }
+
+ $project =& group_get_object($group_id);
+ // ################## forums
+
+ if (!$project || !is_object($project)) {
+ return 'Could Not Create Project Object';
+ } elseif ($project->isError()) {
+ return $project->getErrorMessage();
+ }
+
+ if (!$no_table) {
+ $return .= '
+
+ <table border=0 width="100%"><tr><td bgcolor="#EAECEF">';
+ }
+
+ // ################## ArtifactTypes
+
+ $return .= '<a href="/tracker/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
+ $return .= ' Tracker</a>';
+
+ if ($mode != 'compact') {
+ $result=db_query("SELECT agl.*,aca.count,aca.open_count
+ FROM artifact_group_list agl
+ LEFT JOIN artifact_counts_agg aca USING (group_artifact_id)
+ WHERE agl.group_id='$group_id'
+ AND agl.is_public=1
+ ORDER BY group_artifact_id ASC");
+
+ $rows = db_numrows($result);
+
+ if (!$result || $rows < 1) {
+ $return .= '<br
/><em>'.$Language->getText('project_home','no_trackers').'</em>';
+ } else {
+ for ($j = 0; $j < $rows; $j++) {
+ $return .= '<p>
+ - <a href="/tracker/?atid='.
db_result($result, $j, 'group_artifact_id') .
+
'&group_id='.$group_id.'&func=browse">'. db_result($result, $j, 'name')
.'</a>
+ ( <strong>'. db_result($result, $j,
'open_count') .' '.$Language->getText('general','open').' / '.
db_result($result, $j, 'count') . $Language->getText('general','total').'
</strong> )<br />'.
+ db_result($result, $j, 'description') . '</p>';
+ }
+ }
+ }
+
+ // ##################### Doc Manager
+
+ if ($project->usesForum()) {
+ $return .= '
+
+ <HR SIZE="1" NoShade>';
+ $return .= '<a href="/forum/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/forum20g.png","20","20",array("border"=>"0","ALT"=>"Forums"));
+ $return .= ' Forums</a>';
+
+ if ($mode != 'compact') {
+ $return .= " ( <strong>".
project_get_public_forum_message_count($group_id) ."</strong> messages in ";
+ $return .= "<strong>".
project_get_public_forum_count($group_id) ."</strong> forums )\n";
+ }
+ }
+
+ // ##################### Doc Manager
+
+ if ($project->usesDocman()) {
+ $return .= '
+
+ <hr size="1" noshade="noshade" />';
+ $return .= '<a href="/docman/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/docman16b.png","20","20",array("border"=>"0","alt"=>"Docs"));
+ $return .= ' Doc Manager</a>';
+ }
+
+ // ##################### Mailing lists
+
+ if ($project->usesMail()) {
+ $return .= '
+
+ <hr size="1" noshade="noshade" />';
+ $return .= '<a href="/mail/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/mail16b.png","20","20",array("border"=>"0","alt"=>"Mail Lists"));
+ $return .= ' Mailing Lists</a>';
+
+ if ($mode != 'compact') {
+ $return .= " ( <strong>".
project_get_mail_list_count($group_id) ."</strong> public lists )";
+ }
+ }
+
+ // ##################### Task Manager
+
+ if ($project->usesPm()) {
+ $return .= '
+
+ <HR SIZE="1" NoShade>';
+ $return .= '<a href="/pm/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/taskman20g.png","20","20",array("border"=>"0","ALT"=>"Tasks"));
+ $return .= ' Task Manager</a>';
+
+ if ($mode != 'compact') {
+ //get a list of publicly available projects
+ $sql="SELECT * FROM project_group_list WHERE
group_id='$group_id' AND is_public=1";
+ $result = db_query ($sql);
+ $rows = db_numrows($result);
+ if (!$result || $rows < 1) {
+ $return .= '<br /><em>There are no public
subprojects available</em>';
+ } else {
+ for ($j = 0; $j < $rows; $j++) {
+ $return .= '
+ <br /> - <a
href="/pm/task.php?group_project_id='.db_result($result, $j,
'group_project_id').
+
'&group_id='.$group_id.'&func=browse">'.db_result($result, $j,
'project_name').'</a>';
+ }
+ db_free_result($result);
+ }
+ }
+ }
+
+ // ######################### Surveys
+
+ if ($project->usesSurvey()) {
+ $return .= '
+
+ <hr size="1" noshade="noshade" />';
+ $return .= '<a href="/survey/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/survey16b.png","20","20",array("border"=>"0","alt"=>"Surveys"));
+ $return .= " Surveys</a>";
+ if ($mode != 'compact') {
+ $return .= ' ( <strong>'.
project_get_survey_count($group_id) .'</strong> surveys )';
+ }
+ }
+
+ // ######################### CVS
+
+ if ($project->usesCVS()) {
+ $return .= '
+
+ <HR SIZE="1" NoShade>';
+ $return .= '<a href="/scm/?group_id='.$group_id.'">';
+ $return .=
html_image("ic/cvs16b.png","20","20",array("border"=>"0","ALT"=>"CVS"));
+ $return .= " CVS Tree</a>";
+
+ if ($mode != 'compact') {
+ $sql = "SELECT SUM(commits) AS commits,SUM(adds) AS
adds from stats_cvs_group where group_id='$group_id'";
+ $result = db_query($sql);
+ $return .= ' (
<strong>'.db_result($result,0,0).'</strong> commits,
<strong>'.db_result($result,0,1).'</strong> adds )';
+ }
+ }
+
+ // ######################## Released Files
+
+ if ($project->isActive()) {
+ $return .= '
+
+ <hr size="1" noshade="noshade" />';
+ $return .= '<a
href="/project/showfiles.php?group_id='.$group_id.'">';
+ $return .=
html_image("ic/ftp16b.png","20","20",array("border"=>"0","alt"=>"FTP"));
+ $return .= " Released Files</a>";
+ }
+
+ if (!$no_table) {
+ $return .= '
+
+ </td></tr></table>';
+ }
+
+ return $return;
+}
+
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gforge-commits] gforge/www/include project_summary.php,1.14,1.15,
tom <=