当前位置: 首页>>代码示例>>PHP>>正文


PHP bug_revision_count函数代码示例

本文整理汇总了PHP中bug_revision_count函数的典型用法代码示例。如果您正苦于以下问题:PHP bug_revision_count函数的具体用法?PHP bug_revision_count怎么用?PHP bug_revision_count使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bug_revision_count函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lang_get

		<span class="small bugnote-view-state">[ <?php 
        echo lang_get('private');
        ?>
 ]</span>
		<?php 
    }
    ?>
		<br />
		<span class="small bugnote-date-submitted"><?php 
    echo date($t_normal_date_format, $t_bugnote->date_submitted);
    ?>
</span><br />
		<?php 
    if ($t_bugnote_modified) {
        echo '<span class="small bugnote-last-modified">' . lang_get('last_edited') . lang_get('word_separator') . date($t_normal_date_format, $t_bugnote->last_modified) . '</span><br />';
        $t_revision_count = bug_revision_count($f_bug_id, REV_BUGNOTE, $t_bugnote->id);
        if ($t_revision_count >= 1) {
            $t_view_num_revisions_text = sprintf(lang_get('view_num_revisions'), $t_revision_count);
            echo '<span class="small bugnote-revisions-link"><a href="bug_revision_view_page.php?bugnote_id=' . $t_bugnote->id . '">' . $t_view_num_revisions_text . '</a></span><br />';
        }
    }
    ?>
		<br /><div class="small bugnote-buttons">
		<?php 
    # bug must be open to be editable
    if (!bug_is_readonly($f_bug_id)) {
        # check if the user can edit this bugnote
        if ($t_user_id == $t_bugnote->reporter_id) {
            $t_can_edit_bugnote = access_has_bugnote_level($t_bugnote_user_edit_threshold, $t_bugnote->id);
        } else {
            $t_can_edit_bugnote = $t_can_edit_all_bugnotes;
开发者ID:nextgens,项目名称:mantisbt,代码行数:31,代码来源:bugnote_view_inc.php

示例2: update

 /**
  * 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
//.........这里部分代码省略.........
开发者ID:rahmanjis,项目名称:dipstart-development,代码行数:101,代码来源:bug_api.php

示例3: bugnote_set_text

/**
 * Set the bugnote text
 * @param int $p_bugnote_id bugnote id
 * @param string $p_bugnote_text bugnote text
 * @return bool
 * @access public
 */
function bugnote_set_text($p_bugnote_id, $p_bugnote_text)
{
    $t_old_text = bugnote_get_text($p_bugnote_id);
    if ($t_old_text == $p_bugnote_text) {
        return true;
    }
    $t_bug_id = bugnote_get_field($p_bugnote_id, 'bug_id');
    $t_bugnote_text_id = bugnote_get_field($p_bugnote_id, 'bugnote_text_id');
    $t_bugnote_text_table = db_get_table('mantis_bugnote_text_table');
    # insert an 'original' revision if needed
    if (bug_revision_count($t_bug_id, REV_BUGNOTE, $p_bugnote_id) < 1) {
        $t_user_id = bugnote_get_field($p_bugnote_id, 'reporter_id');
        $t_timestamp = bugnote_get_field($p_bugnote_id, 'last_modified');
        bug_revision_add($t_bug_id, $t_user_id, REV_BUGNOTE, $t_old_text, $p_bugnote_id, $t_timestamp);
    }
    $query = "UPDATE {$t_bugnote_text_table}\n\t\t\tSET note=" . db_param() . " WHERE id=" . db_param();
    db_query_bound($query, array($p_bugnote_text, $t_bugnote_text_id));
    # updated the last_updated date
    bugnote_date_update($p_bugnote_id);
    bug_update_date($t_bug_id);
    # insert a new revision
    $t_user_id = auth_get_current_user_id();
    $t_revision_id = bug_revision_add($t_bug_id, $t_user_id, REV_BUGNOTE, $p_bugnote_text, $p_bugnote_id);
    # log new bugnote
    history_log_event_special($t_bug_id, BUGNOTE_UPDATED, bugnote_format_id($p_bugnote_id), $t_revision_id);
    return true;
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:34,代码来源:bugnote_api.php

示例4: bugnote_set_text

/**
 * Set the bugnote text
 * @param integer $p_bugnote_id   A bugnote identifier.
 * @param string  $p_bugnote_text The bugnote text to set.
 * @return boolean
 * @access public
 */
function bugnote_set_text($p_bugnote_id, $p_bugnote_text)
{
    $t_old_text = bugnote_get_text($p_bugnote_id);
    if ($t_old_text == $p_bugnote_text) {
        return true;
    }
    # MySQL 4-bytes UTF-8 chars workaround #21101
    $p_bugnote_text = db_mysql_fix_utf8($p_bugnote_text);
    $t_bug_id = bugnote_get_field($p_bugnote_id, 'bug_id');
    $t_bugnote_text_id = bugnote_get_field($p_bugnote_id, 'bugnote_text_id');
    # insert an 'original' revision if needed
    if (bug_revision_count($t_bug_id, REV_BUGNOTE, $p_bugnote_id) < 1) {
        $t_user_id = bugnote_get_field($p_bugnote_id, 'reporter_id');
        $t_timestamp = bugnote_get_field($p_bugnote_id, 'last_modified');
        bug_revision_add($t_bug_id, $t_user_id, REV_BUGNOTE, $t_old_text, $p_bugnote_id, $t_timestamp);
    }
    db_param_push();
    $t_query = 'UPDATE {bugnote_text} SET note=' . db_param() . ' WHERE id=' . db_param();
    db_query($t_query, array($p_bugnote_text, $t_bugnote_text_id));
    # updated the last_updated date
    bugnote_date_update($p_bugnote_id);
    bug_update_date($t_bug_id);
    # insert a new revision
    $t_user_id = auth_get_current_user_id();
    $t_revision_id = bug_revision_add($t_bug_id, $t_user_id, REV_BUGNOTE, $p_bugnote_text, $p_bugnote_id);
    # log new bugnote
    history_log_event_special($t_bug_id, BUGNOTE_UPDATED, bugnote_format_id($p_bugnote_id), $t_revision_id);
    return true;
}
开发者ID:spring,项目名称:spring-website,代码行数:36,代码来源:bugnote_api.php


注:本文中的bug_revision_count函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。