本文整理汇总了PHP中prepare_version_string函数的典型用法代码示例。如果您正苦于以下问题:PHP prepare_version_string函数的具体用法?PHP prepare_version_string怎么用?PHP prepare_version_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prepare_version_string函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_version_option_list
function print_version_option_list($p_version = '', $p_project_id = null, $p_released = null, $p_leading_blank = true, $p_with_subs = false)
{
if (null === $p_project_id) {
$c_project_id = helper_get_current_project();
} else {
$c_project_id = db_prepare_int($p_project_id);
}
if ($p_with_subs) {
$versions = version_get_all_rows_with_subs($c_project_id, $p_released, null);
} else {
$versions = version_get_all_rows($c_project_id, $p_released, null);
}
# Ensure the selected version (if specified) is included in the list
# Note: Filter API specifies selected versions as an array
if (!is_array($p_version)) {
if (!empty($p_version)) {
$t_version_id = version_get_id($p_version, $c_project_id);
if ($t_version_id !== false) {
$versions[] = version_cache_row($t_version_id);
}
}
}
if ($p_leading_blank) {
echo '<option value=""></option>';
}
$t_listed = array();
$t_max_length = config_get('max_dropdown_length');
$t_show_version_dates = access_has_project_level(config_get('show_version_dates_threshold'));
$t_short_date_format = config_get('short_date_format');
foreach ($versions as $version) {
# If the current version is obsolete, and current version not equal to $p_version,
# then skip it.
if ((int) $version['obsolete'] == 1) {
if ($version['version'] != $p_version) {
continue;
}
}
$t_version = string_attribute($version['version']);
if (!in_array($t_version, $t_listed)) {
$t_listed[] = $t_version;
echo '<option value="' . $t_version . '"';
check_selected($p_version, $version['version']);
$t_version_string = string_attribute(prepare_version_string($c_project_id, $version['id']));
echo '>', string_shorten($t_version_string, $t_max_length), '</option>';
}
}
}
示例2: in_array
$tpl_show_product_build = $tpl_show_versions && in_array('product_build', $t_fields) && config_get('enable_product_build') == ON;
$tpl_product_build = $tpl_show_product_build ? string_display_line($tpl_bug->build) : '';
$tpl_show_target_version = $tpl_show_versions && in_array('target_version', $t_fields) && access_has_bug_level(config_get('roadmap_view_threshold'), $f_bug_id);
$tpl_product_version_string = '';
$tpl_target_version_string = '';
$tpl_fixed_in_version_string = '';
if ($tpl_show_product_version || $tpl_show_fixed_in_version || $tpl_show_target_version) {
$t_version_rows = version_get_all_rows($tpl_bug->project_id);
if ($tpl_show_product_version) {
$tpl_product_version_string = prepare_version_string($tpl_bug->project_id, version_get_id($tpl_bug->version, $tpl_bug->project_id), $t_version_rows);
}
if ($tpl_show_target_version) {
$tpl_target_version_string = prepare_version_string($tpl_bug->project_id, version_get_id($tpl_bug->target_version, $tpl_bug->project_id), $t_version_rows);
}
if ($tpl_show_fixed_in_version) {
$tpl_fixed_in_version_string = prepare_version_string($tpl_bug->project_id, version_get_id($tpl_bug->fixed_in_version, $tpl_bug->project_id), $t_version_rows);
}
}
$tpl_product_version_string = string_display_line($tpl_product_version_string);
$tpl_target_version_string = string_display_line($tpl_target_version_string);
$tpl_fixed_in_version_string = string_display_line($tpl_fixed_in_version_string);
$tpl_bug_id = $f_bug_id;
$tpl_form_title = lang_get('bug_view_title');
$tpl_wiki_link = config_get_global('wiki_enable') == ON ? 'wiki.php?id=' . $f_bug_id : '';
if (access_has_bug_level(config_get('view_history_threshold'), $f_bug_id)) {
$tpl_history_link = "view.php?id={$f_bug_id}&history=1#history";
} else {
$tpl_history_link = '';
}
$tpl_show_reminder_link = !current_user_is_anonymous() && !bug_is_readonly($f_bug_id) && access_has_bug_level(config_get('bug_reminder_threshold'), $f_bug_id);
$tpl_bug_reminder_link = 'bug_reminder_page.php?bug_id=' . $f_bug_id;
示例3: string_display_line
$t_eta = string_display_line(get_enum_element('eta', $t_bug->eta));
$t_summary = string_display_line_links(bug_format_summary($f_bug_id, SUMMARY_FIELD));
$t_description = string_display_links($t_bug->description);
$t_steps_to_reproduce = string_display_links($t_bug->steps_to_reproduce);
$t_additional_information = string_display_links($t_bug->additional_information);
$t_view_state = $t_show_view_state ? get_enum_element('view_state', $t_bug->view_state) : '';
if ($t_show_due_date) {
if (!date_is_null($t_bug->due_date)) {
$t_due_date = date(config_get('normal_date_format'), $t_bug->due_date);
} else {
$t_due_date = '';
}
}
$t_product_version = $t_show_product_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->version, $t_bug->project_id))) : '';
$t_target_version = $t_show_target_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->target_version, $t_bug->project_id))) : '';
$t_fixed_in_version = $t_show_fixed_in_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->fixed_in_version, $t_bug->project_id))) : '';
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_head_end();
html_body_begin();
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<tr>';
echo '<td class="form-title" colspan="6">';
echo '<div class="center">', $t_window_title;
if (!is_blank($t_project_name)) {
echo ' - ' . $t_project_name;
}
echo '</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="form-title" colspan="6">', lang_get('bug_view_title'), '</td>';
示例4: in_array
$t_show_product_build = $t_show_versions && in_array('product_build', $t_fields) && config_get('enable_product_build') == ON;
$t_product_build = $t_show_product_build ? string_display_line($t_bug->build) : '';
$t_show_target_version = $t_show_versions && in_array('target_version', $t_fields) && access_has_bug_level(config_get('roadmap_view_threshold'), $f_bug_id);
$t_product_version_string = '';
$t_target_version_string = '';
$t_fixed_in_version_string = '';
if ($t_show_product_version || $t_show_fixed_in_version || $t_show_target_version) {
$t_version_rows = version_get_all_rows($t_bug->project_id);
if ($t_show_product_version) {
$t_product_version_string = prepare_version_string($t_bug->project_id, version_get_id($t_bug->version, $t_bug->project_id));
}
if ($t_show_target_version) {
$t_target_version_string = prepare_version_string($t_bug->project_id, version_get_id($t_bug->target_version, $t_bug->project_id));
}
if ($t_show_fixed_in_version) {
$t_fixed_in_version_string = prepare_version_string($t_bug->project_id, version_get_id($t_bug->fixed_in_version, $t_bug->project_id));
}
}
$t_product_version_string = string_display_line($t_product_version_string);
$t_target_version_string = string_display_line($t_target_version_string);
$t_fixed_in_version_string = string_display_line($t_fixed_in_version_string);
$t_bug_id = $f_bug_id;
$t_form_title = lang_get('bug_view_title');
$t_wiki_link = config_get_global('wiki_enable') == ON ? 'wiki.php?id=' . $f_bug_id : '';
if (access_has_bug_level(config_get('view_history_threshold'), $f_bug_id)) {
$t_history_link = "view.php?id={$f_bug_id}&history=1#history";
} else {
$t_history_link = '';
}
$t_show_reminder_link = !current_user_is_anonymous() && !bug_is_readonly($f_bug_id) && access_has_bug_level(config_get('bug_reminder_threshold'), $f_bug_id);
$t_bug_reminder_link = 'bug_reminder_page.php?bug_id=' . $f_bug_id;