[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/ -> adm_permissions_report.php (source)

   1  <?php
   2  # MantisBT - A PHP based bugtracking system
   3  
   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.
   8  #
   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.
  13  #
  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/>.
  16  
  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 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
  22   * @link http://www.mantisbt.org
  23   *
  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
  32   */
  33  
  34  /**
  35   * MantisBT Core API's
  36   */
  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( 'helper_api.php' );
  42  require_api( 'html_api.php' );
  43  require_api( 'lang_api.php' );
  44  require_api( 'string_api.php' );
  45  
  46  access_ensure_project_level( config_get( 'manage_configuration_threshold' ) );
  47  
  48  html_page_top( lang_get( 'permissions_summary_report' ) );
  49  
  50  print_manage_menu( 'adm_permissions_report.php' );
  51  print_manage_config_menu( 'adm_permissions_report.php' );
  52  
  53  function get_section_begin_apr( $p_section_name ) {
  54      $t_access_levels = MantisEnum::getValues( config_get( 'access_levels_enum_string' ) );
  55  
  56      $t_output = '<table class="width100">';
  57      $t_output .= '<tr><td class="form-title-caps" colspan="' . ( count( $t_access_levels ) + 1 ) . '">' . $p_section_name . '</td></tr>' . "\n";
  58      $t_output .= '<tr><td class="form-title">' . lang_get( 'perm_rpt_capability' ) . '</td>';
  59  
  60      foreach( $t_access_levels as $t_access_level ) {
  61          $t_output .= '<td class="form-title" style="text-align:center">&#160;' . MantisEnum::getLabel( lang_get( 'access_levels_enum_string' ), $t_access_level ) . '&#160;</td>';
  62      }
  63  
  64      $t_output .= '</tr>' . "\n";
  65  
  66      return $t_output;
  67  }
  68  
  69  function get_capability_row( $p_caption, $p_access_level ) {
  70      $t_access_levels = MantisEnum::getValues( config_get( 'access_levels_enum_string' ) );
  71  
  72      $t_output = '<tr ' . helper_alternate_class() . '><td>' . string_display( $p_caption ) . '</td>';
  73      foreach( $t_access_levels as $t_access_level ) {
  74          if ( $t_access_level >= (int)$p_access_level ) {
  75              $t_value = '<img src="images/ok.gif" width="20" height="15" alt="X" title="X" />';
  76          } else {
  77              $t_value = '&#160;';
  78          }
  79  
  80          $t_output .= '<td class="center">' . $t_value . '</td>';
  81      }
  82  
  83      $t_output .= '</tr>' . "\n";
  84  
  85      return $t_output;
  86  }
  87  
  88  function get_section_end() {
  89      $t_output = '</table><br />' . "\n";
  90      return $t_output;
  91  }
  92  
  93  echo '<br /><br />';
  94  
  95  # News
  96  echo get_section_begin_apr( lang_get( 'news' ) );
  97  echo get_capability_row( lang_get( 'view_private_news' ), config_get( 'private_news_threshold' ) );
  98  echo get_capability_row( lang_get( 'manage_news' ), config_get( 'manage_news_threshold' ) );
  99  echo get_section_end();
 100  
 101  # Attachments
 102  if( config_get( 'allow_file_upload' ) == ON ) {
 103      echo get_section_begin_apr( lang_get( 'attachments' ) );
 104      echo get_capability_row( lang_get( 'view_list_of_attachments' ), config_get( 'view_attachments_threshold' ) );
 105      echo get_capability_row( lang_get( 'download_attachments' ), config_get( 'download_attachments_threshold' ) );
 106      echo get_capability_row( lang_get( 'delete_attachments' ), config_get( 'delete_attachments_threshold' ) );
 107      echo get_capability_row( lang_get( 'upload_issue_attachments' ), config_get( 'upload_bug_file_threshold' ) );
 108      echo get_section_end();
 109  }
 110  
 111  # Filters
 112  echo get_section_begin_apr( lang_get( 'filters' ) );
 113  echo get_capability_row( lang_get( 'save_filters' ), config_get( 'stored_query_create_threshold' ) );
 114  echo get_capability_row( lang_get( 'save_filters_as_shared' ), config_get( 'stored_query_create_shared_threshold' ) );
 115  echo get_capability_row( lang_get( 'use_saved_filters' ), config_get( 'stored_query_use_threshold' ) );
 116  echo get_section_end();
 117  
 118  # Projects
 119  echo get_section_begin_apr( lang_get( 'projects_link' ) );
 120  echo get_capability_row( lang_get( 'create_project' ), config_get( 'create_project_threshold' ) );
 121  echo get_capability_row( lang_get( 'delete_project' ), config_get( 'delete_project_threshold' ) );
 122  echo get_capability_row( lang_get( 'manage_projects_link' ), config_get( 'manage_project_threshold' ) );
 123  echo get_capability_row( lang_get( 'manage_user_access_to_project' ), config_get( 'project_user_threshold' ) );
 124  echo get_capability_row( lang_get( 'automatically_included_in_private_projects' ), config_get( 'private_project_threshold' ) );
 125  echo get_section_end();
 126  
 127  # Project Documents
 128  if( config_get( 'enable_project_documentation' ) == ON ) {
 129      echo get_section_begin_apr( lang_get( 'project_documents' ) );
 130      echo get_capability_row( lang_get( 'view_project_documents' ), config_get( 'view_proj_doc_threshold' ) );
 131      echo get_capability_row( lang_get( 'upload_project_documents' ), config_get( 'upload_project_file_threshold' ) );
 132      echo get_section_end();
 133  }
 134  
 135  # Custom Fields
 136  echo get_section_begin_apr( lang_get( 'custom_fields_setup' ) );
 137  echo get_capability_row( lang_get( 'manage_custom_field_link' ), config_get( 'manage_custom_fields_threshold' ) );
 138  echo get_capability_row( lang_get( 'link_custom_fields_to_projects' ), config_get( 'custom_field_link_threshold' ) );
 139  echo get_section_end();
 140  
 141  # Sponsorships
 142  if( config_get( 'enable_sponsorship' ) == ON ) {
 143      echo get_section_begin_apr( lang_get( 'sponsorships' ) );
 144      echo get_capability_row( lang_get( 'view_sponsorship_details' ), config_get( 'view_sponsorship_details_threshold' ) );
 145      echo get_capability_row( lang_get( 'view_sponsorship_total' ), config_get( 'view_sponsorship_total_threshold' ) );
 146      echo get_capability_row( lang_get( 'sponsor_issue' ), config_get( 'sponsor_threshold' ) );
 147      echo get_capability_row( lang_get( 'assign_sponsored_issue' ), config_get( 'assign_sponsored_bugs_threshold' ) );
 148      echo get_capability_row( lang_get( 'handle_sponsored_issue' ), config_get( 'handle_sponsored_bugs_threshold' ) );
 149      echo get_section_end();
 150  }
 151  
 152  # Others
 153  echo get_section_begin_apr( lang_get('others') );
 154  echo get_capability_row( lang_get( 'view' ) . ' ' . lang_get( 'summary_link' ), config_get( 'view_summary_threshold' ) );
 155  echo get_capability_row( lang_get( 'see_email_addresses_of_other_users' ), config_get( 'show_user_email_threshold' ) );
 156  echo get_capability_row( lang_get( 'send_reminders' ), config_get( 'bug_reminder_threshold' ) );
 157  echo get_capability_row( lang_get( 'add_profiles' ), config_get( 'add_profile_threshold' ) );
 158  echo get_capability_row( lang_get( 'manage_users_link' ), config_get( 'manage_user_threshold' ) );
 159  echo get_capability_row( lang_get( 'notify_of_new_user_created' ), config_get( 'notify_new_user_created_threshold_min' ) );
 160  echo get_section_end();
 161  
 162  html_page_bottom();


Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7