Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / adm_permissions_report.php
blob83847ad6cd0d2c0097a30a6b0bcaaa8156273800
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 * @author Marcello Scata' <marcelloscata at users.sourceforge.net> ITALY
20 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
21 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
22 * @link http://www.mantisbt.org
24 * @uses core.php
25 * @uses access_api.php
26 * @uses config_api.php
27 * @uses constant_inc.php
28 * @uses helper_api.php
29 * @uses html_api.php
30 * @uses lang_api.php
31 * @uses string_api.php
34 require_once( 'core.php' );
35 require_api( 'access_api.php' );
36 require_api( 'config_api.php' );
37 require_api( 'constant_inc.php' );
38 require_api( 'helper_api.php' );
39 require_api( 'html_api.php' );
40 require_api( 'lang_api.php' );
41 require_api( 'string_api.php' );
43 access_ensure_project_level( config_get( 'manage_configuration_threshold' ) );
45 html_page_top( lang_get( 'permissions_summary_report' ) );
47 print_manage_menu( 'adm_permissions_report.php' );
48 print_manage_config_menu( 'adm_permissions_report.php' );
50 function get_section_begin_apr( $p_section_name ) {
51 $t_access_levels = MantisEnum::getValues( config_get( 'access_levels_enum_string' ) );
53 $t_output = '<table class="width100">';
54 $t_output .= '<tr><td class="form-title-caps" colspan="' . ( count( $t_access_levels ) + 1 ) . '">' . $p_section_name . '</td></tr>' . "\n";
55 $t_output .= '<tr><td class="form-title" width="40%">' . lang_get( 'perm_rpt_capability' ) . '</td>';
57 foreach( $t_access_levels as $t_access_level ) {
58 $t_output .= '<td class="form-title" style="text-align:center">&nbsp;' . MantisEnum::getLabel( lang_get( 'access_levels_enum_string' ), $t_access_level ) . '&nbsp;</td>';
61 $t_output .= '</tr>' . "\n";
63 return $t_output;
66 function get_capability_row( $p_caption, $p_access_level ) {
67 $t_access_levels = MantisEnum::getValues( config_get( 'access_levels_enum_string' ) );
69 $t_output = '<tr ' . helper_alternate_class() . '><td>' . string_display( $p_caption ) . '</td>';
70 foreach( $t_access_levels as $t_access_level ) {
71 if ( $t_access_level >= (int)$p_access_level ) {
72 $t_value = '<img src="images/ok.gif" width="20" height="15" alt="X" title="X" />';
73 } else {
74 $t_value = '&nbsp;';
77 $t_output .= '<td class="center">' . $t_value . '</td>';
80 $t_output .= '</tr>' . "\n";
82 return $t_output;
85 function get_section_end() {
86 $t_output = '</table><br />' . "\n";
87 return $t_output;
90 echo '<br /><br />';
92 # News
93 echo get_section_begin_apr( lang_get( 'news' ) );
94 echo get_capability_row( lang_get( 'view_private_news' ), config_get( 'private_news_threshold' ) );
95 echo get_capability_row( lang_get( 'manage_news' ), config_get( 'manage_news_threshold' ) );
96 echo get_section_end();
98 # Attachments
99 if( config_get( 'allow_file_upload' ) == ON ) {
100 echo get_section_begin_apr( lang_get( 'attachments' ) );
101 echo get_capability_row( lang_get( 'view_list_of_attachments' ), config_get( 'view_attachments_threshold' ) );
102 echo get_capability_row( lang_get( 'download_attachments' ), config_get( 'download_attachments_threshold' ) );
103 echo get_capability_row( lang_get( 'delete_attachments' ), config_get( 'delete_attachments_threshold' ) );
104 echo get_capability_row( lang_get( 'upload_issue_attachments' ), config_get( 'upload_bug_file_threshold' ) );
105 echo get_section_end();
108 # Filters
109 echo get_section_begin_apr( lang_get( 'filters' ) );
110 echo get_capability_row( lang_get( 'save_filters' ), config_get( 'stored_query_create_threshold' ) );
111 echo get_capability_row( lang_get( 'save_filters_as_shared' ), config_get( 'stored_query_create_shared_threshold' ) );
112 echo get_capability_row( lang_get( 'use_saved_filters' ), config_get( 'stored_query_use_threshold' ) );
113 echo get_section_end();
115 # Projects
116 echo get_section_begin_apr( lang_get( 'projects_link' ) );
117 echo get_capability_row( lang_get( 'create_project' ), config_get( 'create_project_threshold' ) );
118 echo get_capability_row( lang_get( 'delete_project' ), config_get( 'delete_project_threshold' ) );
119 echo get_capability_row( lang_get( 'manage_projects_link' ), config_get( 'manage_project_threshold' ) );
120 echo get_capability_row( lang_get( 'manage_user_access_to_project' ), config_get( 'project_user_threshold' ) );
121 echo get_capability_row( lang_get( 'automatically_included_in_private_projects' ), config_get( 'private_project_threshold' ) );
122 echo get_section_end();
124 # Project Documents
125 if( config_get( 'enable_project_documentation' ) == ON ) {
126 echo get_section_begin_apr( lang_get( 'project_documents' ) );
127 echo get_capability_row( lang_get( 'view_project_documents' ), config_get( 'view_proj_doc_threshold' ) );
128 echo get_capability_row( lang_get( 'upload_project_documents' ), config_get( 'upload_project_file_threshold' ) );
129 echo get_section_end();
132 # Custom Fields
133 echo get_section_begin_apr( lang_get( 'custom_fields_setup' ) );
134 echo get_capability_row( lang_get( 'manage_custom_field_link' ), config_get( 'manage_custom_fields_threshold' ) );
135 echo get_capability_row( lang_get( 'link_custom_fields_to_projects' ), config_get( 'custom_field_link_threshold' ) );
136 echo get_section_end();
138 # Sponsorships
139 if( config_get( 'enable_sponsorship' ) == ON ) {
140 echo get_section_begin_apr( lang_get( 'sponsorships' ) );
141 echo get_capability_row( lang_get( 'view_sponsorship_details' ), config_get( 'view_sponsorship_details_threshold' ) );
142 echo get_capability_row( lang_get( 'view_sponsorship_total' ), config_get( 'view_sponsorship_total_threshold' ) );
143 echo get_capability_row( lang_get( 'sponsor_issue' ), config_get( 'sponsor_threshold' ) );
144 echo get_capability_row( lang_get( 'assign_sponsored_issue' ), config_get( 'assign_sponsored_bugs_threshold' ) );
145 echo get_capability_row( lang_get( 'handle_sponsored_issue' ), config_get( 'handle_sponsored_bugs_threshold' ) );
146 echo get_section_end();
149 # Others
150 echo get_section_begin_apr( lang_get('others') );
151 echo get_capability_row( lang_get( 'view' ) . ' ' . lang_get( 'summary_link' ), config_get( 'view_summary_threshold' ) );
152 echo get_capability_row( lang_get( 'see_email_addresses_of_other_users' ), config_get( 'show_user_email_threshold' ) );
153 echo get_capability_row( lang_get( 'send_reminders' ), config_get( 'bug_reminder_threshold' ) );
154 echo get_capability_row( lang_get( 'add_profiles' ), config_get( 'add_profile_threshold' ) );
155 echo get_capability_row( lang_get( 'manage_users_link' ), config_get( 'manage_user_threshold' ) );
156 echo get_capability_row( lang_get( 'notify_of_new_user_created' ), config_get( 'notify_new_user_created_threshold_min' ) );
157 echo get_section_end();
159 html_page_bottom();