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


PHP history_get_raw_events_array函数代码示例

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


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

示例1: timeline_events

/**
 * Get an array of timeline events
 * Events for which the skip() method returns true will be excluded
 * @param integer $p_start_time Timestamp representing start time of the period.
 * @param integer $p_end_time   Timestamp representing end time of the period.
 * @return array
 */
function timeline_events($p_start_time, $p_end_time)
{
    $t_issue_ids = timeline_get_affected_issues($p_start_time, $p_end_time);
    $t_timeline_events = array();
    foreach ($t_issue_ids as $t_issue_id) {
        $t_history_events_array = history_get_raw_events_array($t_issue_id, null, $p_start_time, $p_end_time);
        $t_history_events_array = array_reverse($t_history_events_array);
        foreach ($t_history_events_array as $t_history_event) {
            if ($t_history_event['date'] < $p_start_time || $t_history_event['date'] >= $p_end_time) {
                continue;
            }
            $t_event = null;
            $t_user_id = $t_history_event['userid'];
            $t_timestamp = $t_history_event['date'];
            switch ($t_history_event['type']) {
                case NEW_BUG:
                    $t_event = new IssueCreatedTimelineEvent($t_timestamp, $t_user_id, $t_issue_id);
                    break;
                case BUGNOTE_ADDED:
                    $t_bugnote_id = $t_history_event['old_value'];
                    $t_event = new IssueNoteCreatedTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_bugnote_id);
                    break;
                case BUG_MONITOR:
                    # Skip monitors added for others due to reminders, only add monitor events where added
                    # user is the same as the logged in user.
                    if ((int) $t_history_event['old_value'] == (int) $t_history_event['userid']) {
                        $t_event = new IssueMonitorTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, true);
                    }
                    break;
                case BUG_UNMONITOR:
                    $t_event = new IssueMonitorTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, false);
                    break;
                case TAG_ATTACHED:
                    $t_event = new IssueTagTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['old_value'], true);
                    break;
                case TAG_DETACHED:
                    $t_event = new IssueTagTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['old_value'], false);
                    break;
                case NORMAL_TYPE:
                    switch ($t_history_event['field']) {
                        case 'status':
                            $t_event = new IssueStatusChangeTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['old_value'], $t_history_event['new_value']);
                            break;
                        case 'handler_id':
                            $t_event = new IssueAssignedTimelineEvent($t_timestamp, $t_user_id, $t_issue_id, $t_history_event['new_value']);
                            break;
                    }
                    break;
            }
            # Do not include skipped events
            if ($t_event != null && !$t_event->skip()) {
                $t_timeline_events[] = $t_event;
            }
        }
    }
    return $t_timeline_events;
}
开发者ID:skbly7,项目名称:mantisbt,代码行数:64,代码来源:timeline_api.php

示例2: history_get_events_array

function history_get_events_array($p_bug_id, $p_user_id = null)
{
    $t_normal_date_format = config_get('normal_date_format');
    $raw_history = history_get_raw_events_array($p_bug_id, $p_user_id);
    $raw_history_count = count($raw_history);
    $history = array();
    for ($i = 0; $i < $raw_history_count; $i++) {
        $history[$i] = history_localize_item($raw_history[$i]['field'], $raw_history[$i]['type'], $raw_history[$i]['old_value'], $raw_history[$i]['new_value']);
        $history[$i]['date'] = date($t_normal_date_format, $raw_history[$i]['date']);
        $history[$i]['userid'] = $raw_history[$i]['userid'];
        $history[$i]['username'] = $raw_history[$i]['username'];
    }
    return $history;
}
开发者ID:renemilk,项目名称:spring-website,代码行数:14,代码来源:history_api.php

示例3: history_get_events_array

/**
 * Retrieves the history events for the specified bug id and returns it in an array
 * The array is indexed from 0 to N-1.  The second dimension is: 'date', 'username',
 * 'note', 'change'.
 * @param integer $p_bug_id  A valid bug identifier.
 * @param integer $p_user_id A valid user identifier.
 * @return array
 */
function history_get_events_array($p_bug_id, $p_user_id = null)
{
    $t_normal_date_format = config_get('normal_date_format');
    $t_raw_history = history_get_raw_events_array($p_bug_id, $p_user_id);
    $t_history = array();
    foreach ($t_raw_history as $k => $t_item) {
        extract($t_item, EXTR_PREFIX_ALL, 'v');
        $t_history[$k] = history_localize_item($v_field, $v_type, $v_old_value, $v_new_value);
        $t_history[$k]['date'] = date($t_normal_date_format, $v_date);
        $t_history[$k]['userid'] = $v_userid;
        $t_history[$k]['username'] = $v_username;
    }
    return $t_history;
}
开发者ID:gtn,项目名称:mantisbt,代码行数:22,代码来源:history_api.php

示例4: mc_issue_get_history

/**
* Get history details about an issue.
*
* @param string  $p_username The name of the user trying to access the issue.
* @param string  $p_password The password of the user.
* @param integer $p_issue_id The id of the issue to retrieve.
* @return array that represents a HistoryDataArray structure
*/
function mc_issue_get_history($p_username, $p_password, $p_issue_id)
{
    global $g_project_override;
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return mci_soap_fault_login_failed();
    }
    if (!bug_exists($p_issue_id)) {
        return SoapObjectsFactory::newSoapFault('Client', 'Issue does not exist');
    }
    $t_project_id = bug_get_field($p_issue_id, 'project_id');
    if (!mci_has_readonly_access($t_user_id, $t_project_id)) {
        return mci_soap_fault_access_denied($t_user_id);
    }
    $g_project_override = $t_project_id;
    if (!access_has_bug_level(config_get('view_bug_threshold', null, null, $t_project_id), $p_issue_id, $t_user_id)) {
        return mci_soap_fault_access_denied($t_user_id);
    }
    $t_user_access_level = user_get_access_level($t_user_id, $t_project_id);
    if (!access_compare_level($t_user_access_level, config_get('view_history_threshold'))) {
        return mci_soap_fault_access_denied($t_user_id);
    }
    log_event(LOG_WEBSERVICE, 'retrieving history for issue \'' . $p_issue_id . '\'');
    $t_bug_history = history_get_raw_events_array($p_issue_id, $t_user_id);
    return $t_bug_history;
}
开发者ID:elmarculino,项目名称:mantisbt,代码行数:34,代码来源:mc_issue_api.php

示例5: gantt_get_assigned_date

function gantt_get_assigned_date($p_bug_id)
{
    //TRY TO GET THE ASSIGNMENT DATE
    $t_history = history_get_raw_events_array($p_bug_id);
    foreach ($t_history as $t_item) {
        if ('handler_id' == $t_item['field']) {
            // Use the date of the first assignment date if any found:
            return $t_item['date'];
        }
    }
    //END OF GETTING ASSIGNMENT DATE
    return null;
}
开发者ID:martijnveen,项目名称:GanttChart,代码行数:13,代码来源:gantt_api.php


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