Esempio n. 1
0
function docman_header($title, $pagehead, $style = 'xyz')
{
    global $group_id, $HTML, $sys_use_docman;
    if (!$sys_use_docman) {
        exit_disabled();
    }
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_no_group();
    }
    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'));
    $menu_text = array();
    $menu_links = array();
    $menu_text[] = _('Submit new documentation');
    $menu_links[] = '/docman/new.php?group_id=' . $group_id;
    $menu_text[] = _('View Documentation');
    $menu_links[] = '/docman/index.php?group_id=' . $group_id;
    $menu_text[] = _('Search in documents');
    $menu_links[] = '/docman/search.php?group_id=' . $group_id;
    if (session_loggedin()) {
        $perm =& $project->getPermission(session_get_user());
        if ($perm && is_object($perm) && !$perm->isError() && $perm->isDocEditor()) {
            $menu_text[] = _('Admin');
            $menu_links[] = '/docman/admin/index.php?group_id=' . $group_id;
        }
    }
    echo $HTML->subMenu($menu_text, $menu_links);
}
Esempio n. 2
0
/**
 * GForge SCM Library
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id$
 * @author Tim Perdue tim@gforge.org
 * @date 2005-04-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
function scm_header($params)
{
    global $HTML, $sys_use_scm;
    if (!$sys_use_scm) {
        exit_disabled();
    }
    $project =& group_get_object($params['group']);
    if (!$project || !is_object($project)) {
        exit_error('Error', 'Could Not Get Project');
    } elseif ($project->isError()) {
        exit_error('Error', $project->getErrorMessage());
    }
    if (!$project->usesSCM()) {
        exit_error('Error', _('Error - This project has turned off SCM.'));
    }
    site_project_header(array('title' => _('SCM Repository'), 'group' => $params['group'], 'toptab' => 'scm'));
    /*
    	Show horizontal links
    */
    if (session_loggedin()) {
        $perm =& $project->getPermission(session_get_user());
        if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
            echo $HTML->subMenu(array(_('SCM'), _('Admin'), _('Reporting')), array('/scm/?group_id=' . $params['group'], '/scm/admin/?group_id=' . $params['group'], '/scm/reporting/?group_id=' . $params['group']));
        }
    }
    echo '<div style="width:99%">';
}
Esempio n. 3
0
function news_header($params)
{
    global $HTML, $group_id, $news_name, $news_id, $sys_news_group, $sys_use_news;
    if (!$sys_use_news) {
        exit_disabled();
    }
    $params['toptab'] = 'news';
    $params['group'] = $group_id;
    /*
    	Show horizontal links
    */
    if ($group_id && $group_id != $sys_news_group) {
        site_project_header($params);
    } else {
        $HTML->header($params);
    }
    if ($group_id && $group_id != $sys_news_group) {
        $menu_texts = array();
        $menu_links = array();
        $menu_texts[] = _('Submit');
        $menu_links[] = '/news/submit.php?group_id=' . $group_id;
        if (session_loggedin()) {
            $project =& group_get_object($params['group']);
            if ($project && is_object($project) && !$project->isError()) {
                $perm =& $project->getPermission(session_get_user());
                if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
                    $menu_texts[] = _('Admin');
                    $menu_links[] = '/news/admin/?group_id=' . $group_id;
                }
            }
        }
        echo $HTML->subMenu($menu_texts, $menu_links);
    }
}
Esempio n. 4
0
function survey_header($params)
{
    global $group_id, $is_admin_page, $HTML, $sys_use_survey;
    if (!$sys_use_survey) {
        exit_disabled();
    }
    $params['toptab'] = 'surveys';
    $params['group'] = $group_id;
    if ($project =& group_get_object($group_id)) {
        if (!$project->usesSurvey()) {
            exit_error(_('Error'), _('This Group Has Turned Off Surveys.'));
        }
        site_project_header($params);
        if ($is_admin_page && $group_id) {
            echo $HTML->subMenu(array(_('Surveys'), _('Admin'), _('Add Survey'), _('Edit Survey'), _('Add Questions'), _('Edit Questions'), _('Show Results')), array('/survey/?group_id=' . $group_id, '/survey/admin/?group_id=' . $group_id, '/survey/admin/add_survey.php?group_id=' . $group_id, '/survey/admin/edit_survey.php?group_id=' . $group_id, '/survey/admin/add_question.php?group_id=' . $group_id, '/survey/admin/show_questions.php?group_id=' . $group_id, '/survey/admin/show_results.php?group_id=' . $group_id));
        } else {
            if (session_loggedin()) {
                $perm =& $project->getPermission(session_get_user());
                if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
                    echo $HTML->subMenu(array(_('Admin')), array('/survey/admin/?group_id=' . $group_id));
                }
            }
        }
    }
    // end if (valid group id)
}
function pm_header($params)
{
    // XXX ogi: What to do with these?
    global $group_id, $is_pm_page, $words, $group_project_id, $HTML, $order, $pg, $sys_use_pm;
    if (!$sys_use_pm) {
        exit_disabled();
    }
    //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 =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_no_group();
    }
    if (!$project->usesPm()) {
        exit_error(_('Error'), _('This Project Has Turned Off The Task Manager'));
    }
    site_project_header($params);
    $labels = array();
    $links = array();
    if ($group_project_id) {
        $labels[] = ($pg ? $pg->getName() . ': ' : '') . _('Browse tasks');
        $links[] = '/pm/task.php?group_id=' . $group_id . '&amp;group_project_id=' . $group_project_id . '&amp;func=browse';
        if (session_loggedin()) {
            $labels[] = _('Add task');
            $links[] = '/pm/task.php?group_id=' . $group_id . '&amp;group_project_id=' . $group_project_id . '&amp;func=addtask';
        }
        if ($group_project_id) {
            $gantt_width = 820;
            $gantt_height = 680;
            $gantt_url = "/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=ganttpage";
            $gantt_title = _('Gantt Chart');
            $gantt_winopt = 'scrollbars=yes,resizable=yes,toolbar=no,height=' . $gantt_height . ',width=' . $gantt_width;
            $labels[] = $gantt_title;
            $links[] = $gantt_url . '" onclick="window.open(this.href, \'' . preg_replace('/\\s/', '_', $gantt_title) . '\', \'' . $gantt_winopt . '\'); return false;';
        }
        //upload/download as CSV files
        $labels[] = _('Download as CSV');
        $links[] = '/pm/task.php?group_id=' . $group_id . '&amp;group_project_id=' . $group_project_id . '&amp;func=downloadcsv';
        $labels[] = _('Upload CSV');
        $links[] = '/pm/task.php?group_id=' . $group_id . '&amp;group_project_id=' . $group_project_id . '&amp;func=uploadcsv';
    }
    if ($pg && is_object($pg) && $pg->userIsAdmin()) {
        $labels[] = _('Reporting');
        $links[] = '/pm/reporting/?group_id=' . $group_id;
        $labels[] = _('Admin');
        $links[] = '/pm/admin/?group_id=' . $group_id . '&amp;group_project_id=' . $group_project_id . '&amp;update_pg=1';
    }
    if (!empty($labels)) {
        echo $HTML->subMenu($labels, $links);
    }
}
 function header($params)
 {
     global $HTML, $sys_use_tracker;
     if (!$sys_use_tracker) {
         exit_disabled();
     }
     $group_id = $this->Group->getID();
     //required by new site_project_header
     $params['group'] = $group_id;
     $params['toptab'] = 'tracker';
     $params['tabtext'] = $this->getName();
     site_project_header($params);
     $labels = array();
     $links = array();
     $labels[] = $this->getName() . ': ' . _('Browse');
     $links[] = '/tracker/?func=browse&amp;group_id=' . $group_id . '&amp;atid=' . $this->getID();
     $labels[] = _('Download .csv');
     $links[] = '/tracker/?func=downloadcsv&amp;group_id=' . $group_id . '&amp;atid=' . $this->getID();
     if ($this->allowsAnon() || session_loggedin()) {
         $labels[] = _('Submit New');
         $links[] = '/tracker/?func=add&amp;group_id=' . $group_id . '&amp;atid=' . $this->getID();
     }
     if (session_loggedin()) {
         $labels[] = _('Reporting');
         $links[] = '/tracker/reporting/?group_id=' . $group_id . '&amp;atid=' . $this->getID();
         if ($this->isMonitoring()) {
             $labels[] = _('Stop Monitor');
         } else {
             $labels[] = _('Monitor');
         }
         $links[] = '/tracker/?group_id=' . $group_id . '&amp;atid=' . $this->getID() . '&amp;func=monitor';
         if ($this->userIsAdmin()) {
             $labels[] = _('Admin');
             $links[] = '/tracker/admin/?group_id=' . $group_id . '&amp;atid=' . $this->getID();
         }
     }
     echo $HTML->subMenu($labels, $links);
 }
Esempio n. 7
0
function frs_header($params)
{
    global $group_id, $HTML, $sys_use_frs;
    /*
    	Does this site use FRS?
    */
    if (!$sys_use_frs) {
        exit_disabled();
    }
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_no_group();
    }
    $params['toptab'] = 'frs';
    $params['group'] = $group_id;
    site_project_header($params);
    if (session_loggedin()) {
        $perm =& $project->getPermission(session_get_user());
        if ($perm && is_object($perm) && !$perm->isError() && $perm->isReleaseTechnician()) {
            echo $HTML->subMenu(array(_('Files'), _('Admin')), array('/frs/?group_id=' . $group_id, '/frs/admin/?group_id=' . $group_id));
        }
    }
}
Esempio n. 8
0
 * contained in CodeX.
 * Copyright (c) Xerox Corporation, CodeX / CodeX Team, 2001,2002. All Rights Reserved.
 * http://codex.xerox.com
 *
 * @version   $Id$
 */
// make sure we're not compressing output if we are making a tarball
if (isset($_GET['view']) && $_GET['view'] == 'tar') {
    $no_gz_buffer = true;
}
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'scm/include/scm_utils.php';
require_once $gfwww . 'scm/include/viewvc_utils.php';
if (!$sys_use_scm) {
    exit_disabled();
}
// Get the project name from query
if (getStringFromGet('root') && strpos(getStringFromGet('root'), ';') === false) {
    $projectName = getStringFromGet('root');
} else {
    $queryString = getStringFromServer('QUERY_STRING');
    if (preg_match_all('/[;]?([^\\?;=]+)=([^;]+)/', $queryString, $matches, PREG_SET_ORDER)) {
        for ($i = 0, $size = sizeof($matches); $i < $size; $i++) {
            $query[$matches[$i][1]] = urldecode($matches[$i][2]);
        }
        $projectName = $query['root'];
    }
}
// Remove eventual leading /root/ or root/
$projectName = ereg_replace('^..[^/]*/', '', $projectName);
Esempio n. 9
0
function forum_header($params)
{
    global $HTML, $group_id, $forum_name, $forum_id, $sys_news_group, $f, $sys_use_forum, $group_forum_id;
    if ($group_forum_id) {
        $forum_id = $group_forum_id;
    }
    if (!$sys_use_forum) {
        exit_disabled();
    }
    $params['group'] = $group_id;
    $params['toptab'] = 'forums';
    /*
    bastardization for news
    Show icon bar unless it's a news forum
    */
    if ($group_id == $sys_news_group) {
        //this is a news item, not a regular forum
        if ($forum_id) {
            // Show this news item at the top of the page
            $sql = "SELECT submitted_by, post_date, group_id, forum_id, summary, details FROM news_bytes WHERE forum_id='{$forum_id}'";
            $result = db_query($sql);
            // checks which group the news item belongs to
            $params['group'] = db_result($result, 0, 'group_id');
            $params['toptab'] = 'news';
            $HTML->header($params);
            echo '<table><tr><td valign="top">';
            if (!$result || db_numrows($result) < 1) {
                echo '<h3>' . _('Error - this news item was not found') . '</h3>';
            } else {
                $user = user_get_object(db_result($result, 0, 'submitted_by'));
                $group =& group_get_object($params['group']);
                if (!$group || !is_object($group) || $group->isError()) {
                    exit_no_group();
                }
                echo '
				<strong>' . _('Posted by') . ':</strong> ' . $user->getRealName() . '<br />
				<strong>' . _('Date') . ':</strong> ' . date(_('Y-m-d H:i'), db_result($result, 0, 'post_date')) . '<br />
				<strong>' . _('Summary') . ':</strong>' . util_make_link('/forum/forum.php?forum_id=' . db_result($result, 0, 'forum_id') . '&group_id=' . $group_id, db_result($result, 0, 'summary')) . '<br/>
				<strong>' . _('Project') . ':</strong>' . util_make_link_g($group->getUnixName(), db_result($result, 0, 'group_id'), $group->getPublicName()) . '<br />
				<p>
				' . util_make_links(nl2br(db_result($result, 0, 'details')));
                echo '</p>';
            }
            echo '</td><td valign="top" width="35%">';
            echo $HTML->boxTop(_('Latest News'));
            echo news_show_latest($params['group'], 5, false);
            echo $HTML->boxBottom();
            echo '</td></tr></table>';
        } else {
            site_project_header($params);
        }
    } else {
        site_project_header($params);
    }
    $menu_text = array();
    $menu_links = array();
    if ($f) {
        if ($f->userIsAdmin()) {
            $menu_text[] = _('Admin');
            $menu_links[] = '/forum/admin/?group_id=' . $group_id;
        }
        if ($forum_id) {
            $menu_text[] = _('Discussion Forums:') . ' ' . $f->getName();
            $menu_links[] = '/forum/forum.php?forum_id=' . $forum_id;
        }
    } else {
        $gg =& group_get_object($group_id);
        $perm =& $gg->getPermission(session_get_user());
        if ($perm->isForumAdmin()) {
            $menu_text[] = _('Admin');
            $menu_links[] = '/forum/admin/?group_id=' . $group_id;
        }
    }
    if (count($menu_text) > 0) {
        echo $HTML->subMenu($menu_text, $menu_links);
    }
    if (session_loggedin()) {
        if ($f) {
            if ($f->isMonitoring()) {
                echo util_make_link('/forum/monitor.php?forum_id=' . $forum_id . '&amp;group_id=' . $group_id . '&amp;stop=1', html_image('ic/xmail16w.png', '20', '20', array()) . ' ' . _('Stop Monitoring')) . ' | ';
            } else {
                echo util_make_link('/forum/monitor.php?forum_id=' . $forum_id . '&amp;group_id=' . $group_id . '&amp;start=1', html_image('ic/mail16w.png', '20', '20', array()) . ' ' . _('Monitor Forum')) . ' | ';
            }
            echo util_make_link('/forum/save.php?forum_id=' . $forum_id . '&amp;group_id=' . $group_id, html_image('ic/save.png', '24', '24', array()) . ' ' . _('Save Place')) . ' | ';
        }
    }
    if ($f && $forum_id) {
        echo util_make_link('/forum/new.php?forum_id=' . $forum_id . '&amp;group_id=' . $group_id, html_image('ic/write16w.png', '20', '20', array('alt' => _('Start New Thread'))) . ' ' . _('Start New Thread'));
    }
}