diff --git a/bug_update.php b/bug_update.php index aed16e968b..f171b0a988 100644 --- a/bug_update.php +++ b/bug_update.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: bug_update.php,v 1.37 2002-10-27 23:35:40 jfitzell Exp $ + # $Id: bug_update.php,v 1.38 2002-10-29 08:03:01 jfitzell Exp $ # -------------------------------------------------------- ?> reporter_id = gpc_get_int( 'f_reporter_id', $t_bug_data->reporter_id ); + $t_bug_data->handler_id = gpc_get_int( 'f_handler_id', $t_bug_data->handler_id ); + $t_bug_data->duplicate_id = gpc_get_int( 'f_duplicate_id', $t_bug_data->duplicate_id ); + $t_bug_data->priority = gpc_get_int( 'f_priority', $t_bug_data->priority ); + $t_bug_data->severity = gpc_get_int( 'f_severity', $t_bug_data->severity ); + $t_bug_data->reproducibility = gpc_get_int( 'f_reproducibility', $t_bug_data->reproducibility ); + $t_bug_data->status = gpc_get_int( 'f_status', $t_bug_data->status ); + $t_bug_data->resolution = gpc_get_int( 'f_resolution', $t_bug_data->resolution ); + $t_bug_data->projection = gpc_get_int( 'f_projection', $t_bug_data->projection ); + $t_bug_data->category = gpc_get_string( 'f_category', $t_bug_data->category ); + $t_bug_data->eta = gpc_get_int( 'f_eta', $t_bug_data->eta ); + $t_bug_data->os = gpc_get_string( 'f_os', $t_bug_data->os ); + $t_bug_data->os_build = gpc_get_string( 'f_os_build', $t_bug_data->os_build ); + $t_bug_data->platform = gpc_get_string( 'f_platform', $t_bug_data->platform ); + $t_bug_data->version = gpc_get_string( 'f_version', $t_bug_data->version ); + $t_bug_data->build = gpc_get_string( 'f_build', $t_bug_data->build ); + $t_bug_data->view_state = gpc_get_int( 'f_view_state', $t_bug_data->view_state ); + $t_bug_data->summary = gpc_get_string( 'f_summary', $t_bug_data->summary ); + + $t_bug_data->description = gpc_get_string( 'f_description', $t_bug_data->description ); + $t_bug_data->steps_to_reproduce = gpc_get_string( 'f_steps_to_reproduce', $t_bug_data->steps_to_reproduce ); + $t_bug_data->additional_information = gpc_get_string( 'f_additional_information', $t_bug_data->additional_information ); + + $f_private = gpc_get_bool( 'f_private' ); + $f_bugnote_text = gpc_get_string( 'f_bugnote_text', '' ); + + # Handle auto-assigning + if ( ( NEW_ == $t_bug_data->status ) + && ( 0 != $t_bug_data->handler_id ) + && ( ON == config_get( 'auto_set_status_to_assigned' ) ) ) { + $t_bug_data->status = ASSIGNED; } - # prevent warnings - check_varset( $f_os, $h_os ); - check_varset( $f_os_build, $h_os_build ); - check_varset( $f_platform, $h_platform ); - check_varset( $f_version, $h_version ); - check_varset( $f_build, $h_build ); - check_varset( $f_eta, $h_eta ); - check_varset( $f_projection, $h_projection ); - check_varset( $f_resolution, $h_resolution ); - check_varset( $f_os_build, $h_os_build ); - - if ( !isset( $f_steps_to_reproduce ) ) { - $c_steps_to_reproduce = $h_steps_to_reproduce; - } else { - $c_steps_to_reproduce = string_prepare_textarea( $f_steps_to_reproduce ); - } - - # prepare strings - $c_os = string_prepare_text( $f_os ); - $c_os_build = string_prepare_text( $f_os_build ); - $c_platform = string_prepare_text( $f_platform ); - $c_version = string_prepare_text( $f_version ); - $c_build = string_prepare_text( $f_build ); - $c_summary = string_prepare_text( $f_summary ); - $c_description = string_prepare_textarea( $f_description ); - $c_additional_information = string_prepare_textarea( $f_additional_information ); - - $c_category = addslashes($f_category); - $c_status = (integer)$f_status; - $c_severity = (integer)$f_severity; - $c_resolution = (integer)$f_resolution; - $c_projection = (integer)$f_projection; - $c_eta = (integer)$f_eta; - $c_priority = (integer)$f_priority; - $c_reproducibility = (integer)$f_reproducibility; - $c_duplicate_id = (integer)$f_duplicate_id; - $c_handler_id = (integer)$f_handler_id; - $c_reporter_id = (integer)$f_reporter_id; - $c_view_state = (integer)$f_view_state; - - $h_description = string_prepare_textarea( $h_description ); - $h_steps_to_reproduce = string_prepare_textarea( $h_steps_to_reproduce ); - $h_additional_information = string_prepare_textarea( $h_additional_information ); - - $t_bug_table = config_get( 'mantis_bug_table' ); - - # Update all fields - $query = "UPDATE $t_bug_table - SET category='$c_category', - severity='$c_severity', - reproducibility='$c_reproducibility', - priority='$c_priority', - status='$c_status', - projection='$c_projection', - duplicate_id='$c_duplicate_id', - resolution='$c_resolution', - handler_id='$c_handler_id', - reporter_id='$c_reporter_id', - eta='$c_eta', - summary='$c_summary', - os='$c_os', - os_build='$c_os_build', - platform='$c_platform', - build='$c_build', - version='$c_version', - view_state='$c_view_state' - WHERE id='$c_bug_id'"; - $result = db_query($query); - - $t_bug_text_table = config_get( 'mantis_bug_text_table' ); - - # These fields are not changed as often as the assigned person, priority, status, etc. - if ( ( $c_description != $h_description ) || ( $c_steps_to_reproduce != $h_steps_to_reproduce ) || ( $c_additional_information != $h_additional_information ) ) { - $query = "UPDATE $t_bug_text_table ". - "SET description='$c_description', ". - "steps_to_reproduce='$c_steps_to_reproduce', ". - "additional_information='$c_additional_information' ". - "WHERE id='$h_bug_text_id'"; - $result = db_query($query); - } - - # log changes - $t_user_id = current_user_get_field( 'id' ); - history_log_event_direct( $c_bug_id, 'category', $h_category, $f_category, $t_user_id ); - history_log_event_direct( $c_bug_id, 'severity', $h_severity, $c_severity, $t_user_id ); - history_log_event_direct( $c_bug_id, 'reproducibility', $h_reproducibility, $c_reproducibility, $t_user_id ); - history_log_event_direct( $c_bug_id, 'priority', $h_priority, $c_priority, $t_user_id ); - history_log_event_direct( $c_bug_id, 'status', $h_status, $c_status, $t_user_id ); - history_log_event_direct( $c_bug_id, 'projection', $h_projection, $f_projection, $t_user_id ); - history_log_event_direct( $c_bug_id, 'duplicate_id', $h_duplicate_id, $c_duplicate_id, $t_user_id ); - history_log_event_direct( $c_bug_id, 'resolution', $h_resolution, $c_resolution, $t_user_id ); - history_log_event_direct( $c_bug_id, 'handler_id', $h_handler_id, $c_handler_id, $t_user_id ); - history_log_event_direct( $c_bug_id, 'reporter_id', $h_reporter_id, $c_reporter_id, $t_user_id ); - history_log_event_direct( $c_bug_id, 'eta', $h_eta, $c_eta, $t_user_id ); - history_log_event_direct( $c_bug_id, 'summary', $h_summary, $f_summary, $t_user_id ); - history_log_event_direct( $c_bug_id, 'os', $h_os, $f_os, $t_user_id ); - history_log_event_direct( $c_bug_id, 'os_build', $h_os_build, $f_os_build, $t_user_id ); - history_log_event_direct( $c_bug_id, 'platform', $h_platform, $f_platform, $t_user_id ); - history_log_event_direct( $c_bug_id, 'build', $h_build, $f_build, $t_user_id ); - history_log_event_direct( $c_bug_id, 'version', $h_version, $f_version, $t_user_id ); - history_log_event_direct( $c_bug_id, 'view_state', $h_view_state, $c_view_state, $t_user_id ); - - if ( $h_description != $c_description ) { - history_log_event_special( $c_bug_id, DESCRIPTION_UPDATED ); - } - if ( $h_steps_to_reproduce != $c_steps_to_reproduce ) { - history_log_event_special( $c_bug_id, STEP_TO_REPRODUCE_UPDATED ); - } - if ( $h_additional_information != $c_additional_information ) { - history_log_event_special( $c_bug_id, ADDITIONAL_INFO_UPDATED ); - } - - # add a bugnote if there was one - check_varset( $f_private, false ); - check_varset( $f_bugnote_text, '' ); + bug_update( $f_bug_id, $t_bug_data, true ); $f_bugnote_text = trim( $f_bugnote_text ); if ( !empty( $f_bugnote_text ) ) { - $result = bugnote_add( $f_bug_id, $f_bugnote_text, (bool)$f_private ); - } - - # updated the last_updated date - $result = bug_update_date( $f_bug_id ); - - # If we should notify and it's in feedback state then send an email - switch ( $f_status ) { - case NEW_: # This will be used in the case where auto-assign = OFF, in this case the bug can be - # assigned/unassigned while the status is NEW. - # @@@ In case of unassigned, the e-mail will still say ASSIGNED, but it will be shown - # that the handler is empty + history ( old_handler => @null@ ). - if ( $f_handler_id != $f_old_handler_id ) { - email_assign( $f_bug_id ); - } - break; - case FEEDBACK: if ( $f_status!= $f_old_status ) { - email_feedback( $f_bug_id ); - } - break; - case ASSIGNED: if ( ( $f_handler_id != $f_old_handler_id ) OR ( $f_status != $f_old_status ) ) { - email_assign( $f_bug_id ); - } - break; - case RESOLVED: email_resolved( $f_bug_id ); - break; - case CLOSED: email_close( $f_bug_id ); - break; + bugnote_add( $f_bug_id, $f_bugnote_text, $f_private ); } - # Determine which view page to redirect back to. - $t_redirect_url = string_get_bug_view_url( $f_bug_id ); - if ( $result ) { - print_header_redirect( $t_redirect_url ); - } else { - print_mantis_error( ERROR_GENERIC ); - } + print_header_redirect_view( $f_bug_id ); ?> \ No newline at end of file diff --git a/core/bug_api.php b/core/bug_api.php index 2b0b7d8977..888b1c3fff 100644 --- a/core/bug_api.php +++ b/core/bug_api.php @@ -6,13 +6,50 @@ # See the files README and LICENSE for details # -------------------------------------------------------- - # $Id: bug_api.php,v 1.16 2002-10-27 22:53:04 jfitzell Exp $ + # $Id: bug_api.php,v 1.17 2002-10-29 08:03:03 jfitzell Exp $ # -------------------------------------------------------- ########################################################################### # Bug API ########################################################################### + #=================================== + # Bug Data Structure Definition + #=================================== + class BugData { + var $project_id = 0; + var $reporter_id = 0; + var $handler_id = 0; + var $duplicate_id = 0; + var $priority = NORMAL; + var $severity = MINOR; + var $reproducibility = 10; + var $status = NEW_; + var $resolution = OPEN; + var $projection = 10; + var $category = ''; + var $date_submitted = ''; + var $last_updated = ''; + var $eta = 10; + var $os = ''; + var $os_build = ''; + var $platform = ''; + var $version = ''; + var $build = ''; + var $votes = 0; + var $view_state = PUBLIC; + var $summary = ''; + + # omitted: + # var $bug_text_id + # var $profile_id + + # extended info + var $description = ''; + var $steps_to_reproduce = ''; + var $additional_information = ''; + } + #=================================== # Caching #=================================== @@ -58,11 +95,7 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors=true) { return $row; } - # -------------------- - # Pads the bug id with the appropriate number of zeros. - function bug_format_id( $p_bug_id ) { - return( str_pad( $p_bug_id, 7, '0', STR_PAD_LEFT ) ); - } + # -------------------- # Clear the bug cache (or just the given id if specified) function bug_clear_cache( $p_bug_id = null ) { @@ -77,6 +110,8 @@ function bug_clear_cache( $p_bug_id = null ) { return true; } + + # -------------------- # Cache a bug text row if necessary and return the cached copy # If the second parameter is true (default), trigger an error # if the bug text can't be found. If the second parameter is @@ -113,6 +148,7 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors=true) { return $row; } + # -------------------- # Clear the bug text cache (or just the given id if specified) function bug_text_clear_cache( $p_bug_id = null ) { @@ -151,6 +187,7 @@ function bug_exists( $p_bug_id ) { return false; } } + # -------------------- # check to see if bug exists by id # if it doesn't exist then error @@ -282,6 +319,7 @@ function bug_create( $p_project_id, return $t_bug_id; } + # -------------------- # allows bug deletion : # delete the bug, bugtext, bugnote, and bugtexts selected @@ -323,6 +361,7 @@ function bug_delete( $p_bug_id ) { # db_query() errors on failure so: return true; } + # -------------------- # Delete all bugs associated with a project function bug_delete_all( $p_project_id ) { @@ -349,14 +388,157 @@ function bug_delete_all( $p_project_id ) { return true; } + # -------------------- - function bug_update() { + # Update a bug from the given data structure + # If the third parameter is true, also update the longer strings table + function bug_update( $p_bug_id, $p_bug_data, $p_update_extended = false ) { + $c_bug_id = db_prepare_int( $p_bug_id ); + $c_bug_data = bug_clean( $p_bug_data ); + + $t_old_data = bug_get( $p_bug_id, true ); + + $t_bug_table = config_get( 'mantis_bug_table' ); + + # Update all fields + $query = "UPDATE $t_bug_table + SET project_id='$c_bug_data->project_id', + reporter_id='$c_bug_data->reporter_id', + handler_id='$c_bug_data->handler_id', + duplicate_id='$c_bug_data->duplicate_id', + priority='$c_bug_data->priority', + severity='$c_bug_data->severity', + reproducibility='$c_bug_data->reproducibility', + status='$c_bug_data->status', + resolution='$c_bug_data->resolution', + projection='$c_bug_data->projection', + category='$c_bug_data->category', + date_submitted='$c_bug_data->date_submitted', + last_updated='$c_bug_data->last_updated', + eta='$c_bug_data->eta', + os='$c_bug_data->os', + os_build='$c_bug_data->os_build', + platform='$c_bug_data->platform', + version='$c_bug_data->version', + build='$c_bug_data->build', + votes='$c_bug_data->votes', + view_state='$c_bug_data->view_state', + summary='$c_bug_data->summary' + WHERE id='$c_bug_id'"; + db_query($query); + + # log changes + history_log_event_direct( $p_bug_id, 'project_id', + $t_old_data->project_id, $p_bug_data->project_id ); + history_log_event_direct( $p_bug_id, 'reporter_id', + $t_old_data->reporter_id, $p_bug_data->reporter_id ); + history_log_event_direct( $p_bug_id, 'handler_id', + $t_old_data->handler_id, $p_bug_data->handler_id ); + history_log_event_direct( $p_bug_id, 'duplicate_id', + $t_old_data->duplicate_id, $p_bug_data->duplicate_id ); + history_log_event_direct( $p_bug_id, 'priority', + $t_old_data->priority, $p_bug_data->priority ); + history_log_event_direct( $p_bug_id, 'severity', + $t_old_data->severity, $p_bug_data->severity ); + history_log_event_direct( $p_bug_id, 'reproducibility', + $t_old_data->reproducibility, $p_bug_data->reproducibility ); + history_log_event_direct( $p_bug_id, 'status', + $t_old_data->status, $p_bug_data->status ); + history_log_event_direct( $p_bug_id, 'resolution', + $t_old_data->resolution, $p_bug_data->resolution ); + history_log_event_direct( $p_bug_id, 'projection', + $t_old_data->projection, $p_bug_data->projection ); + history_log_event_direct( $p_bug_id, 'category', + $t_old_data->category, $p_bug_data->category ); + history_log_event_direct( $p_bug_id, 'date_submitted', + $t_old_data->date_submitted, $p_bug_data->date_submitted ); + history_log_event_direct( $p_bug_id, 'last_updated', + $t_old_data->last_updated, $p_bug_data->last_updated ); + history_log_event_direct( $p_bug_id, 'eta', + $t_old_data->eta, $p_bug_data->eta ); + history_log_event_direct( $p_bug_id, 'os', + $t_old_data->os, $p_bug_data->os ); + history_log_event_direct( $p_bug_id, 'os_build', + $t_old_data->os_build, $p_bug_data->os_build ); + history_log_event_direct( $p_bug_id, 'platform', + $t_old_data->platform, $p_bug_data->platform ); + history_log_event_direct( $p_bug_id, 'version', + $t_old_data->version, $p_bug_data->version ); + history_log_event_direct( $p_bug_id, 'build', + $t_old_data->build, $p_bug_data->build ); + history_log_event_direct( $p_bug_id, 'votes', + $t_old_data->votes, $p_bug_data->votes ); + history_log_event_direct( $p_bug_id, 'view_state', + $t_old_data->view_state, $p_bug_data->view_state ); + history_log_event_direct( $p_bug_id, 'summary', + $t_old_data->summary, $p_bug_data->summary ); + + + # Update extended info if requested + if ( $p_update_extended ) { + $t_bug_text_table = config_get( 'mantis_bug_text_table' ); + + $t_bug_text_id = bug_get_field( $p_bug_id, 'bug_text_id' ); + + $query = "UPDATE $t_bug_text_table ". + "SET description='$c_bug_data->description', ". + "steps_to_reproduce='$c_bug_data->steps_to_reproduce', ". + "additional_information='$c_bug_data->additional_information' ". + "WHERE id='$t_bug_text_id'"; + db_query($query); + + if ( $t_old_data->description != $p_bug_data->description ) { + history_log_event_special( $p_bug_id, DESCRIPTION_UPDATED ); + } + if ( $t_old_data->steps_to_reproduce != $p_bug_data->steps_to_reproduce ) { + history_log_event_special( $p_bug_id, STEP_TO_REPRODUCE_UPDATED ); + } + if ( $t_old_data->additional_information != $p_bug_data->additional_information ) { + history_log_event_special( $p_bug_id, ADDITIONAL_INFO_UPDATED ); + } + } + + # Update the last update date + bug_update_date( $p_bug_id ); + + # If we should notify and it's in feedback state then send an email + switch ( $p_bug_data->status ) { + case NEW_: + # This will be used in the case where auto-assign = OFF, in this case the bug can be + # assigned/unassigned while the status is NEW. + # @@@ In case of unassigned, the e-mail will still say ASSIGNED, but it will be shown + # that the handler is empty + history ( old_handler => @null@ ). + if ( $p_bug_data->handler_id != $t_old_data->handler_id ) { + email_assign( $p_bug_id ); + } + break; + case FEEDBACK: + if ( $p_bug_data->status!= $t_old_data->status ) { + email_feedback( $p_bug_id ); + } + break; + case ASSIGNED: + if ( ( $p_bug_data->handler_id != $t_old_data->handler_id ) + || ( $p_bug_data->status != $t_old_data->status ) ) { + email_assign( $p_bug_id ); + } + break; + case RESOLVED: + email_resolved( $p_bug_id ); + break; + case CLOSED: + email_close( $p_bug_id ); + break; + } + + return true; } #=================================== # Data Access #=================================== + # -------------------- # Returns the extended record of the specified bug, this includes # the bug text fields # @@@ include reporter name and handler name, the problem is that @@ -369,11 +551,40 @@ function bug_get_extended_row( $p_bug_id ) { # merge $t_text first so that the 'id' key has the bug id not the bug text id return array_merge( $t_text, $t_base ); } + # -------------------- # Returns the record of the specified bug function bug_get_row( $p_bug_id ) { return bug_cache_row( $p_bug_id ); } + + # -------------------- + # Returns an object representing the specified bug + function bug_get( $p_bug_id, $p_get_extended = false ) { + if ( $p_get_extended ) { + $row = bug_get_extended_row( $p_bug_id ); + } else { + $row = bug_get_row( $p_bug_id ); + } + + $t_bug_data = new BugData; + + $t_row_keys = array_keys( $row ); + + $t_vars = get_object_vars( $t_bug_data ); + + # Check each variable in the class + foreach ( $t_vars as $var => $val ) { + # If we got a field from the DB with the same name + if ( in_array( $var, $t_row_keys ) ) { + # Store that value in the object + $t_bug_data->$var = $row[$var]; + } + } + + return $t_bug_data; + } + # -------------------- # return the specified field of the given bug # if the field does not exist, display a warning and return '' @@ -387,6 +598,7 @@ function bug_get_field( $p_bug_id, $p_field_name ) { return ''; } } + # -------------------- # return the specified text field of the given bug # if the field does not exist, display a warning and return '' @@ -400,6 +612,7 @@ function bug_get_text_field( $p_bug_id, $p_field_name ) { return ''; } } + # -------------------- # Returns the number of bugnotes for the given bug_id function bug_get_bugnote_count( $p_bug_id ) { @@ -422,6 +635,7 @@ function bug_get_bugnote_count( $p_bug_id ) { return db_result( $result ); } + # -------------------- # return the timestamp for the most recent time at which a bugnote # associated wiht the bug was modified @@ -476,6 +690,7 @@ function bug_set_field( $p_bug_id, $p_field_name, $p_status ) { return true; } + # -------------------- # assign the bug to the given user function bug_assign( $p_bug_id, $p_user_id, $p_bugnote_text='' ) { @@ -522,6 +737,7 @@ function bug_assign( $p_bug_id, $p_user_id, $p_bugnote_text='' ) { return true; } + # -------------------- # close the given bug function bug_close( $p_bug_id, $p_bugnote_text='' ) { @@ -538,6 +754,7 @@ function bug_close( $p_bug_id, $p_bugnote_text='' ) { return true; } + # -------------------- # resolve the given bug function bug_resolve( $p_bug_id, $p_resolution, $p_bugnote_text = '', $p_duplicate_id = null, $p_handler_id = null ) { @@ -564,6 +781,7 @@ function bug_resolve( $p_bug_id, $p_resolution, $p_bugnote_text = '', $p_duplica return true; } + # -------------------- # reopen the given bug function bug_reopen( $p_bug_id, $p_bugnote_text='' ) { @@ -581,6 +799,7 @@ function bug_reopen( $p_bug_id, $p_bugnote_text='' ) { return true; } + # -------------------- # updates the last_updated field function bug_update_date( $p_bug_id ) { @@ -597,7 +816,7 @@ function bug_update_date( $p_bug_id ) { } # -------------------- - # + # enable monitoring of this bug for the user function bug_monitor( $p_bug_id, $p_user_id ) { $c_bug_id = db_prepare_int( $p_bug_id ); $c_user_id = db_prepare_int( $p_user_id ); @@ -624,7 +843,7 @@ function bug_monitor( $p_bug_id, $p_user_id ) { } # -------------------- - # + # dsable monitoring of this bug for the user function bug_unmonitor( $p_bug_id, $p_user_id ) { $c_bug_id = db_prepare_int( $p_bug_id ); $c_user_id = db_prepare_int( $p_user_id ); @@ -642,4 +861,50 @@ function bug_unmonitor( $p_bug_id, $p_user_id ) { return true; } + + #=================================== + # Other + #=================================== + + # -------------------- + # Pads the bug id with the appropriate number of zeros. + function bug_format_id( $p_bug_id ) { + return( str_pad( $p_bug_id, 7, '0', STR_PAD_LEFT ) ); + } + + # -------------------- + # Return a copy of the bug structure with all the instvars prepared for db insertion + function bug_clean( $p_bug_data ) { + $c_bug_data = new BugData; + + $c_bug_data->project_id = db_prepare_int( $p_bug_data->project_id ); + $c_bug_data->reporter_id = db_prepare_int( $p_bug_data->reporter_id ); + $c_bug_data->handler_id = db_prepare_int( $p_bug_data->handler_id ); + $c_bug_data->duplicate_id = db_prepare_int( $p_bug_data->duplicate_id ); + $c_bug_data->priority = db_prepare_int( $p_bug_data->priority ); + $c_bug_data->severity = db_prepare_int( $p_bug_data->severity ); + $c_bug_data->reproducibility = db_prepare_int( $p_bug_data->reproducibility ); + $c_bug_data->status = db_prepare_int( $p_bug_data->status ); + $c_bug_data->resolution = db_prepare_int( $p_bug_data->resolution ); + $c_bug_data->projection = db_prepare_int( $p_bug_data->projection ); + $c_bug_data->category = db_prepare_string( $p_bug_data->category ); + $c_bug_data->date_submitted = db_prepare_string( $p_bug_data->date_submitted ); + $c_bug_data->last_updated = db_prepare_string( $p_bug_data->last_updated ); + $c_bug_data->eta = db_prepare_int( $p_bug_data->eta ); + $c_bug_data->os = db_prepare_string( $p_bug_data->os ); + $c_bug_data->os_build = db_prepare_string( $p_bug_data->os_build ); + $c_bug_data->platform = db_prepare_string( $p_bug_data->platform ); + $c_bug_data->version = db_prepare_string( $p_bug_data->version ); + $c_bug_data->build = db_prepare_string( $p_bug_data->build ); + $c_bug_data->votes = db_prepare_int( $p_bug_data->votes ); + $c_bug_data->view_state = db_prepare_int( $p_bug_data->view_state ); + $c_bug_data->summary = db_prepare_string( $p_bug_data->summary ); + + $c_bug_data->description = db_prepare_string( $p_bug_data->description ); + $c_bug_data->steps_to_reproduce = db_prepare_string( $p_bug_data->steps_to_reproduce ); + $c_bug_data->additional_information = db_prepare_string( $p_bug_data->additional_information ); + + return $c_bug_data; + } + ?>