[ PHPXref.com ] [ Generated: Sun Jul 20 18:33:16 2008 ] [ Mantis 1.0.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> manage_config_work_threshold_set.php (source)

   1  <?php
   2      # Mantis - a php based bugtracking system
   3      # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   4      # Copyright (C) 2002 - 2004  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   5      # This program is distributed under the terms and conditions of the GPL
   6      # See the README and LICENSE files for details
   7  
   8      # --------------------------------------------------------
   9      # $Id: manage_config_work_threshold_set.php,v 1.9 2005/09/03 11:30:03 thraxisp Exp $
  10      # --------------------------------------------------------
  11  
  12      require_once ( 'core.php' );
  13  
  14      $t_core_path = config_get( 'core_path' );
  15      require_once( $t_core_path.'email_api.php' );
  16  
  17      $t_redirect_url = 'manage_config_work_threshold_page.php';
  18      $t_project = helper_get_current_project();
  19  
  20      html_page_top1( lang_get( 'manage_threshold_config' ) );
  21      html_meta_redirect( $t_redirect_url );
  22      html_page_top2();
  23  
  24      $t_access = current_user_get_access_level();
  25  
  26  	function set_capability_row( $p_threshold, $p_all_projects_only=false ) {
  27          global $t_access, $t_project;
  28  
  29          if ( ( $t_access >= config_get_access( $p_threshold ) )
  30                    && ( ( ALL_PROJECTS == $t_project ) || ! $p_all_projects_only ) ) {
  31              $f_threshold = gpc_get_int_array( 'flag_thres_' . $p_threshold, array( ) );
  32              $f_access = gpc_get_int( 'access_' . $p_threshold );
  33              # @@debug @@ echo "<br />for $p_threshold "; var_dump($f_threshold, $f_access); echo '<br />';
  34              $t_access_levels = get_enum_to_array( config_get( 'access_levels_enum_string' ) );
  35              ksort( $t_access_levels );
  36              reset( $t_access_levels );
  37  
  38              $t_lower_threshold = NOBODY;
  39              $t_array_threshold = array();
  40  
  41              foreach( $t_access_levels as $t_access_level => $t_level_name ) {
  42                  if ( in_array( $t_access_level, $f_threshold ) ) {
  43                      if ( NOBODY == $t_lower_threshold ) {
  44                          $t_lower_threshold = $t_access_level;
  45                      }
  46                      $t_array_threshold[] = $t_access_level;
  47                  } else {
  48                      if ( NOBODY <> $t_lower_threshold ) {
  49                          $t_lower_threshold = -1;
  50                      }
  51                  }
  52              # @@debug @@ var_dump($$t_access_level, $t_lower_threshold, $t_array_threshold); echo '<br />';
  53              }
  54              $t_existing_threshold = config_get( $p_threshold );
  55              if ( -1 == $t_lower_threshold ) {
  56                  if ( $t_existing_threshold != $t_array_threshold ) {
  57                      config_set( $p_threshold, $t_array_threshold, NO_USER, $t_project, $f_access );
  58                  }
  59              } else {
  60                  if ( $t_existing_threshold != $t_lower_threshold ) {
  61                      config_set( $p_threshold, $t_lower_threshold, NO_USER, $t_project, $f_access );
  62                  }
  63              }
  64          }
  65      }
  66  
  67  	function set_capability_boolean( $p_threshold, $p_all_projects_only=false ) {
  68          global $t_access, $t_project;
  69  
  70          if ( ( $t_access >= config_get_access( $p_threshold ) )
  71                    && ( ( ALL_PROJECTS == $t_project ) || ! $p_all_projects_only ) ) {
  72              $f_flag = gpc_get( 'flag_' . $p_threshold, OFF );
  73              $f_access = gpc_get_int( 'access_' . $p_threshold );
  74              $f_flag = ( OFF == $f_flag ) ? OFF : ON;
  75              # @@debug @@ echo "<br />for $p_threshold "; var_dump($f_flag, $f_access); echo '<br />';
  76  
  77              if ( $f_flag != config_get( $p_threshold ) ) {
  78                  config_set( $p_threshold, $f_flag, NO_USER, $t_project, $f_access );
  79              }
  80          }
  81      }
  82  
  83  	function set_capability_enum( $p_threshold, $p_all_projects_only=false ) {
  84          global $t_access, $t_project;
  85  
  86          if ( ( $t_access >= config_get_access( $p_threshold ) )
  87                    && ( ( ALL_PROJECTS == $t_project ) || ! $p_all_projects_only ) ) {
  88              $f_flag = gpc_get( 'flag_' . $p_threshold );
  89              $f_access = gpc_get_int( 'access_' . $p_threshold );
  90              # @@debug @@ echo "<br />for $p_threshold "; var_dump($f_flag, $f_access); echo '<br />';
  91  
  92              if ( $f_flag != config_get( $p_threshold ) ) {
  93                  config_set( $p_threshold, $f_flag, NO_USER, $t_project, $f_access );
  94              }
  95          }
  96      }
  97  
  98  
  99      # Issues
 100      set_capability_row( 'report_bug_threshold' );
 101      set_capability_enum( 'bug_submit_status' );
 102      set_capability_row( 'update_bug_threshold' );
 103      set_capability_boolean( 'allow_close_immediately' );
 104      set_capability_boolean( 'allow_reporter_close' );
 105      set_capability_row( 'monitor_bug_threshold' );
 106      set_capability_row( 'handle_bug_threshold' );
 107       set_capability_row( 'update_bug_assign_threshold' );
 108      set_capability_row( 'move_bug_threshold', true );
 109      set_capability_row( 'delete_bug_threshold' );
 110      set_capability_row( 'reopen_bug_threshold' );
 111      set_capability_boolean( 'allow_reporter_reopen' );
 112      set_capability_enum( 'bug_reopen_status' );
 113      set_capability_enum( 'bug_reopen_resolution' );
 114      set_capability_enum( 'bug_resolved_status_threshold' );
 115      set_capability_enum( 'bug_readonly_status_threshold' );
 116      set_capability_row( 'private_bug_threshold' );
 117      set_capability_row( 'update_readonly_bug_threshold' );
 118      set_capability_row( 'update_bug_status_threshold' );
 119      set_capability_row( 'set_view_status_threshold' );
 120      set_capability_row( 'change_view_status_threshold' );
 121      set_capability_row( 'show_monitor_list_threshold' );
 122      set_capability_boolean( 'auto_set_status_to_assigned' );
 123      set_capability_enum( 'bug_assigned_status' );
 124      set_capability_boolean( 'limit_reporters', true );
 125  
 126      # Notes
 127      set_capability_row( 'add_bugnote_threshold' );
 128      set_capability_row( 'update_bugnote_threshold' );
 129      set_capability_boolean( 'bugnote_allow_user_edit_delete' );
 130      set_capability_row( 'delete_bugnote_threshold' );
 131      set_capability_row( 'private_bugnote_threshold' );
 132  
 133  
 134      # Others
 135      set_capability_row( 'view_changelog_threshold' );
 136      set_capability_row( 'view_handler_threshold' );
 137      set_capability_row( 'view_history_threshold' );
 138      set_capability_row( 'bug_reminder_threshold' );
 139  
 140  ?>
 141  
 142  <br />
 143  <div align="center">
 144  <?php
 145      echo lang_get( 'operation_successful' ) . '<br />';
 146      print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
 147  ?>
 148  </div>
 149  
 150  <?php html_page_bottom1( __FILE__ ) ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]