Example #1
0
function patch_header($params)
{
    global $group_id, $DOCUMENT_ROOT;
    $params['toptab'] = 'patch';
    $params['group'] = $group_id;
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Patch Manager');
    }
    if (!$project->usesPatch()) {
        exit_error('Error', 'This Project Has Turned Off The Patch Manager');
    }
    site_project_header($params);
    echo '<P><B><A HREF="/patch/?func=addpatch&group_id=' . $group_id . '">Submit A Patch</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/patch/?func=browse&group_id=' . $group_id . '&set=my">My Patches</A>';
    }
    echo ' | <A HREF="/patch/?func=browse&group_id=' . $group_id . '&set=open">Open Patches</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/patch/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/patch/admin/?group_id=' . $group_id . '">Admin</A>';
    echo '</B>';
}
function support_header($params)
{
    global $group_id, $DOCUMENT_ROOT;
    //required by new site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'support';
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Tech Support Manager');
    }
    if (!$project->usesSupport()) {
        exit_error('Error', 'This Project Has Turned Off The Tech Support Manager');
    }
    site_project_header($params);
    echo '<P><B><A HREF="/support/?func=addsupport&group_id=' . $group_id . '">Submit A Request</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/support/?func=browse&group_id=' . $group_id . '&set=my">My Requests</A>';
    }
    echo ' | <A HREF="/support/?func=browse&group_id=' . $group_id . '&set=open">Open Requests</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/support/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/support/admin/?group_id=' . $group_id . '">Admin</A>';
    echo '</B>';
    echo '<HR NoShade SIZE="1" SIZE="300">';
}
function feature_header($params)
{
    global $group_id, $DOCUMENT_ROOT;
    //required by new site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'feature';
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Feature Request Manager');
    }
    if (!$project->usesFeature()) {
        exit_error('Error', 'This Project Has Turned Off The Feature Request Manager');
    }
    site_project_header($params);
    echo '<P><B><A HREF="/feature/?func=addfeature&group_id=' . $group_id . '">Submit A Feature Request</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/feature/?func=browse&group_id=' . $group_id . '&set=my">My Feature Requests</A>';
    }
    echo ' | <A HREF="/feature/?func=browse&group_id=' . $group_id . '&set=open">Open Feature Requests</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/feature/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/feature/admin/?group_id=' . $group_id . '">Admin</A>';
    echo '</B><P>';
}
Example #4
0
function wiki_header($params)
{
    global $group_id;
    //required for site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'wiki';
    $project = project_get_object($group_id);
    if (!$project->usesWiki()) {
        exit_error('Error', 'This Project Has Turned Off Wikis');
    }
    site_project_header($params);
}
Example #5
0
function mail_header($params)
{
    global $group_id;
    //required for site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'mail';
    $project = project_get_object($group_id);
    if (!$project->usesMail()) {
        exit_error('Error', 'This Project Has Turned Off Mailing Lists');
    }
    site_project_header($params);
    echo '
		<P><B><A HREF="/mail/admin/?group_id=' . $group_id . '">Admin</A></B>';
}
Example #6
0
function docman_header($title, $pagehead, $style = 'xyz')
{
    global $group_id;
    $project =& project_get_object($group_id);
    if (!$project->usesDocman()) {
        exit_error('Error', 'This Project Has Turned Off The Doc Manager');
    }
    site_project_header(array('title' => $title, 'group' => $group_id, 'toptab' => 'docman'));
    print "<p><b><a href=\"/docman/new.php?group_id=" . $group_id . "\">Submit new documentation</a> | " . "<a href=\"/docman/index.php?group_id=" . $group_id . "\">View Documentation</a> | " . "<a href=\"/docman/admin/index.php?group_id=" . $group_id . "\">Admin</a></b>";
    if ($style == 'admin') {
        print "<b>  | <a href=\"/docman/admin/index.php?mode=editdocs&group_id=" . $group_id . "\">Edit Documents</a> | " . "<a href=\"/docman/admin/index.php?mode=editgroups&group_id=" . $group_id . " \">Edit Document Groups</a></b>";
    }
    print "<p>";
    print "<h2>{$pagehead}</h2>\n<P>\n";
}
Example #7
0
function pm_header($params)
{
    global $group_id, $is_pm_page, $words, $group_project_id, $DOCUMENT_ROOT, $order;
    //required by site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'pm';
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Task Manager');
    }
    if (!$project->usesPm()) {
        exit_error('Error', 'This Project Has Turned Off The Task Manager');
    }
    site_project_header($params);
    echo "<P><B>";
    echo "<A HREF=\"/pm/?group_id={$group_id}\">Subproject List</A>";
    $need_bar = 1;
    if ($group_project_id) {
        if (user_isloggedin()) {
            if ($need_bar) {
                echo ' | ';
            }
            echo "<A HREF=\"/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=addtask\">Add Task</A>";
            echo " | <A HREF=\"/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=browse&set=my\">My Tasks</A>";
            $need_bar = 1;
        }
        if ($need_bar) {
            echo ' | ';
        }
        echo "<A HREF=\"/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=browse&set=open\">Browse Open Tasks</A>";
        $need_bar = 1;
    }
    if (user_isloggedin()) {
        if ($need_bar) {
            echo ' | ';
        }
        echo '<A HREF="/pm/reporting/?group_id=' . $group_id . '">Reporting</A>';
        $need_bar = 1;
    }
    if ($need_bar) {
        echo ' | ';
    }
    echo " <A HREF=\"/pm/admin/?group_id={$group_id}\">Admin</A>";
    echo "</B>";
}
function survey_header($params)
{
    global $group_id, $is_admin_page, $DOCUMENT_ROOT;
    $params['toptab'] = 'surveys';
    $params['group'] = $group_id;
    $project = project_get_object($group_id);
    if (!$project->usesSurvey()) {
        exit_error('Error', 'This Group Has Turned Off Surveys');
    }
    site_project_header($params);
    echo "<P><B><A HREF=\"/survey/admin/?group_id={$group_id}\">Admin</A>";
    if ($is_admin_page && $group_id) {
        echo " | <A HREF=\"/survey/admin/add_survey.php?group_id={$group_id}\">Add Surveys</A>";
        echo " | <A HREF=\"/survey/admin/edit_survey.php?group_id={$group_id}\">Edit Surveys</A>";
        echo " | <A HREF=\"/survey/admin/add_question.php?group_id={$group_id}\">Add Questions</A>";
        echo " | <A HREF=\"/survey/admin/show_questions.php?group_id={$group_id}\">Edit Questions</A>";
        echo " | <A HREF=\"/survey/admin/show_results.php?group_id={$group_id}\">Show Results</A></B>";
    }
}
Example #9
0
<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: index.php,v 1.2 2003/11/13 11:29:25 helix Exp $
require 'pre.php';
require '../patch/patch_utils.php';
require '../patch/patch_data.php';
if ($group_id) {
    $project =& project_get_object($group_id);
    switch ($func) {
        case 'addpatch':
            include '../patch/add_patch.php';
            break;
        case 'postaddpatch':
            if (patch_data_add_patch($project, $patch_category_id, $upload_instead, $uploaded_data, $summary, $code)) {
                $feedback = 'Successfully Added Patch';
                include '../patch/browse_patch.php';
            } else {
                exit_error('ERROR', $feedback);
            }
            break;
        case 'postmodpatch':
            if (patch_data_handle_update($project, $patch_id, $upload_new, $uploaded_data, $code, $patch_status_id, $patch_category_id, $assigned_to, $summary, $details)) {
                $feedback = 'Patch Updated Successfully';
                include '../patch/browse_patch.php';
            } else {
                exit_error('ERROR', $feedback);
function support_data_update($group_id, $support_id, $priority, $support_status_id, $support_category_id, $assigned_to, $summary, $canned_response, $details)
{
    global $feedback;
    if (!$group_id || !$support_id || !$assigned_to || !$status_id || !$support_category_id || !$canned_response) {
        $feedback .= "ERROR: Missing required parameters to support_data_update<BR>";
        return false;
    }
    $count = count($support_id);
    if ($count > 0) {
        for ($i = 0; $i < $count; $i++) {
            //get this patch from the db
            $sql = "SELECT * FROM support WHERE support_id='{$support_id[$i]}'";
            $result = db_query($sql);
            $group_id = db_result($result, 0, 'group_id');
            if (!(db_numrows($result) > 0 && user_ismember($group_id, 'C2'))) {
                //verify permissions
                $feedback .= ' ERROR - permission denied ';
                return false;
            }
            // We should assume no update is needed until otherwise
            // verified (imagine all the possible unnecessary queries
            // for a 50 item bug list!) -- G
            $update = false;
            $sql = "UPDATE support SET ";
            /*
            	See which fields changed during the modification
            */
            $sql .= "support_status_id='";
            if (db_result($result, 0, 'support_status_id') != $status_id && $status_id != 100) {
                support_data_create_history('support_status_id', db_result($result, 0, 'support_status_id'), $support_id[$i]);
                $update = true;
                $sql .= $status_id;
            } else {
                $sql .= db_result($result, 0, 'support_status_id');
            }
            $sql .= "', support_category_id='";
            if (db_result($result, 0, 'support_category_id') != $support_category_id && $support_category_id != 100) {
                support_data_create_history('support_category_id', db_result($result, 0, 'support_category_id'), $support_id[$i]);
                $update = true;
                $sql .= $support_category_id;
            } else {
                $sql .= db_result($result, 0, 'support_category_id');
            }
            $sql .= "', priority='";
            if (db_result($result, 0, 'priority') != $priority && $priority != 100) {
                support_data_create_history('priority', db_result($result, 0, 'priority'), $support_id[$i]);
                $update = true;
                $sql .= $priority;
            } else {
                $sql .= db_result($result, 0, 'priority');
            }
            $sql .= "', assigned_to='";
            if (db_result($result, 0, 'assigned_to') != $assigned_to && $assigned_to != 100) {
                support_data_create_history('assigned_to', db_result($result, 0, 'assigned_to'), $support_id[$i]);
                $update = true;
                $sql .= $assigned_to;
            } else {
                $sql .= db_result($result, 0, 'assigned_to');
            }
            $sql .= "'";
            if (db_result($result, 0, 'summary') != stripslashes(htmlspecialchars($summary)) && $summary != '') {
                support_data_create_history('summary', htmlspecialchars(addslashes(db_result($result, 0, 'summary'))), $support_id[$i]);
                $update = true;
                $sql .= ", summary='" . htmlspecialchars($summary) . "'";
            }
            /*
            	Enter the timestamp if we are changing to closed
            */
            if ($support_status_id != "1") {
                $now = time();
                $sql .= ", close_date='{$now}'";
                support_data_create_history('close_date', db_result($result, 0, 'close_date'), $support_id[$i]);
            }
            /*
            	Finally, update the patch itself
            */
            if ($update) {
                $sql .= " WHERE support_id='{$support_id[$i]}'";
                $result = db_query($sql);
                if (!$result) {
                    $feedback .= 'Error - update failed!<BR>';
                    return false;
                } else {
                    $feedback .= " Successfully Modified Support Ticket {$support_id[$i]}<BR>\n";
                }
                /*
                	see if we're supposed to send all modifications to an address
                */
                $project = project_get_object($group_id);
                if ($project->sendAllPatchUpdates()) {
                    $address = $project->getNewPatchAddress();
                }
                /*
                	now send the email
                	it's no longer optional due to the group-level notification address
                */
                /*
                	handle canned responses
                */
                if ($canned_response != 100) {
                    //don't care if this response is for this group - could be hacked
                    $sql = "SELECT * FROM support_canned_responses WHERE support_canned_id='{$canned_response}'";
                    $result2 = db_query($sql);
                    if ($result2 && db_numrows($result2) > 0) {
                        support_data_create_message(util_unconvert_htmlspecialchars(db_result($result2, 0, 'body')), $support_id[$i], user_getname() . '@' . $GLOBALS['sys_users_host']);
                        $feedback .= ' Canned Response Used<BR> ';
                    } else {
                        $feedback .= ' Unable to Use Canned Response ';
                    }
                }
                mail_followup($support_id[$i], $address);
                /*
                Details field is handled a little differently
                
                Details are comments attached to bugs
                They are still stored in the bug_history (audit 
                trail) system, but they are not shown in the
                 regular audit trail
                
                Someday, these should technically be split into
                 their own table.
                */
                if ($details != '') {
                    //create the first message for this ticket
                    support_data_create_message($details, $support_id, user_getname() . '@' . $GLOBALS['sys_users_host']);
                    $feedback .= " Comment added to support request {$support_id[$i]}<BR>";
                }
            } else {
                $feedback .= "Support ticket {$support_id[$i]} was not modified<BR>\n";
            }
        }
    }
    return true;
}
Example #11
0
function patch_data_mass_update($project, $patch_id, $assigned_to, $patch_status_id, $patch_category_id)
{
    global $feedback;
    $group_id = $project->getGroupID();
    //patch_id is an array of patches that were checked. The other params are not arrays.
    if (!$group_id || !$patch_id || !$assigned_to || !$patch_status_id || !$patch_category_id) {
        $feedback .= ' ERROR - You need to select at least one patch and change at least one option. ';
        return false;
    }
    $count = count($patch_id);
    if ($count > 0) {
        for ($i = 0; $i < $count; $i++) {
            //get this patch from the db
            $sql = "SELECT * FROM patch WHERE patch_id='{$patch_id[$i]}' AND group_id='{$group_id}'";
            $result = db_query($sql);
            $group_id = db_result($result, 0, 'group_id');
            if (db_numrows($result) < 1 || !$project->userIsPatchAdmin()) {
                //verify permissions
                $feedback .= ' ERROR - PERMISSION DENIED ';
                return false;
            }
            // We should assume no update is needed until otherwise
            // verified (imagine all the possible unnecessary queries
            // for a 50 item bug list!) -- G
            $update = false;
            $sql = "UPDATE patch SET ";
            db_begin();
            /*
            	See which fields changed during the modification
            */
            $sql .= "patch_status_id='";
            if (db_result($result, 0, 'patch_status_id') != $patch_status_id && $patch_status_id != 100) {
                patch_history_create('patch_status_id', db_result($result, 0, 'patch_status_id'), $patch_id[$i]);
                $update = true;
                $sql .= $patch_status_id;
            } else {
                $sql .= db_result($result, 0, 'patch_status_id');
            }
            $sql .= "', patch_category_id='";
            if (db_result($result, 0, 'patch_category_id') != $patch_category_id && $patch_category_id != 100) {
                patch_history_create('patch_category_id', db_result($result, 0, 'patch_category_id'), $patch_id[$i]);
                $update = true;
                $sql .= $patch_category_id;
            } else {
                $sql .= db_result($result, 0, 'patch_category_id');
            }
            $sql .= "', assigned_to='";
            if (db_result($result, 0, 'assigned_to') != $assigned_to && $assigned_to != 100) {
                patch_history_create('assigned_to', db_result($result, 0, 'assigned_to'), $patch_id[$i]);
                $update = true;
                $sql .= $assigned_to;
            } else {
                $sql .= db_result($result, 0, 'assigned_to');
            }
            $sql .= "'";
            /*
            	Enter the timestamp if we are changing to non-open
            */
            if ($patch_status_id != "1" && $patch_status_id != "100") {
                $now = time();
                $sql .= ", close_date='{$now}'";
                patch_history_create('close_date', db_result($result, 0, 'close_date'), $patch_id[$i]);
            }
            /*
            	Finally, update the patch itself
            */
            if ($update) {
                $sql .= " WHERE patch_id='{$patch_id[$i]}'";
                $result = db_query($sql);
                if (!$result) {
                    $feedback .= ' ERROR - Update Failed For Patch ID: ' . $patch_id[$i] . ' ' . db_error();
                    db_rollback();
                    return false;
                } else {
                    $feedback .= " Successfully Modified Patch {$patch_id[$i]}<BR>\n";
                }
                /*
                	see if we're supposed to send all modifications to an address
                */
                $project = project_get_object($group_id);
                if ($project->sendAllPatchUpdates()) {
                    $address = $project->getNewPatchAddress();
                }
                /*
                	now send the email
                	it's no longer optional due to the group-level notification address
                */
                mail_followup($patch_id[$i], $address);
                db_commit();
            } else {
                $feedback .= "Patch {$patch_id[$i]} was not modified<BR>\n";
                db_rollback();
            }
        }
    }
    return true;
}
Example #12
0
function bug_multiple_bug_depend_box($name = 'dependent_on_bug[]', $group_id = false, $bug_id = false)
{
    if (!$group_id) {
        return 'ERROR - no group_id';
    } else {
        if (!$bug_id) {
            return 'ERROR - no bug_id';
        } else {
            $project =& project_get_object($group_id);
            if (!$project->usesBugDependencies()) {
                return '<B>This project has disabled bug dependencies</B>';
            }
            $result = bug_data_get_valid_bugs($group_id, $bug_id);
            $result2 = bug_data_get_dependent_bugs($bug_id);
            return html_build_multiple_select_box($result, $name, util_result_column_to_array($result2));
        }
    }
}
Example #13
0
function feature_data_update($project, $feature_id, $priority, $feature_status_id, $feature_category_id, $assigned_to, $summary, $canned_response, $details)
{
    global $feedback;
    $group_id = $project->getGroupID();
    if (!is_Array($feature_id)) {
        $feature_id = array($feature_id);
    }
    if (!$group_id || !$feature_id || !$assigned_to || !$feature_status_id || !$feature_category_id || !$canned_response) {
        $feedback .= " ERROR: Missing required parameters to feature_data_update ";
        return false;
    }
    $count = count($feature_id);
    if ($count > 0) {
        for ($i = 0; $i < $count; $i++) {
            //get this feature from the db
            $sql = "SELECT * FROM feature WHERE feature_id='{$feature_id[$i]}' AND group_id='{$group_id}'";
            $result = db_query($sql);
            $group_id = db_result($result, 0, 'group_id');
            if (db_numrows($result) < 1 || !$project->userIsFeatureAdmin()) {
                //verify permissions
                $feedback .= 'ERROR - permission denied';
                return false;
            }
            // We should assume no update is needed until otherwise
            // verified (imagine all the possible unnecessary queries
            // for a 50 item bug list!) -- G
            $update = false;
            $sql = "UPDATE feature SET ";
            db_begin();
            /*
            	See which fields changed during the modification
            */
            $sql .= "feature_status_id='";
            if (db_result($result, 0, 'feature_status_id') != $feature_status_id && $feature_status_id != 100) {
                feature_data_create_history('feature_status_id', db_result($result, 0, 'feature_status_id'), $feature_id[$i]);
                $update = true;
                $sql .= $feature_status_id;
            } else {
                $sql .= db_result($result, 0, 'feature_status_id');
            }
            $sql .= "', feature_category_id='";
            if (db_result($result, 0, 'feature_category_id') != $feature_category_id && $feature_category_id != 100) {
                feature_data_create_history('feature_category_id', db_result($result, 0, 'feature_category_id'), $feature_id[$i]);
                $update = true;
                $sql .= $feature_category_id;
            } else {
                $sql .= db_result($result, 0, 'feature_category_id');
            }
            $sql .= "', priority='";
            if (db_result($result, 0, 'priority') != $priority && $priority != 100) {
                feature_data_create_history('priority', db_result($result, 0, 'priority'), $feature_id[$i]);
                $update = true;
                $sql .= $priority;
            } else {
                $sql .= db_result($result, 0, 'priority');
            }
            $sql .= "', assigned_to='";
            if (db_result($result, 0, 'assigned_to') != $assigned_to && $assigned_to != 100) {
                feature_data_create_history('assigned_to', db_result($result, 0, 'assigned_to'), $feature_id[$i]);
                $update = true;
                $sql .= $assigned_to;
            } else {
                $sql .= db_result($result, 0, 'assigned_to');
            }
            $sql .= "'";
            if (db_result($result, 0, 'summary') != stripslashes(htmlspecialchars($summary)) && $summary != '') {
                feature_data_create_history('summary', htmlspecialchars(addslashes(db_result($result, 0, 'summary'))), $feature_id[$i]);
                $update = true;
                $sql .= ", summary='" . htmlspecialchars($summary) . "'";
            }
            /*
            	Enter the timestamp if we are changing to closed
            */
            if ($feature_status_id != "1") {
                $now = time();
                $sql .= ", close_date='{$now}'";
                feature_data_create_history('close_date', db_result($result, 0, 'close_date'), $feature_id[$i]);
            }
            /*
            	Finally, update the feature itself
            */
            if ($update) {
                $sql .= " WHERE feature_id='{$feature_id[$i]}'";
                $result = db_query($sql);
                if (!$result) {
                    $feedback .= ' Error - update failed! ';
                    db_rollback();
                    return false;
                } else {
                    $feedback .= " Successfully Modified Feature Ticket {$feature_id[$i]} ";
                }
            }
            /*
            	Details field is handled a little differently
            
            	Details are comments attached to bugs
            	They are still stored in the bug_history (audit 
            	trail) system, but they are not shown in the
            	 regular audit trail
            
            	Someday, these should technically be split into
            	 their own table.
            */
            if ($details != '') {
                //create the first message for this ticket
                if (!feature_data_create_message($details, $feature_id[$i], user_getname() . '@' . $GLOBALS['sys_users_host'])) {
                    db_rollback();
                    return false;
                } else {
                    $feedback .= ' Comment added to feature request ' . $feature_id[$i] . ' ';
                    $send_message = true;
                }
            }
            /*
            	handle canned responses
            */
            if ($canned_response != 100) {
                //don't care if this response is for this group - could be hacked
                $sql = "SELECT * FROM feature_canned_responses WHERE feature_canned_id='{$canned_response}'";
                $result2 = db_query($sql);
                if ($result2 && db_numrows($result2) > 0) {
                    if (!feature_data_create_message(util_unconvert_htmlspecialchars(db_result($result2, 0, 'body')), $feature_id[$i], user_getname() . '@' . $GLOBALS['sys_users_host'])) {
                        db_rollback();
                        return false;
                    } else {
                        $feedback .= ' Canned Response Used For Feature Request ID ' . $feature_id[$i] . '';
                        $send_message = true;
                    }
                } else {
                    $feedback .= ' Unable to Use Canned Response ';
                }
            }
            if ($update || $send_message) {
                /*
                	see if we're supposed to send all modifications to an address
                */
                $project = project_get_object($group_id);
                if ($project->sendAllFeatureUpdates()) {
                    $address = $project->getNewFeatureAddress();
                }
                /*
                	now send the email
                	it's no longer optional due to the group-level notification address
                */
                mail_followup($feature_id[$i], $address);
                db_commit();
            } else {
                //nothing changed, so cancel the transaction
                db_rollback();
            }
        }
    }
    return true;
}
Example #14
0
function site_project_header($params)
{
    global $HTML;
    /*
    	Check to see if active
    	Check to see if project rather than foundry
    	Check to see if private (if private check if user_ismember)
    */
    $group_id = $params['group'];
    //get the project object
    $project =& project_get_object($group_id);
    if (!$project || $project->isError()) {
        exit_error("Group Problem", $project->getErrorMessage());
    }
    //group is private
    if (!$project->isPublic()) {
        //if it's a private group, you must be a member of that group
        session_require(array('group' => $group_id));
    }
    //for dead projects must be member of alexandria project
    if (!$project->isActive()) {
        //only SF group can view non-active, non-holding groups
        session_require(array('group' => '1'));
    }
    echo $HTML->header($params);
    echo html_feedback_top($GLOBALS['feedback']);
    echo $HTML->project_tabs($params['toptab'], $params['group']);
}
function project_summary($group_id, $mode, $no_table)
{
    if (!$group_id) {
        return 'Error - No Group ID';
    }
    if (!$mode) {
        $mode = 'full';
    }
    $project = project_get_object($group_id);
    // ################## forums
    if (!$no_table) {
        $return .= '

		<TABLE BORDER=0 WIDTH="100%"><TR><TD BGCOLOR="#EAECEF">';
    }
    if ($project->usesForum()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/forum/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/notes16.png", "20", "20", array("BORDER" => "0", "ALT" => "Forums"));
        $return .= '&nbsp;Forums</A>';
        if ($mode != 'compact') {
            $return .= " ( <B>" . project_get_public_forum_count($group_id) . "</B> messages in ";
            $return .= "<B>" . project_get_public_forum_message_count($group_id) . "</B> forums )\n";
        }
    }
    // ##################### Bug tracking
    if ($project->usesBugs()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/bugs/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/bug16b.png", "20", "20", array("BORDER" => "0", "ALT" => "Bugs"));
        $return .= '&nbsp;Bug&nbsp;Tracker</A>';
        if ($mode != 'compact') {
            $return .= " ( <B>" . project_get_open_bug_count($group_id) . "</B>";
            $return .= " open bugs, <B>" . project_get_total_bug_count($group_id) . "</B> total )";
        }
    }
    // ##################### Support Manager
    if ($project->usesSupport()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/support/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/support16b.jpg", "20", "20", array("BORDER" => "0", "ALT" => "Support"));
        $return .= '&nbsp;Tech&nbsp;Support</A>';
        if ($mode != 'compact') {
            $return .= " ( <B>" . project_get_open_support_count($group_id) . "</B>";
            $return .= " open requests, <B>" . project_get_total_support_count($group_id) . "</B> total )";
        }
    }
    // ##################### Feature Request
    if ($project->usesFeature()) {
        $return .= '

                        <HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/feature/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/support16b.jpg", "20", "20", array("BORDER" => "0", "ALT" => "Feature Requests"));
        $return .= '&nbsp;Feature&nbsp;Requests</A>';
        if ($mode != 'compact') {
            $return .= " ( <B>" . project_get_open_feature_count($group_id) . "</B>";
            $return .= " open requests, <B>" . project_get_total_feature_count($group_id) . "</B> total )";
        }
    }
    // ##################### Doc Manager
    if ($project->usesDocman()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/docman/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/docman16b.png", "20", "20", array("BORDER" => "0", "ALT" => "Docs"));
        $return .= '&nbsp;Doc&nbsp;Manager</A>';
    }
    // ##################### Patch Manager
    if ($project->usesPatch()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/patch/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/patch.png", "20", "20", array("BORDER" => "0", "ALT" => "Patches"));
        $return .= '&nbsp;Patch&nbsp;Manager</A>';
        if ($mode != 'compact') {
            $return .= " ( <B>" . project_get_open_patch_count($group_id) . "</B>";
            $return .= " open patches, <B>" . project_get_total_patch_count($group_id) . "</B> total )";
        }
    }
    // ##################### Mailing lists
    if ($project->usesMail()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/mail/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/mail16b.png", "20", "20", array("BORDER" => "0", "ALT" => "Mail Lists"));
        $return .= '&nbsp;Mailing&nbsp;Lists</A>';
        if ($mode != 'compact') {
            $return .= " ( <B>" . project_get_mail_list_count($group_id) . "</B> public lists )";
        }
    }
    // ##################### Task Manager
    if ($project->usesPm()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/pm/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/taskman16b.png", "20", "20", array("BORDER" => "0", "ALT" => "Tasks"));
        $return .= '&nbsp;Task&nbsp;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><I>There are no public subprojects available</I>';
            } else {
                for ($j = 0; $j < $rows; $j++) {
                    $return .= '
					<BR> &nbsp; - <A HREF="http://' . $GLOBALS['sys_default_host'] . '/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>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/survey/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/survey16b.png", "20", "20", array("BORDER" => "0", "ALT" => "Surveys"));
        $return .= "&nbsp;Surveys</A>";
        if ($mode != 'compact') {
            $return .= ' ( <B>' . project_get_survey_count($group_id) . '</B> surveys )';
        }
    }
    // ######################### CVS
    if ($project->usesCVS()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/cvs/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/cvs16b.png", "20", "20", array("BORDER" => "0", "ALT" => "CVS"));
        $return .= "&nbsp;CVS&nbsp;Tree</A>";
        if ($mode != 'compact') {
            $sql = "SELECT SUM(cvs_commits) AS commits,SUM(cvs_adds) AS adds from stats_project where group_id='{$group_id}'";
            $result = db_query($sql);
            $return .= ' ( <B>' . db_result($result, 0, 0) . '</B> commits, <B>' . db_result($result, 0, 1) . '</B> adds )';
        }
    }
    // 2002-03-03 by helix
    // ######################## Screenshots
    if ($project->usesScreenshots()) {
        $return .= '

                        <HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/screenshots/?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/frame_image16b.png", "20", "20", array("BORDER" => "0", "ALT" => "Screenshots"));
        $return .= "&nbsp;Screenshots</A>";
        if ($mode != 'compact') {
            $return .= ' ( <B>' . project_get_screenshots_count($group_id) . '</B> screenshots )';
        }
    }
    // ######################## Released Files
    if ($project->isActive()) {
        $return .= '

			<HR SIZE="1" NoShade>';
        $return .= '<A href="http://' . $GLOBALS['sys_default_host'] . '/project/showfiles.php?group_id=' . $group_id . '">';
        $return .= html_image("images/ic/ftp16b.png", "20", "20", array("BORDER" => "0", "ALT" => "FTP"));
        $return .= "&nbsp;Released&nbsp;Files</A>";
    }
    if (!$no_table) {
        $return .= '

		</TD></TR></TABLE>';
    }
    return $return;
}