• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP string_get_bug_view_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: renderIssues

    function renderIssues($status)
    {
        $content = array();
        $t_project_id = helper_get_current_project();
        $t_bug_table = db_get_table('mantis_bug_table');
        $t_user_id = auth_get_current_user_id();
        $specific_where = helper_project_specific_where($t_project_id, $t_user_id);
        if ($this->severity) {
            $severityCond = '= ' . $this->severity;
        } else {
            $severityCond = '> -1';
        }
        $query = "SELECT *\n\t\t\tFROM {$t_bug_table}\n\t\t\tWHERE {$specific_where}\n\t\t\tAND status = {$status}\n\t\t\tAND severity {$severityCond}\n\t\t\tORDER BY last_updated DESC\n\t\t\tLIMIT 20";
        $result = db_query_bound($query);
        $category_count = db_num_rows($result);
        for ($i = 0; $i < $category_count; $i++) {
            $row = db_fetch_array($result);
            //pre_var_dump($row);
            $content[] = '<div class="portlet ui-helper-clearfix" id="' . $row['id'] . '">
			<div class="portlet-header">' . string_get_bug_view_link($row['id']) . ': ' . $row['summary'] . '</div>
			<div class="portlet-content">' . ($row['reporter_id'] ? 'Reporter: ' . user_get_name($row['reporter_id']) . BR : '') . ($row['handler_id'] ? 'Assigned: ' . user_get_name($row['handler_id']) . BR : '') . '</div></div>';
        }
        if ($row) {
            //pre_var_dump(array_keys($row));
        }
        return $content;
    }
开发者ID:vboctor,项目名称:LikeTrello,代码行数:27,代码来源:trello.php


示例2: custom_function_default_roadmap_print_issue

function custom_function_default_roadmap_print_issue($p_issue_id, $p_issue_level = 0)
{
    static $t_status;
    $t_bug = bug_get($p_issue_id);
    if (bug_is_resolved($p_issue_id)) {
        $t_strike_start = '<strike>';
        $t_strike_end = '</strike>';
    } else {
        $t_strike_start = $t_strike_end = '';
    }
    if ($t_bug->category_id) {
        $t_category_name = category_get_name($t_bug->category_id);
    } else {
        $t_category_name = '';
    }
    $t_category = is_blank($t_category_name) ? '' : '<b>[' . string_display_line($t_category_name) . ']</b> ';
    echo utf8_str_pad('', $p_issue_level * 6, '&#160;'), '- ', $t_strike_start, string_get_bug_view_link($p_issue_id), ': ', $t_category, string_display_line_links($t_bug->summary);
    if ($t_bug->handler_id != 0) {
        echo ' (', prepare_user_name($t_bug->handler_id), ')';
    }
    if (!isset($t_status[$t_bug->status])) {
        $t_status[$t_bug->status] = get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
    }
    echo ' - ', $t_status[$t_bug->status], $t_strike_end, '.<br />';
}
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:25,代码来源:custom_function_api.php


示例3: html

 /**
  * Returns html string to display
  * @return string
  */
 public function html()
 {
     $t_html = $this->html_start();
     $t_html .= '<div class="action">' . sprintf(lang_get('timeline_issue_created'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id)) . '</div>';
     $t_html .= $this->html_end();
     return $t_html;
 }
开发者ID:gtn,项目名称:mantisbt,代码行数:11,代码来源:IssueCreatedTimelineEvent.class.php


示例4: bug_group_action_print_bug_list

/**
 * Print the list of selected issues and the legend for the status colors.
 *
 * @param $p_bug_ids_array   An array of issue ids.
 */
function bug_group_action_print_bug_list($p_bug_ids_array)
{
    $t_legend_position = config_get('status_legend_position');
    if (STATUS_LEGEND_POSITION_TOP == $t_legend_position) {
        html_status_legend();
        echo '<br />';
    }
    echo '<div align="center">';
    echo '<table class="width75" cellspacing="1">';
    echo '<tr class="row-1">';
    echo '<td class="category" colspan="2">';
    echo lang_get('actiongroup_bugs');
    echo '</td>';
    echo '</tr>';
    $t_i = 1;
    foreach ($p_bug_ids_array as $t_bug_id) {
        $t_class = sprintf("row-%d", $t_i++ % 2 + 1);
        echo sprintf("<tr bgcolor=\"%s\"> <td>%s</td> <td>%s</td> </tr>\n", get_status_color(bug_get_field($t_bug_id, 'status')), string_get_bug_view_link($t_bug_id), string_attribute(bug_get_field($t_bug_id, 'summary')));
    }
    echo '</table>';
    echo '</form>';
    echo '</div>';
    if (STATUS_LEGEND_POSITION_BOTTOM == $t_legend_position) {
        echo '<br />';
        html_status_legend();
    }
}
开发者ID:amjadtbssm,项目名称:website,代码行数:32,代码来源:bug_group_action_api.php


示例5: html

 /**
  * Returns html string to display
  * @return string
  */
 public function html()
 {
     $t_string = $this->tag ? lang_get('timeline_issue_tagged') : lang_get('timeline_issue_untagged');
     $t_tag_row = tag_get_by_name($this->tag_name);
     $t_html = $this->html_start();
     $t_html .= '<div class="action">' . sprintf($t_string, user_get_name($this->user_id), string_get_bug_view_link($this->issue_id), $t_tag_row ? tag_get_link($t_tag_row) : $this->tag_name) . '</div>';
     $t_html .= $this->html_end();
     return $t_html;
 }
开发者ID:gtn,项目名称:mantisbt,代码行数:13,代码来源:IssueTagTimelineEvent.class.php


示例6: custom_function_default_changelog_print_issue

function custom_function_default_changelog_print_issue($p_issue_id)
{
    $t_bug = bug_get($p_issue_id);
    echo '- ', string_get_bug_view_link($p_issue_id), ': <b>[', $t_bug->category, ']</b> ', string_attribute($t_bug->summary);
    if ($t_bug->handler_id != 0) {
        echo ' (', prepare_user_name($t_bug->handler_id), ')';
    }
    echo '<br />';
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:9,代码来源:custom_function_api.php


示例7: html

 /**
  * Returns html string to display
  * @return string
  */
 public function html()
 {
     if ($this->user_id == $this->handler_id) {
         $t_string = sprintf(lang_get('timeline_issue_assigned_to_self'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
     } else {
         $t_string = sprintf(lang_get('timeline_issue_assigned'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id), user_get_name($this->handler_id));
     }
     $t_html = $this->html_start();
     $t_html .= '<div class="action">' . $t_string . '</div>';
     $t_html .= $this->html_end();
     return $t_html;
 }
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:16,代码来源:IssueAssignedTimelineEvent.class.php


示例8: custom_function_default_roadmap_print_issue

function custom_function_default_roadmap_print_issue($p_issue_id, $p_issue_level = 0)
{
    $t_bug = bug_get($p_issue_id);
    if (bug_is_resolved($p_issue_id)) {
        $t_strike_start = '<strike>';
        $t_strike_end = '</strike>';
    } else {
        $t_strike_start = $t_strike_end = '';
    }
    $t_category = is_blank($t_bug->category) ? '' : '<b>[' . $t_bug->category . ']</b> ';
    echo str_pad('', $p_issue_level * 6, '&nbsp;'), '- ', $t_strike_start, string_get_bug_view_link($p_issue_id), ': ', $t_category, string_display_line_links($t_bug->summary);
    if ($t_bug->handler_id != 0) {
        echo ' (', prepare_user_name($t_bug->handler_id), ')';
    }
    echo ' - ', get_enum_element('status', $t_bug->status), $t_strike_end, '.<br />';
}
开发者ID:amjadtbssm,项目名称:website,代码行数:16,代码来源:custom_function_api.php


示例9: html

 /**
  * Returns html string to display
  * @return string
  */
 public function html()
 {
     $t_resolved = config_get('bug_resolved_status_threshold');
     $t_closed = config_get('bug_closed_status_threshold');
     if ($this->old_status < $t_closed && $this->new_status >= $t_closed) {
         $t_string = sprintf(lang_get('timeline_issue_closed'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
     } else {
         if ($this->old_status < $t_resolved && $this->new_status >= $t_resolved) {
             $t_string = sprintf(lang_get('timeline_issue_resolved'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
         } else {
             if ($this->old_status >= $t_resolved && $this->new_status < $t_resolved) {
                 $t_string = sprintf(lang_get('timeline_issue_reopened'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
             } else {
                 return '';
             }
         }
     }
     $t_html = $this->html_start();
     $t_html .= '<div class="action">' . $t_string . '</div>';
     $t_html .= $this->html_end();
     return $t_html;
 }
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:26,代码来源:IssueStatusChangeTimelineEvent.class.php


示例10: string_process_bug_link

function string_process_bug_link($p_string, $p_include_anchor = true, $p_detail_info = true, $p_fqdn = false)
{
    $t_tag = config_get('bug_link_tag');
    # bail if the link tag is blank
    if ('' == $t_tag) {
        return $p_string;
    }
    preg_match_all('/(^|.+?)(?:(?<=^|\\W)' . preg_quote($t_tag, '/') . '(\\d+)|$)/s', $p_string, $t_matches, PREG_SET_ORDER);
    $t_result = '';
    if ($p_include_anchor) {
        foreach ($t_matches as $t_match) {
            $t_result .= $t_match[1];
            if (isset($t_match[2])) {
                $t_bug_id = $t_match[2];
                if (bug_exists($t_bug_id)) {
                    $t_result .= string_get_bug_view_link($t_bug_id, null, $p_detail_info, $p_fqdn);
                } else {
                    $t_result .= $t_bug_id;
                }
            }
        }
    } else {
        foreach ($t_matches as $t_match) {
            $t_result .= $t_match[1];
            if (isset($t_match[2])) {
                $t_bug_id = $t_match[2];
                # We might as well create the link here even if the bug
                #  doesn't exist.  In the case above we don't want to do
                #  the summary lookup on a non-existant bug.  But here, we
                #  can create the link and by the time it is clicked on, the
                #  bug may exist.
                $t_result .= string_get_bug_view_url_with_fqdn($t_bug_id, null);
            }
        }
    }
    return $t_result;
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:37,代码来源:string_api.php


示例11: summary_print_by_age

/**
 * Print list of bugs opened from the longest time
 * @return void
 */
function summary_print_by_age()
{
    $t_project_id = helper_get_current_project();
    $t_resolved = config_get('bug_resolved_status_threshold');
    $t_specific_where = helper_project_specific_where($t_project_id);
    if (' 1<>1' == $t_specific_where) {
        return;
    }
    $t_query = 'SELECT * FROM {bug}
				WHERE status < ' . db_param() . '
				AND ' . $t_specific_where . '
				ORDER BY date_submitted ASC, priority DESC';
    $t_result = db_query($t_query, array($t_resolved));
    $t_count = 0;
    $t_private_bug_threshold = config_get('private_bug_threshold');
    while ($t_row = db_fetch_array($t_result)) {
        # as we select all from bug_table, inject into the cache.
        bug_cache_database_result($t_row);
        # Skip private bugs unless user has proper permissions
        if (VS_PRIVATE == bug_get_field($t_row['id'], 'view_state') && false == access_has_bug_level($t_private_bug_threshold, $t_row['id'])) {
            continue;
        }
        if ($t_count++ == 10) {
            break;
        }
        $t_bugid = string_get_bug_view_link($t_row['id']);
        $t_summary = string_display_line($t_row['summary']);
        $t_days_open = intval((time() - $t_row['date_submitted']) / SECONDS_PER_DAY);
        echo '<tr>' . "\n";
        echo '<td class="small">' . $t_bugid . ' - ' . $t_summary . '</td><td class="right">' . $t_days_open . '</td>' . "\n";
        echo '</tr>' . "\n";
    }
}
开发者ID:gtn,项目名称:mantisbt,代码行数:37,代码来源:summary_api.php


示例12: array

	</tr>
<?php 
    $t_sum_in_minutes = 0;
    $t_user_summary = array();
    # Initialize the user summary array
    foreach ($t_bugnote_stats as $t_item) {
        $t_user_summary[$t_item[$t_name_field]] = 0;
    }
    # Calculate the totals
    foreach ($t_bugnote_stats as $t_item) {
        $t_sum_in_minutes += $t_item['sum_time_tracking'];
        $t_user_summary[$t_item[$t_name_field]] += $t_item['sum_time_tracking'];
        $t_item['sum_time_tracking'] = db_minutes_to_hhmm($t_item['sum_time_tracking']);
        if ($t_item['bug_id'] != $t_prev_id) {
            $t_link = sprintf(lang_get('label'), string_get_bug_view_link($t_item['bug_id'])) . lang_get('word_separator') . string_display($t_item['summary']);
            echo '<tr class="row-category-history"><td colspan="4">' . $t_link . '</td></tr>';
            $t_prev_id = $t_item['bug_id'];
        }
        ?>
	<tr>
		<td class="small-caption">
			<?php 
        echo $t_item[$t_name_field];
        ?>
		</td>
		<td class="small-caption">
			<?php 
        echo $t_item['sum_time_tracking'];
        ?>
		</td>
开发者ID:elmarculino,项目名称:mantisbt,代码行数:30,代码来源:billing_inc.php


示例13: bug_set_field

                bug_set_field($t_bug_id, 'sticky', !$f_sticky);
            } else {
                $t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
            }
            break;
        case 'CUSTOM':
            if (0 === $f_custom_field_id) {
                trigger_error(ERROR_GENERIC, ERROR);
            }
            $t_form_var = "custom_field_{$f_custom_field_id}";
            $t_custom_field_value = gpc_get_custom_field($t_form_var, $t_custom_field_def['type'], null);
            custom_field_set_value($f_custom_field_id, $t_bug_id, $t_custom_field_value);
            break;
        default:
            trigger_error(ERROR_GENERIC, ERROR);
    }
}
$t_redirect_url = 'view_all_bug_page.php';
if (count($t_failed_ids) > 0) {
    html_page_top1();
    html_page_top2();
    echo '<div align="center">';
    foreach ($t_failed_ids as $t_id => $t_reason) {
        printf("<p> %s: %s </p>\n", string_get_bug_view_link($t_id), $t_reason);
    }
    print_bracket_link($t_redirect_url, lang_get('proceed'));
    echo '</div>';
    html_page_bottom1(__FILE__);
} else {
    print_header_redirect($t_redirect_url);
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:bug_actiongroup.php


示例14: html

 /**
  * Returns html string to display
  * @return string
  */
 public function html()
 {
     switch ($this->type) {
         case IssueStatusChangeTimelineEvent::RESOLVED:
             $t_string = sprintf(lang_get('timeline_issue_resolved'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
             break;
         case IssueStatusChangeTimelineEvent::CLOSED:
             $t_string = sprintf(lang_get('timeline_issue_closed'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
             break;
         case IssueStatusChangeTimelineEvent::REOPENED:
             $t_string = sprintf(lang_get('timeline_issue_reopened'), user_get_name($this->user_id), string_get_bug_view_link($this->issue_id));
             break;
         case IssueStatusChangeTimelineEvent::IGNORED:
             return '';
         default:
             # Unknown status change type
             trigger_error(ERROR_GENERIC, ERROR);
             return '';
     }
     $t_html = $this->html_start();
     $t_html .= '<div class="action">' . $t_string . '</div>';
     $t_html .= $this->html_end();
     return $t_html;
 }
开发者ID:skbly7,项目名称:mantisbt,代码行数:28,代码来源:IssueStatusChangeTimelineEvent.class.php


示例15: lang_get

    if ($t_cost_col) {
        ?>
		<td class="small-caption bold right">
			<?php 
        echo lang_get('time_tracking_cost');
        ?>
		</td>
<?php 
    }
    ?>

	</tr>
<?php 
    foreach ($t_bugnote_stats['issues'] as $t_issue_id => $t_issue) {
        $t_project_info = !isset($f_bug_id) && $f_project_id == ALL_PROJECTS ? '[' . project_get_name($t_issue['project_id']) . ']' . lang_get('word_separator') : '';
        $t_link = sprintf(lang_get('label'), string_get_bug_view_link($t_issue_id)) . lang_get('word_separator') . $t_project_info . string_display($t_issue['summary']);
        echo '<tr class="row-category-history"><td colspan="4">' . $t_link . '</td></tr>';
        foreach ($t_issue['users'] as $t_username => $t_user_info) {
            ?>
	<tr>
		<td class="small-caption">
			<?php 
            echo $t_username;
            ?>
		</td>
		<td class="small-caption">
			<?php 
            echo db_minutes_to_hhmm($t_user_info['minutes']);
            ?>
		</td>
<?php 
开发者ID:martijnveen,项目名称:mantisbt,代码行数:31,代码来源:billing_inc.php


示例16: summary_print_by_age

function summary_print_by_age()
{
    $t_mantis_bug_table = db_get_table('mantis_bug_table');
    $t_project_id = helper_get_current_project();
    $t_user_id = auth_get_current_user_id();
    $t_resolved = config_get('bug_resolved_status_threshold');
    $specific_where = helper_project_specific_where($t_project_id);
    if (' 1<>1' == $specific_where) {
        return;
    }
    $query = "SELECT * FROM {$t_mantis_bug_table}\n\t\t\t\tWHERE status < {$t_resolved}\n\t\t\t\tAND {$specific_where}\n\t\t\t\tORDER BY date_submitted ASC, priority DESC";
    $result = db_query($query);
    $t_count = 0;
    $t_private_bug_threshold = config_get('private_bug_threshold');
    while ($row = db_fetch_array($result)) {
        // as we select all from bug_table, inject into the cache.
        bug_cache_database_result($row);
        // Skip private bugs unless user has proper permissions
        if (VS_PRIVATE == bug_get_field($row['id'], 'view_state') && false == access_has_bug_level($t_private_bug_threshold, $row['id'])) {
            continue;
        }
        if ($t_count++ == 10) {
            break;
        }
        $t_bugid = string_get_bug_view_link($row['id']);
        $t_summary = string_display_line($row['summary']);
        $t_days_open = intval((time() - $row['date_submitted']) / SECONDS_PER_DAY);
        print "<tr " . helper_alternate_class() . ">\n";
        print "<td class=\"small\">{$t_bugid} - {$t_summary}</td><td class=\"right\">{$t_days_open}</td>\n";
        print "</tr>\n";
    }
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:32,代码来源:summary_api.php


示例17: project_get_name

				<p class="bugid"></p>
				<p class="commits"><?php 
                    echo $source_count[$bug->id];
                    ?>
</p>
				<p class="category"><?php 
                    if ($bug->project_id != $current_project) {
                        $project_name = project_get_name($bug->project_id);
                        echo '<span class="project">' . $project_name . '</span> - ';
                    }
                    echo category_full_name($bug->category_id, false);
                    ?>
				</p>
				<p class="summary">
					<?php 
                    echo string_get_bug_view_link($bug->id) . ': ' . bug_format_summary($bug->id, 0);
                    ?>

				</p>
				<p class="severity"
					style="background: <?php 
                    echo $sevcolor;
                    ?>
"
					title="Severity: <?php 
                    echo get_enum_element('severity', $bug->severity);
                    ?>
">
				</p>
				<p class="resolution"
					style="background: <?php 
开发者ID:stephgil29,项目名称:scrum,代码行数:31,代码来源:board.php


示例18: gpc_get_custom_field

            $t_form_var = 'custom_field_' . $f_custom_field_id;
            $t_custom_field_value = gpc_get_custom_field($t_form_var, $t_custom_field_def['type'], null);
            custom_field_set_value($f_custom_field_id, $t_bug_id, $t_custom_field_value);
            bug_update_date($t_bug_id);
            email_bug_updated($t_bug_id);
            helper_call_custom_function('issue_update_notify', array($t_bug_id));
            break;
        default:
            trigger_error(ERROR_GENERIC, ERROR);
    }
    # Bug Action Event
    event_signal('EVENT_BUG_ACTION', array($f_action, $t_bug_id));
}
form_security_purge($t_form_name);
$t_redirect_url = 'view_all_bug_page.php';
if (count($t_failed_ids) > 0) {
    html_page_top();
    echo '<div><br />';
    echo '<table class="width75">';
    $t_separator = lang_get('word_separator');
    foreach ($t_failed_ids as $t_id => $t_reason) {
        $t_label = sprintf(lang_get('label'), string_get_bug_view_link($t_id)) . $t_separator;
        printf("<tr><td width=\"50%%\">%s%s</td><td>%s</td></tr>\n", $t_label, bug_get_field($t_id, 'summary'), $t_reason);
    }
    echo '</table><br />';
    print_bracket_link($t_redirect_url, lang_get('proceed'));
    echo '</div>';
    html_page_bottom();
} else {
    print_header_redirect($t_redirect_url);
}
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:bug_actiongroup.php


示例19: trigger_error

                trigger_error(ERROR_GENERIC, ERROR);
            }
            /** @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) ); */
            $t_form_var = "custom_field_{$f_custom_field_id}";
            $t_custom_field_value = gpc_get_custom_field($t_form_var, $t_custom_field_def['type'], null);
            custom_field_set_value($f_custom_field_id, $t_bug_id, $t_custom_field_value);
            bug_update_date($t_bug_id);
            helper_call_custom_function('issue_update_notify', array($t_bug_id));
            break;
        default:
            trigger_error(ERROR_GENERIC, ERROR);
    }
    // Bug Action Event
    event_signal('EVENT_BUG_ACTION', array($f_action, $t_bug_id));
}
form_security_purge($t_form_name);
$t_redirect_url = 'view_all_bug_page.php';
if (count($t_failed_ids) > 0) {
    html_page_top();
    echo '<div align="center"><br />';
    echo '<table class="width75">';
    foreach ($t_failed_ids as $t_id => $t_reason) {
        printf("<tr><td width=\"50%%\">%s: %s</td><td>%s</td></tr>\n", string_get_bug_view_link($t_id), bug_get_field($t_id, 'summary'), $t_reason);
    }
    echo '</table><br />';
    print_bracket_link($t_redirect_url, lang_get('proceed'));
    echo '</div>';
    html_page_bottom();
} else {
    print_header_redirect($t_redirect_url);
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:31,代码来源:bug_actiongroup.php


示例20: string_process_bug_link

/**
 * Process $p_string, looking for bug ID references and creating bug view
 * links for them.
 *
 * Returns the processed string.
 *
 * If $p_include_anchor is true, include the href tag, otherwise just insert
 * the URL
 *
 * The bug tag ('#' by default) must be at the beginning of the string or
 * preceeded by a character that is not a letter, a number or an underscore
 *
 * if $p_include_anchor = false, $p_fqdn is ignored and assumed to true.
 * @param string  $p_string         String to be processed.
 * @param boolean $p_include_anchor Whether to include the href tag or just the URL.
 * @param boolean $p_detail_info    Whether to include more detailed information (e.g. title attribute / project) in the returned string.
 * @param boolean $p_fqdn           Whether to return an absolute or relative link.
 * @return string
 */
function string_process_bug_link($p_string, $p_include_anchor = true, $p_detail_info = true, $p_fqdn = false)
{
    static $s_bug_link_callback = array();
    $t_tag = config_get('bug_link_tag');
    # bail if the link tag is blank
    if ('' == $t_tag || $p_string == '') {
        return $p_string;
    }
    if (!isset($s_bug_link_callback[$p_include_anchor][$p_detail_info][$p_fqdn])) {
        if ($p_include_anchor) {
            $s_bug_link_callback[$p_include_anchor][$p_detail_info][$p_fqdn] = function ($p_array) use($p_detail_info, $p_fqdn) {
                if (bug_exists((int) $p_array[2])) {
                    $t_project_id = bug_get_field((int) $p_array[2], 'project_id');
                    $t_view_bug_threshold = config_get('view_bug_threshold', null, null, $t_project_id);
                    if (access_has_bug_level($t_view_bug_threshold, (int) $p_array[2])) {
                        return $p_array[1] . string_get_bug_view_link((int) $p_array[2], (bool) $p_detail_info, (bool) $p_fqdn);
                    }
                }
                return $p_array[0];
            };
            # end of bug link callback closure
        } else {
            $s_bug_link_callback[$p_include_anchor][$p_detail_info][$p_fqdn] = function ($p_array) {
                if (bug_exists((int) $p_array[2])) {
                    # Create link regardless of user's access to the bug
                    return $p_array[1] . string_get_bug_view_url_with_fqdn((int) $p_array[2]);
                }
                return $p_array[0];
            };
            # end of bug link callback closure
        }
    }
    $p_string = preg_replace_callback('/(^|[^\\w&])' . preg_quote($t_tag, '/') . '(\\d+)\\b/', $s_bug_link_callback[$p_include_anchor][$p_detail_info][$p_fqdn], $p_string);
    return $p_string;
}
开发者ID:gtn,项目名称:mantisbt,代码行数:54,代码来源:string_api.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP string_get_bug_view_url函数代码示例发布时间:2022-05-23
下一篇:
PHP string_get_bug_update_url函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap