. # This upgrade moves attachments from the database to the disk /** * @package MantisBT * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ /** * MantisBT Core API's */ require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' ); access_ensure_global_level( config_get_global( 'admin_site_threshold' ) ); $f_source_field_id = gpc_get_int( 'source_id' ); $f_dest_field = gpc_get( 'dest_id' ); # checks on validity $t_valid_fields = array( 'fixed_in_version', ); if( !in_array( $f_dest_field, $t_valid_fields ) ) { echo '
'; echo 'Invalid destination field (' . string_attribute($f_dest_field) . ') specified.
'; echo ''; exit; } ?>[ Back to System Utilities ] [ Refresh view ] | MantisBT Administration - Copy Custom Fields to Built-in |
No fields need to be updated.
'; } else { $count = db_num_rows( $result ); echo 'Found ' . $count . ' fields to be updated.
'; $t_failures = 0; if( $count > 0 ) { echo 'Bug Id | Field Value | Status |
---|---|---|
%07d | %s | ", helper_alternate_class(), $v_bug_id, $v_bug_id, $v_value); # validate field contents switch( $f_dest_field ) { case 'fixed_in_version': $t_valid = ( version_get_id( $t_cust_value, $t_project_id ) == FALSE ) ? FALSE : TRUE; break; default: $t_valid = FALSE; } if( $t_valid ) { # value was valid, update value if( !bug_set_field( $v_bug_id, $f_dest_field, $t_cust_value ) ) { echo 'database update failed'; $t_failures++; } else { echo 'applied'; } } else { echo 'field value was not valid or previously defined'; $t_failures++; } echo ' |
Completed...
'; ?>