Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / project_page.php
blobe248a0b93fd307104857991d58cd1f2e407f7067
1 <?php
2 # MantisBT - A PHP based bugtracking system
4 # MantisBT is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # MantisBT is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * @package MantisBT
19 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
20 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
23 * @uses core.php
24 * @uses access_api.php
25 * @uses config_api.php
26 * @uses constant_inc.php
27 * @uses gpc_api.php
28 * @uses helper_api.php
29 * @uses html_api.php
30 * @uses lang_api.php
31 * @uses print_api.php
32 * @uses project_api.php
33 * @uses string_api.php
34 * @uses utility_api.php
37 require_once( 'core.php' );
38 require_api( 'access_api.php' );
39 require_api( 'config_api.php' );
40 require_api( 'constant_inc.php' );
41 require_api( 'gpc_api.php' );
42 require_api( 'helper_api.php' );
43 require_api( 'html_api.php' );
44 require_api( 'lang_api.php' );
45 require_api( 'print_api.php' );
46 require_api( 'project_api.php' );
47 require_api( 'string_api.php' );
48 require_api( 'utility_api.php' );
50 $f_project_id = gpc_get_int( 'project_id' );
52 $t_view_issues_url = "set_project.php?project_id=$f_project_id&ref=view_all_bug_page.php";
54 if ( $f_project_id == ALL_PROJECTS ) {
55 print_header_redirect( $t_view_issues_url );
56 exit;
59 # Override the current page to make sure we get the appropriate project-specific configuration
60 $g_project_override = $f_project_id;
62 html_page_top( project_get_field( $f_project_id, 'name' ) );
64 print_recently_visited();
66 echo '<h1>', string_display( project_get_field( $f_project_id, 'name' ) ), '</h1>';
68 echo '<p>';
70 # View Issues
71 print_bracket_link( $t_view_issues_url, lang_get( 'view_bugs_link' ) );
73 # Changelog
74 print_bracket_link( "changelog_page.php?project_id=$f_project_id", lang_get( 'changelog_link' ) );
76 # Roadmap
77 print_bracket_link( "roadmap_page.php?project_id=$f_project_id", lang_get( 'roadmap_link' ) );
79 # Documentation
80 if ( config_get( 'enable_project_documentation' ) == ON ) {
81 print_bracket_link( "proj_doc_page.php?project_id=$f_project_id", lang_get( 'docs_link' ) );
84 # Wiki
85 if ( config_get( 'wiki_enable' ) == ON ) {
86 print_bracket_link( "wiki.php?type=project&id=$f_project_id", lang_get( 'wiki' ) );
89 # Summary Page for Project
90 if ( access_has_project_level( config_get( 'view_summary_threshold' ), $f_project_id ) ) {
91 print_bracket_link( "summary_page.php?project_id=$f_project_id", lang_get( 'summary_link' ) );
94 # Manage Project Page
95 if ( access_has_project_level( config_get( 'manage_project_threshold' ), $f_project_id ) ) {
96 print_bracket_link( "manage_proj_edit_page.php?project_id=$f_project_id", lang_get( 'manage_link' ) );
99 echo '</p>';
101 /** @todo Add status, view state, versions, sub-projects, parent projects, and news. */
102 /** @todo Schema change: add home page, license, */
104 $t_description = project_get_field( $f_project_id, 'description' );
106 if ( !is_blank( $t_description ) ) {
107 echo '<h2>', lang_get( 'description' ), '</h2>';
108 echo '<p>', string_display( $t_description ), '</p>';
111 $t_access_level_for_dev_team = config_get( 'development_team_threshold' );
113 $t_users = project_get_all_user_rows( $f_project_id, $t_access_level_for_dev_team );
114 $t_show_real_names = config_get( 'show_realname' ) == ON;
116 if ( count( $t_users ) > 0 ) {
117 echo '<h2>', lang_get( 'development_team' ), '</h2>';
119 /** @todo sort users in DESC order by access level, then ASC by username/realname. */
120 foreach ( $t_users as $t_user_data ) {
121 $t_user_id = $t_user_data['id'];
123 if ( $t_show_real_names && !is_blank( $t_user_data['realname'] ) ) {
124 $t_user_name = $t_user_data['realname'];
125 } else {
126 $t_user_name = $t_user_data['username'];
129 echo $t_user_name, ' (', get_enum_element( 'access_levels', $t_user_data['access_level'] ), ')<br />';
133 html_page_bottom();