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


PHP history_localize_item函数代码示例

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


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

示例1: 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

示例2: 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

示例3: email_format_bug_message

function email_format_bug_message($p_visible_bug_data)
{
    $t_normal_date_format = config_get('normal_date_format');
    $t_complete_date_format = config_get('complete_date_format');
    $t_email_separator1 = config_get('email_separator1');
    $t_email_separator2 = config_get('email_separator2');
    $t_email_padding_length = config_get('email_padding_length');
    $t_status = $p_visible_bug_data['email_status'];
    $p_visible_bug_data['email_date_submitted'] = date($t_complete_date_format, $p_visible_bug_data['email_date_submitted']);
    $p_visible_bug_data['email_last_modified'] = date($t_complete_date_format, $p_visible_bug_data['email_last_modified']);
    $p_visible_bug_data['email_status'] = get_enum_element('status', $t_status);
    $p_visible_bug_data['email_severity'] = get_enum_element('severity', $p_visible_bug_data['email_severity']);
    $p_visible_bug_data['email_priority'] = get_enum_element('priority', $p_visible_bug_data['email_priority']);
    $p_visible_bug_data['email_reproducibility'] = get_enum_element('reproducibility', $p_visible_bug_data['email_reproducibility']);
    $t_message = $t_email_separator1 . " \n";
    if (isset($p_visible_bug_data['email_bug_view_url'])) {
        $t_message .= $p_visible_bug_data['email_bug_view_url'] . " \n";
        $t_message .= $t_email_separator1 . " \n";
    }
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_reporter');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_handler');
    $t_message .= $t_email_separator1 . " \n";
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_project');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_bug');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_category');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_reproducibility');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_severity');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_priority');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_status');
    # custom fields formatting
    foreach ($p_visible_bug_data['custom_fields'] as $t_custom_field_name => $t_custom_field_data) {
        $t_message .= str_pad(lang_get_defaulted($t_custom_field_name, null) . ': ', $t_email_padding_length, ' ', STR_PAD_RIGHT);
        $t_message .= string_custom_field_value_for_email($t_custom_field_data['value'], $t_custom_field_data['type']);
        $t_message .= " \n";
    }
    # end foreach custom field
    if (config_get('bug_resolved_status_threshold') <= $t_status) {
        $p_visible_bug_data['email_resolution'] = get_enum_element('resolution', $p_visible_bug_data['email_resolution']);
        $t_message .= email_format_attribute($p_visible_bug_data, 'email_resolution');
        $t_message .= email_format_attribute($p_visible_bug_data, 'email_duplicate');
        $t_message .= email_format_attribute($p_visible_bug_data, 'email_fixed_in_version');
    }
    $t_message .= $t_email_separator1 . " \n";
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_date_submitted');
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_last_modified');
    $t_message .= $t_email_separator1 . " \n";
    $t_message .= email_format_attribute($p_visible_bug_data, 'email_summary');
    $t_message .= lang_get('email_description') . ": \n" . wordwrap($p_visible_bug_data['email_description']) . "\n";
    # MASC RELATIONSHIP
    if (ON == config_get('enable_relationship')) {
        if (isset($p_visible_bug_data['relations'])) {
            $t_message .= $p_visible_bug_data['relations'];
        }
    }
    # MASC RELATIONSHIP
    # Sponsorship
    if (isset($p_visible_bug_data['sponsorship_total']) && $p_visible_bug_data['sponsorship_total'] > 0) {
        $t_message .= $t_email_separator1 . " \n";
        $t_message .= sprintf(lang_get('total_sponsorship_amount'), sponsorship_format_amount($p_visible_bug_data['sponsorship_total'])) . "\n" . "\n";
        if (isset($p_visible_bug_data['sponsorships'])) {
            foreach ($p_visible_bug_data['sponsorships'] as $t_sponsorship) {
                $t_date_added = date(config_get('normal_date_format'), $t_sponsorship->date_submitted);
                $t_message .= $t_date_added . ': ';
                $t_message .= user_get_name($t_sponsorship->user_id);
                $t_message .= ' (' . sponsorship_format_amount($t_sponsorship->amount) . ')' . " \n";
            }
        }
    }
    $t_message .= $t_email_separator1 . " \n\n";
    # format bugnotes
    foreach ($p_visible_bug_data['bugnotes'] as $t_bugnote) {
        $t_last_modified = date($t_normal_date_format, $t_bugnote->last_modified);
        $t_string = ' ' . user_get_name($t_bugnote->reporter_id) . ' - ' . $t_last_modified . ' ';
        $t_message .= $t_email_separator2 . " \n";
        $t_message .= $t_string . " \n";
        $t_message .= $t_email_separator2 . " \n";
        $t_message .= wordwrap($t_bugnote->note) . " \n\n";
    }
    # format history
    if (array_key_exists('history', $p_visible_bug_data)) {
        $t_message .= lang_get('bug_history') . " \n";
        $t_message .= str_pad(lang_get('date_modified'), 16) . str_pad(lang_get('username'), 15) . str_pad(lang_get('field'), 25) . str_pad(lang_get('change'), 20) . " \n";
        $t_message .= $t_email_separator1 . " \n";
        foreach ($p_visible_bug_data['history'] as $t_raw_history_item) {
            $t_localized_item = history_localize_item($t_raw_history_item['field'], $t_raw_history_item['type'], $t_raw_history_item['old_value'], $t_raw_history_item['new_value']);
            $t_message .= str_pad(date($t_normal_date_format, $t_raw_history_item['date']), 16) . str_pad($t_raw_history_item['username'], 15) . str_pad($t_localized_item['note'], 25) . str_pad($t_localized_item['change'], 20) . "\n";
        }
        $t_message .= $t_email_separator1 . " \n\n";
    }
    return $t_message;
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:91,代码来源:email_api.php


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