SOAP API: do not try to unserialize an invalid filter
[mantis.git] / project_page.php
blob77b1c9d8df83e47577f65e31a1035868c1d7f809
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 - 2011 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 /**
38 * MantisBT Core API's
40 require_once( 'core.php' );
41 require_api( 'access_api.php' );
42 require_api( 'config_api.php' );
43 require_api( 'constant_inc.php' );
44 require_api( 'gpc_api.php' );
45 require_api( 'helper_api.php' );
46 require_api( 'html_api.php' );
47 require_api( 'lang_api.php' );
48 require_api( 'print_api.php' );
49 require_api( 'project_api.php' );
50 require_api( 'string_api.php' );
51 require_api( 'utility_api.php' );
53 $f_project_id = gpc_get_int( 'project_id' );
55 $t_view_issues_url = "set_project.php?project_id=$f_project_id&ref=view_all_bug_page.php";
57 if ( $f_project_id == ALL_PROJECTS ) {
58 print_header_redirect( $t_view_issues_url );
59 exit;
62 # Override the current page to make sure we get the appropriate project-specific configuration
63 $g_project_override = $f_project_id;
65 html_page_top( project_get_field( $f_project_id, 'name' ) );
67 print_recently_visited();
69 echo '<h1>', string_display( project_get_field( $f_project_id, 'name' ) ), '</h1>';
71 echo '<p>';
73 # View Issues
74 print_bracket_link( $t_view_issues_url, lang_get( 'view_bugs_link' ) );
76 # Changelog
77 print_bracket_link( "changelog_page.php?project_id=$f_project_id", lang_get( 'changelog_link' ) );
79 # Roadmap
80 print_bracket_link( "roadmap_page.php?project_id=$f_project_id", lang_get( 'roadmap_link' ) );
82 # Documentation
83 if ( config_get( 'enable_project_documentation' ) == ON ) {
84 print_bracket_link( "proj_doc_page.php?project_id=$f_project_id", lang_get( 'docs_link' ) );
87 # Wiki
88 if ( config_get( 'wiki_enable' ) == ON ) {
89 print_bracket_link( "wiki.php?type=project&id=$f_project_id", lang_get( 'wiki' ) );
92 # Summary Page for Project
93 if ( access_has_project_level( config_get( 'view_summary_threshold' ), $f_project_id ) ) {
94 print_bracket_link( "summary_page.php?project_id=$f_project_id", lang_get( 'summary_link' ) );
97 # Manage Project Page
98 if ( access_has_project_level( config_get( 'manage_project_threshold' ), $f_project_id ) ) {
99 print_bracket_link( "manage_proj_edit_page.php?project_id=$f_project_id", lang_get( 'manage_link' ) );
102 echo '</p>';
104 /** @todo Add status, view state, versions, sub-projects, parent projects, and news. */
105 /** @todo Schema change: add home page, license, */
107 $t_description = project_get_field( $f_project_id, 'description' );
109 if ( !is_blank( $t_description ) ) {
110 echo '<h2>', lang_get( 'description' ), '</h2>';
111 echo '<p>', string_display( $t_description ), '</p>';
114 $t_access_level_for_dev_team = config_get( 'development_team_threshold' );
116 $t_users = project_get_all_user_rows( $f_project_id, $t_access_level_for_dev_team );
117 $t_show_real_names = config_get( 'show_realname' ) == ON;
119 if ( count( $t_users ) > 0 ) {
120 echo '<h2>', lang_get( 'development_team' ), '</h2>';
122 /** @todo sort users in DESC order by access level, then ASC by username/realname. */
123 foreach ( $t_users as $t_user_data ) {
124 $t_user_id = $t_user_data['id'];
126 if ( $t_show_real_names && !is_blank( $t_user_data['realname'] ) ) {
127 $t_user_name = $t_user_data['realname'];
128 } else {
129 $t_user_name = $t_user_data['username'];
132 echo $t_user_name, ' (', get_enum_element( 'access_levels', $t_user_data['access_level'] ), ')<br />';
136 html_page_bottom();