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


PHP string_custom_field_value_for_email函数代码示例

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


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

示例1: history_localize_item


//.........这里部分代码省略.........
        case 'os_build':
            $t_field_localized = lang_get('os_version');
            break;
        case 'build':
            $t_field_localized = lang_get('build');
            break;
        case 'platform':
            $t_field_localized = lang_get('platform');
            break;
        case 'summary':
            $t_field_localized = lang_get('summary');
            break;
        case 'duplicate_id':
            $t_field_localized = lang_get('duplicate_id');
            break;
        case 'sponsorship_total':
            $t_field_localized = lang_get('sponsorship_total');
            break;
        case 'due_date':
            if ($p_old_value !== '') {
                $p_old_value = date(config_get('normal_date_format'), (int) $p_old_value);
            }
            if ($p_new_value !== '') {
                $p_new_value = date(config_get('normal_date_format'), (int) $p_new_value);
            }
            $t_field_localized = lang_get('due_date');
            break;
        default:
            # assume it's a custom field name
            $t_field_id = custom_field_get_id_from_name($p_field_name);
            if (false !== $t_field_id) {
                $t_cf_type = custom_field_type($t_field_id);
                if ('' != $p_old_value) {
                    $p_old_value = string_custom_field_value_for_email($p_old_value, $t_cf_type);
                }
                $p_new_value = string_custom_field_value_for_email($p_new_value, $t_cf_type);
                $t_field_localized = lang_get_defaulted($p_field_name);
            }
    }
    if (NORMAL_TYPE != $p_type) {
        switch ($p_type) {
            case NEW_BUG:
                $t_note = lang_get('new_bug');
                break;
            case BUGNOTE_ADDED:
                $t_note = lang_get('bugnote_added') . ': ' . $p_old_value;
                break;
            case BUGNOTE_UPDATED:
                $t_note = lang_get('bugnote_edited') . ': ' . $p_old_value;
                $t_old_value = (int) $p_old_value;
                $t_new_value = (int) $p_new_value;
                if ($p_linkify && bug_revision_exists($t_new_value)) {
                    if (bugnote_exists($t_old_value)) {
                        $t_bug_revision_view_page_argument = 'bugnote_id=' . $t_old_value . '#r' . $t_new_value;
                    } else {
                        $t_bug_revision_view_page_argument = 'rev_id=' . $t_new_value;
                    }
                    $t_change = '<a href="bug_revision_view_page.php?' . $t_bug_revision_view_page_argument . '">' . lang_get('view_revisions') . '</a>';
                    $t_raw = false;
                }
                break;
            case BUGNOTE_DELETED:
                $t_note = lang_get('bugnote_deleted') . ': ' . $p_old_value;
                break;
            case DESCRIPTION_UPDATED:
                $t_note = lang_get('description_updated');
开发者ID:gtn,项目名称:mantisbt,代码行数:67,代码来源:history_api.php

示例2: history_localize_item


//.........这里部分代码省略.........
            } else {
                $p_old_value = user_get_name($p_old_value);
            }
            if (0 == $p_new_value) {
                $p_new_value = '';
            } else {
                $p_new_value = user_get_name($p_new_value);
            }
            break;
        case 'fixed_in_version':
            $t_field_localized = lang_get('fixed_in_version');
            break;
        case 'date_submitted':
            $t_field_localized = lang_get('date_submitted');
            break;
        case 'last_updated':
            $t_field_localized = lang_get('last_update');
            break;
        case 'summary':
            $t_field_localized = lang_get('summary');
            break;
        case 'duplicate_id':
            $t_field_localized = lang_get('duplicate_id');
            break;
        case 'sponsorship_total':
            $t_field_localized = lang_get('sponsorship_total');
            break;
        default:
            # assume it's a custom field name
            $t_field_id = custom_field_get_id_from_name($p_field_name);
            if (false !== $t_field_id) {
                $t_cf_type = custom_field_type($t_field_id);
                if ('' != $p_old_value) {
                    $p_old_value = string_custom_field_value_for_email($p_old_value, $t_cf_type);
                }
                $p_new_value = string_custom_field_value_for_email($p_new_value, $t_cf_type);
            }
    }
    if (NORMAL_TYPE != $p_type) {
        switch ($p_type) {
            case NEW_BUG:
                $t_note = lang_get('new_bug');
                break;
            case BUGNOTE_ADDED:
                $t_note = lang_get('bugnote_added') . ": " . $p_old_value;
                break;
            case BUGNOTE_UPDATED:
                $t_note = lang_get('bugnote_edited') . ": " . $p_old_value;
                break;
            case BUGNOTE_DELETED:
                $t_note = lang_get('bugnote_deleted') . ": " . $p_old_value;
                break;
            case DESCRIPTION_UPDATED:
                $t_note = lang_get('description_updated');
                break;
            case ADDITIONAL_INFO_UPDATED:
                $t_note = lang_get('additional_information_updated');
                break;
            case STEP_TO_REPRODUCE_UPDATED:
                $t_note = lang_get('steps_to_reproduce_updated');
                break;
            case FILE_ADDED:
                $t_note = lang_get('file_added') . ": " . $p_old_value;
                break;
            case FILE_DELETED:
                $t_note = lang_get('file_deleted') . ": " . $p_old_value;
开发者ID:centaurustech,项目名称:BenFund,代码行数:67,代码来源: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


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