$t_lang_bug_notes_title = lang_get('bug_notes_title');
$t_lang_system_profile = lang_get('system_profile');
$t_lang_attached_files = lang_get('attached_files');
$t_lang_tags = lang_get('tags');
$t_fields = config_get('bug_view_page_fields');
$t_fields = columns_filter_disabled($t_fields);
$t_show_tags = in_array('tags', $t_fields) && access_has_global_level(config_get('tag_view_threshold'));
$t_current_user_id = auth_get_current_user_id();
$t_user_bugnote_order = user_pref_get_pref($t_current_user_id, 'bugnote_order');
for ($j = 0; $j < $t_row_count; $j++) {
    $t_bug = $t_result[$j];
    $t_id = $t_bug->id;
    if ($j % 50 == 0) {
        # to save ram as report will list data once, clear cache after 50 bugs
        bug_text_clear_cache();
        bug_clear_cache();
        bugnote_clear_cache();
    }
    # display the available and selected bugs
    if (in_array($t_id, $f_bug_arr) || !$f_show_flag) {
        if ($t_count_exported > 0) {
            echo '<br style="mso-special-character: line-break; page-break-before: always" />';
        }
        $t_count_exported++;
        $t_last_updated = date($g_short_date_format, $t_bug->last_updated);
        # grab the project name
        $t_project_name = project_get_field($t_bug->project_id, 'name');
        $t_category_name = category_full_name($t_bug->category_id, false);
        ?>
<br />
<table class="width100" cellspacing="1">
Exemplo n.º 2
0
 /**
  * Update a bug from the given data structure
  *  If the third parameter is true, also update the longer strings table
  * @param bool p_update_extended
  * @param bool p_bypass_email Default false, set to true to avoid generating emails (if sending elsewhere)
  * @return bool (always true)
  * @access public
  */
 function update($p_update_extended = false, $p_bypass_mail = false)
 {
     self::validate($p_update_extended);
     $c_bug_id = $this->id;
     if (is_blank($this->due_date)) {
         $this->due_date = date_get_null();
     }
     $t_old_data = bug_get($this->id, true);
     $t_bug_table = db_get_table('mantis_bug_table');
     # Update all fields
     # Ignore date_submitted and last_updated since they are pulled out
     #  as unix timestamps which could confuse the history log and they
     #  shouldn't get updated like this anyway.  If you really need to change
     #  them use bug_set_field()
     $query = "UPDATE {$t_bug_table}\n\t\t\t\t\tSET project_id=" . db_param() . ', reporter_id=' . db_param() . ",\n\t\t\t\t\t\thandler_id=" . db_param() . ', duplicate_id=' . db_param() . ",\n\t\t\t\t\t\tpriority=" . db_param() . ', severity=' . db_param() . ",\n\t\t\t\t\t\treproducibility=" . db_param() . ', status=' . db_param() . ",\n\t\t\t\t\t\tresolution=" . db_param() . ', projection=' . db_param() . ",\n\t\t\t\t\t\tcategory_id=" . db_param() . ', eta=' . db_param() . ",\n\t\t\t\t\t\tos=" . db_param() . ', os_build=' . db_param() . ",\n\t\t\t\t\t\tplatform=" . db_param() . ', version=' . db_param() . ",\n\t\t\t\t\t\tbuild=" . db_param() . ', fixed_in_version=' . db_param() . ',';
     $t_fields = array($this->project_id, $this->reporter_id, $this->handler_id, $this->duplicate_id, $this->priority, $this->severity, $this->reproducibility, $this->status, $this->resolution, $this->projection, $this->category_id, $this->eta, $this->os, $this->os_build, $this->platform, $this->version, $this->build, $this->fixed_in_version);
     $t_roadmap_updated = false;
     if (access_has_project_level(config_get('roadmap_update_threshold'))) {
         $query .= "\n\t\t\t\t\t\ttarget_version=" . db_param() . ",";
         $t_fields[] = $this->target_version;
         $t_roadmap_updated = true;
     }
     $query .= "\n\t\t\t\t\t\tview_state=" . db_param() . ",\n\t\t\t\t\t\tsummary=" . db_param() . ",\n\t\t\t\t\t\tsponsorship_total=" . db_param() . ",\n\t\t\t\t\t\tsticky=" . db_param() . ",\n\t\t\t\t\t\tdue_date=" . db_param() . "\n\t\t\t\t\tWHERE id=" . db_param();
     $t_fields[] = $this->view_state;
     $t_fields[] = $this->summary;
     $t_fields[] = $this->sponsorship_total;
     $t_fields[] = (bool) $this->sticky;
     $t_fields[] = $this->due_date;
     $t_fields[] = $this->id;
     db_query_bound($query, $t_fields);
     bug_clear_cache($this->id);
     # log changes
     history_log_event_direct($c_bug_id, 'project_id', $t_old_data->project_id, $this->project_id);
     history_log_event_direct($c_bug_id, 'reporter_id', $t_old_data->reporter_id, $this->reporter_id);
     history_log_event_direct($c_bug_id, 'handler_id', $t_old_data->handler_id, $this->handler_id);
     history_log_event_direct($c_bug_id, 'priority', $t_old_data->priority, $this->priority);
     history_log_event_direct($c_bug_id, 'severity', $t_old_data->severity, $this->severity);
     history_log_event_direct($c_bug_id, 'reproducibility', $t_old_data->reproducibility, $this->reproducibility);
     history_log_event_direct($c_bug_id, 'status', $t_old_data->status, $this->status);
     history_log_event_direct($c_bug_id, 'resolution', $t_old_data->resolution, $this->resolution);
     history_log_event_direct($c_bug_id, 'projection', $t_old_data->projection, $this->projection);
     history_log_event_direct($c_bug_id, 'category', category_full_name($t_old_data->category_id, false), category_full_name($this->category_id, false));
     history_log_event_direct($c_bug_id, 'eta', $t_old_data->eta, $this->eta);
     history_log_event_direct($c_bug_id, 'os', $t_old_data->os, $this->os);
     history_log_event_direct($c_bug_id, 'os_build', $t_old_data->os_build, $this->os_build);
     history_log_event_direct($c_bug_id, 'platform', $t_old_data->platform, $this->platform);
     history_log_event_direct($c_bug_id, 'version', $t_old_data->version, $this->version);
     history_log_event_direct($c_bug_id, 'build', $t_old_data->build, $this->build);
     history_log_event_direct($c_bug_id, 'fixed_in_version', $t_old_data->fixed_in_version, $this->fixed_in_version);
     if ($t_roadmap_updated) {
         history_log_event_direct($c_bug_id, 'target_version', $t_old_data->target_version, $this->target_version);
     }
     history_log_event_direct($c_bug_id, 'view_state', $t_old_data->view_state, $this->view_state);
     history_log_event_direct($c_bug_id, 'summary', $t_old_data->summary, $this->summary);
     history_log_event_direct($c_bug_id, 'sponsorship_total', $t_old_data->sponsorship_total, $this->sponsorship_total);
     history_log_event_direct($c_bug_id, 'sticky', $t_old_data->sticky, $this->sticky);
     history_log_event_direct($c_bug_id, 'due_date', $t_old_data->due_date != date_get_null() ? $t_old_data->due_date : null, $this->due_date != date_get_null() ? $this->due_date : null);
     # Update extended info if requested
     if ($p_update_extended) {
         $t_bug_text_table = db_get_table('mantis_bug_text_table');
         $t_bug_text_id = bug_get_field($c_bug_id, 'bug_text_id');
         $query = "UPDATE {$t_bug_text_table}\n\t\t\t\t\t\t\tSET description=" . db_param() . ",\n\t\t\t\t\t\t\t\tsteps_to_reproduce=" . db_param() . ",\n\t\t\t\t\t\t\t\tadditional_information=" . db_param() . "\n\t\t\t\t\t\t\tWHERE id=" . db_param();
         db_query_bound($query, array($this->description, $this->steps_to_reproduce, $this->additional_information, $t_bug_text_id));
         bug_text_clear_cache($c_bug_id);
         $t_current_user = auth_get_current_user_id();
         if ($t_old_data->description != $this->description) {
             if (bug_revision_count($c_bug_id, REV_DESCRIPTION) < 1) {
                 $t_revision_id = bug_revision_add($c_bug_id, $t_old_data->reporter_id, REV_DESCRIPTION, $t_old_data->description, 0, $t_old_data->date_submitted);
             }
             $t_revision_id = bug_revision_add($c_bug_id, $t_current_user, REV_DESCRIPTION, $this->description);
             history_log_event_special($c_bug_id, DESCRIPTION_UPDATED, $t_revision_id);
         }
         if ($t_old_data->steps_to_reproduce != $this->steps_to_reproduce) {
             if (bug_revision_count($c_bug_id, REV_STEPS_TO_REPRODUCE) < 1) {
                 $t_revision_id = bug_revision_add($c_bug_id, $t_old_data->reporter_id, REV_STEPS_TO_REPRODUCE, $t_old_data->steps_to_reproduce, 0, $t_old_data->date_submitted);
             }
             $t_revision_id = bug_revision_add($c_bug_id, $t_current_user, REV_STEPS_TO_REPRODUCE, $this->steps_to_reproduce);
             history_log_event_special($c_bug_id, STEP_TO_REPRODUCE_UPDATED, $t_revision_id);
         }
         if ($t_old_data->additional_information != $this->additional_information) {
             if (bug_revision_count($c_bug_id, REV_ADDITIONAL_INFO) < 1) {
                 $t_revision_id = bug_revision_add($c_bug_id, $t_old_data->reporter_id, REV_ADDITIONAL_INFO, $t_old_data->additional_information, 0, $t_old_data->date_submitted);
             }
             $t_revision_id = bug_revision_add($c_bug_id, $t_current_user, REV_ADDITIONAL_INFO, $this->additional_information);
             history_log_event_special($c_bug_id, ADDITIONAL_INFO_UPDATED, $t_revision_id);
         }
     }
     # Update the last update date
     bug_update_date($c_bug_id);
     # allow bypass if user is sending mail separately
     if (false == $p_bypass_mail) {
         # bug assigned
         if ($t_old_data->handler_id != $this->handler_id) {
             email_generic($c_bug_id, 'owner', 'email_notification_title_for_action_bug_assigned');
             return true;
         }
         # status changed
         if ($t_old_data->status != $this->status) {
             $t_status = MantisEnum::getLabel(config_get('status_enum_string'), $this->status);
             $t_status = str_replace(' ', '_', $t_status);
             email_generic($c_bug_id, $t_status, 'email_notification_title_for_status_bug_' . $t_status);
             return true;
         }
         # @todo handle priority change if it requires special handling
         # generic update notification
         email_generic($c_bug_id, 'updated', 'email_notification_title_for_action_bug_updated');
     }
     return true;
 }
Exemplo n.º 3
0
function bug_update_date($p_bug_id)
{
    $c_bug_id = db_prepare_int($p_bug_id);
    $t_bug_table = config_get('mantis_bug_table');
    $query = "UPDATE {$t_bug_table}\n\t\t\t\t  SET last_updated= " . db_now() . "\n\t\t\t\t  WHERE id='{$c_bug_id}'";
    db_query($query);
    bug_clear_cache($p_bug_id);
    return true;
}