Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

mantisbt manage_config_email_set.php,1.7,1.8 manage_config_work_threshold_s: msg#00053

bug-tracking.mantis.cvs

Subject: mantisbt manage_config_email_set.php,1.7,1.8 manage_config_work_threshold_set.php,1.7,1.8 manage_config_workflow_set.php,1.7,1.8

Update of /cvsroot/mantisbt/mantisbt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9619

Modified Files:
manage_config_email_set.php
manage_config_work_threshold_set.php
manage_config_workflow_set.php
Log Message:
cleanup in setting configurations
- only set a config if it is different than the underlying defaults
to prevent masking of ALL PROJECTS settings
- set booleans to ON/OFF rather than true/false


Index: manage_config_work_threshold_set.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/manage_config_work_threshold_set.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- manage_config_work_threshold_set.php 15 May 2005 12:26:06 -0000
1.7
+++ manage_config_work_threshold_set.php 16 Aug 2005 01:49:57 -0000
1.8
@@ -51,10 +51,15 @@
}
# @@debug @@ var_dump($$t_access_level, $t_lower_threshold,
$t_array_threshold); echo '<br />';
}
+ $t_existing_threshold = config_get( $p_threshold );
if ( -1 == $t_lower_threshold ) {
- config_set( $p_threshold, $t_array_threshold, NO_USER,
$t_project, $f_access );
+ if ( $t_existing_threshold != $t_array_threshold ) {
+ config_set( $p_threshold, $t_array_threshold, NO_USER,
$t_project, $f_access );
+ }
} else {
- config_set( $p_threshold, $t_lower_threshold, NO_USER,
$t_project, $f_access );
+ if ( $t_existing_threshold != $t_lower_threshold ) {
+ config_set( $p_threshold, $t_lower_threshold, NO_USER,
$t_project, $f_access );
+ }
}
}
}
@@ -66,9 +71,12 @@
&& ( ( ALL_PROJECTS == $t_project ) || !
$p_all_projects_only ) ) {
$f_flag = gpc_get( 'flag_' . $p_threshold, OFF );
$f_access = gpc_get_int( 'access_' . $p_threshold );
+ $f_flag = ( OFF == $f_flag ) ? OFF : ON;
# @@debug @@ echo "<br />for $p_threshold "; var_dump($f_flag,
$f_access); echo '<br />';

- config_set( $p_threshold, $f_flag, NO_USER, $t_project,
$f_access );
+ if ( $f_flag != config_get( $p_threshold ) ) {
+ config_set( $p_threshold, $f_flag, NO_USER, $t_project,
$f_access );
+ }
}
}

@@ -81,7 +89,9 @@
$f_access = gpc_get_int( 'access_' . $p_threshold );
# @@debug @@ echo "<br />for $p_threshold "; var_dump($f_flag,
$f_access); echo '<br />';

- config_set( $p_threshold, $f_flag, NO_USER, $t_project,
$f_access );
+ if ( $f_flag != config_get( $p_threshold ) ) {
+ config_set( $p_threshold, $f_flag, NO_USER, $t_project,
$f_access );
+ }
}
}


Index: manage_config_email_set.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/manage_config_email_set.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- manage_config_email_set.php 28 Jul 2005 16:20:14 -0000 1.7
+++ manage_config_email_set.php 16 Aug 2005 01:49:57 -0000 1.8
@@ -33,7 +33,7 @@
$t_can_change_defaults = $t_access >= config_get_access(
'default_notify_flags' );

# build a list of the possible actions and flags
- $t_valid_actions = array( 'new', 'owner', 'reopened', 'deleted',
'bugnote' );
+ $t_valid_actions = array( 'owner', 'reopened', 'deleted', 'bugnote' );
if( config_get( 'enable_sponsorship' ) == ON ) {
$t_valid_actions[] = 'sponsor';
}
@@ -60,7 +60,7 @@
# parse flags and thresholds
foreach( $f_flags as $t_flag_value ) {
list( $t_action, $t_flag ) = split( ':', $t_flag_value );
- $t_flags[$t_action][$t_flag] = true;
+ $t_flags[$t_action][$t_flag] = ON;
}
foreach( $f_thresholds as $t_threshold_value ) {
list( $t_action, $t_threshold ) = split( ':',
$t_threshold_value );
@@ -78,7 +78,7 @@

# for flags, assume they are true, unless one of the actions
has them off
foreach ( $t_valid_flags as $t_flag ) {
- $t_default_flags[$t_flag] = true;
+ $t_default_flags[$t_flag] = ON;
foreach ( $t_valid_actions as $t_action ) {
if ( ! isset( $t_flags[$t_action][$t_flag] ) ) {
unset( $t_default_flags[$t_flag] );
@@ -99,7 +99,10 @@
$t_default_flags['threshold_min'] = $t_default_min;
$t_default_flags['threshold_max'] = $t_default_max;

- config_set( 'default_notify_flags', $t_default_flags, NO_USER,
$t_project, $f_actions_access );
+ $t_existing_default_flags = config_get( 'default_notify_flags'
);
+ if ( $t_existing_default_flags != $t_default_flags ) { # only
set the flags if they are different
+ config_set( 'default_notify_flags', $t_default_flags, NO_USER,
$t_project, $f_actions_access );
+ }
} else {
$t_default_flags = config_get( 'default_notify_flags' );
}
@@ -109,10 +112,10 @@
$t_action_printed = false;
foreach ( $t_valid_flags as $t_flag ) {
if ( ! isset( $t_default_flags[$t_flag] ) ) {
- $t_default_flags[$t_flag] = false;
+ $t_default_flags[$t_flag] = OFF;
}
if ( isset( $t_flags[$t_action][$t_flag] ) <>
$t_default_flags[$t_flag] ) {
- $t_notify_flags[$t_action][$t_flag] = isset(
$t_flags[$t_action][$t_flag] );
+ $t_notify_flags[$t_action][$t_flag] = isset(
$t_flags[$t_action][$t_flag] ) ? ON : OFF;
}
}
if ( $t_default_flags['threshold_min'] <>
$t_thresholds_min[$t_action] ) {
@@ -123,7 +126,10 @@
}
}
if ( isset( $t_notify_flags ) ) {
- config_set( 'notify_flags', $t_notify_flags, NO_USER,
$t_project, $f_actions_access );
+ $t_existing_flags = config_get( 'notify_flags' );
+ if ( $t_existing_flags != $t_notify_flags ) { # only set the
flags if they are different
+ config_set( 'notify_flags', $t_notify_flags, NO_USER, $t_project,
$f_actions_access );
+ }
}



Index: manage_config_workflow_set.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/manage_config_workflow_set.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- manage_config_workflow_set.php 28 Jul 2005 16:20:14 -0000 1.7
+++ manage_config_workflow_set.php 16 Aug 2005 01:49:57 -0000 1.8
@@ -32,7 +32,9 @@
if( config_get_access( $t_threshold ) <= $t_access ) {
$f_value = gpc_get( 'threshold_' . $t_threshold );
$f_access = gpc_get( 'access_' . $t_threshold );
- config_set( $t_threshold, $f_value, NO_USER,
$t_project, $f_access );
+ if ( $f_value != config_get( $t_threshold ) ) {
+ config_set( $t_threshold, $f_value, NO_USER,
$t_project, $f_access );
+ }
}
}

@@ -72,7 +74,9 @@
$t_workflow[$t_state] = $t_workflow_row;
}
}
- config_set( 'status_enum_workflow', $t_workflow, NO_USER,
$t_project, $f_access );
+ if ( $t_workflow != config_get( 'status_enum_workflow' ) ) {
+ config_set( 'status_enum_workflow', $t_workflow,
NO_USER, $t_project, $f_access );
+ }
}

# process the access level changes
@@ -86,13 +90,17 @@
foreach( $t_statuses as $t_status_id => $t_status_label) {
$f_level = gpc_get( 'access_change_' . $t_status_id );
if ( NEW_ == $t_status_id ) {
- config_set( 'report_bug_threshold',
(int)$f_level, ALL_USERS, $t_project, $f_access );
+ if ( (int)$f_level != config_get(
'report_bug_threshold' ) ) {
+ config_set( 'report_bug_threshold',
(int)$f_level, ALL_USERS, $t_project, $f_access );
+ }
} else {
$t_set_status[$t_status_id] = (int)$f_level;
}
}

- config_set( 'set_status_threshold', $t_set_status, ALL_USERS,
$t_project, $f_access );
+ if ( $t_set_status != config_get( 'set_status_threshold' ) ) {
+ config_set( 'set_status_threshold', $t_set_status,
ALL_USERS, $t_project, $f_access );
+ }
}
?>




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo