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


PHP bug_format_id函数代码示例

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


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

示例1: displayResultsCore

function displayResultsCore($query, $fields)
{
    $result = db_query_bound($query);
    $nbRows = 0;
    while ($row = db_fetch_array($result)) {
        $nbRows++;
        $t_bug = bug_get($row['id']);
        print "<tr> \n";
        print '<td><a href="' . string_get_bug_view_url($row['id']) . '">' . bug_format_id($row['id']) . '</a></td>';
        //print "<td> ".string_get_bug_view_url( ))." </td>\n";
        print "<td> " . string_display_line(get_enum_element('status', $t_bug->status)) . " </td>\n";
        print "<td> " . category_get_row($t_bug->category_id)['name'] . " </td>\n";
        print "<td> " . $t_bug->summary . " </td>\n";
        print "<td> " . user_get_field($t_bug->reporter_id, 'username') . " </td>\n";
        if ($t_bug->handler_id != null) {
            print "<td> " . user_get_field($t_bug->handler_id, 'username') . " </td>\n";
        }
        if (sizeof($fields) > 0) {
            for ($i = 0; $i < sizeof($fields); $i++) {
                print "<td> " . $row[$fields[$i]] . " </td>\n";
            }
        }
        print "</tr>\n";
    }
    return $nbRows;
}
开发者ID:bcramet,项目名称:CAMOSInternal,代码行数:26,代码来源:plugin_bug_util.php

示例2: relgraph_bug_format_id

function relgraph_bug_format_id( $p_bug_id ) {
	$t_pretty_bug_id = bug_format_id( $p_bug_id );
	if ( !preg_match( '/^(([a-zA-z_][0-9a-zA-Z_]*)|(\d+))$/', $t_pretty_bug_id ) ) {
		$t_pretty_bug_id = $p_bug_id;
	}
	return $t_pretty_bug_id;
}
开发者ID:rombert,项目名称:mantisbt,代码行数:7,代码来源:relationship_graph_api.php

示例3: custom_function_default_format_issue_summary

function custom_function_default_format_issue_summary($p_issue_id, $p_context = 0)
{
    switch ($p_context) {
        case SUMMARY_CAPTION:
            $t_string = bug_format_id($p_issue_id) . ': ' . string_attribute(bug_get_field($p_issue_id, 'summary'));
            break;
        case SUMMARY_FIELD:
            $t_string = bug_format_id($p_issue_id) . ': ' . string_attribute(bug_get_field($p_issue_id, 'summary'));
            break;
        case SUMMARY_EMAIL:
            $t_string = bug_format_id($p_issue_id) . ': ' . string_attribute(bug_get_field($p_issue_id, 'summary'));
            break;
        default:
            $t_string = string_attribute(bug_get_field($p_issue_id, 'summary'));
            break;
    }
    return $t_string;
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:18,代码来源:custom_function_api.php

示例4: string_get_bug_update_link

/**
 * return an href anchor that links to a bug UPDATE page for the given bug
 * account for the user preference and site override
 * @param integer $p_bug_id  A bug identifier.
 * @param integer $p_user_id A valid user identifier.
 * @return string
 */
function string_get_bug_update_link($p_bug_id, $p_user_id = null)
{
    $t_summary = string_attribute(bug_get_field($p_bug_id, 'summary'));
    return '<a href="' . helper_mantis_url(string_get_bug_update_url($p_bug_id, $p_user_id)) . '" title="' . $t_summary . '">' . bug_format_id($p_bug_id) . '</a>';
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:12,代码来源:string_api.php

示例5: file_add

/**
 * Add a file to the system using the configured storage method
 *
 * @param integer $p_bug_id the bug id
 * @param array $p_file the uploaded file info, as retrieved from gpc_get_file()
 */
function file_add($p_bug_id, $p_file, $p_table = 'bug', $p_title = '', $p_desc = '', $p_user_id = null)
{
    file_ensure_uploaded($p_file);
    $t_file_name = $p_file['name'];
    $t_tmp_file = $p_file['tmp_name'];
    if (!file_type_check($t_file_name)) {
        trigger_error(ERROR_FILE_NOT_ALLOWED, ERROR);
    }
    if (!file_is_name_unique($t_file_name, $p_bug_id)) {
        trigger_error(ERROR_FILE_DUPLICATE, ERROR);
    }
    if ('bug' == $p_table) {
        $t_project_id = bug_get_field($p_bug_id, 'project_id');
        $t_bug_id = bug_format_id($p_bug_id);
    } else {
        $t_project_id = helper_get_current_project();
        $t_bug_id = 0;
    }
    if ($p_user_id === null) {
        $c_user_id = auth_get_current_user_id();
    } else {
        $c_user_id = (int) $p_user_id;
    }
    # prepare variables for insertion
    $c_bug_id = db_prepare_int($p_bug_id);
    $c_project_id = db_prepare_int($t_project_id);
    $c_file_type = db_prepare_string($p_file['type']);
    $c_title = db_prepare_string($p_title);
    $c_desc = db_prepare_string($p_desc);
    if ($t_project_id == ALL_PROJECTS) {
        $t_file_path = config_get('absolute_path_default_upload_folder');
    } else {
        $t_file_path = project_get_field($t_project_id, 'file_path');
        if (is_blank($t_file_path)) {
            $t_file_path = config_get('absolute_path_default_upload_folder');
        }
    }
    $c_file_path = db_prepare_string($t_file_path);
    $c_new_file_name = db_prepare_string($t_file_name);
    $t_file_hash = 'bug' == $p_table ? $t_bug_id : config_get('document_files_prefix') . '-' . $t_project_id;
    $t_unique_name = file_generate_unique_name($t_file_hash . '-' . $t_file_name, $t_file_path);
    $t_disk_file_name = $t_file_path . $t_unique_name;
    $c_unique_name = db_prepare_string($t_unique_name);
    $t_file_size = filesize($t_tmp_file);
    if (0 == $t_file_size) {
        trigger_error(ERROR_FILE_NO_UPLOAD_FAILURE, ERROR);
    }
    $t_max_file_size = (int) min(ini_get_number('upload_max_filesize'), ini_get_number('post_max_size'), config_get('max_file_size'));
    if ($t_file_size > $t_max_file_size) {
        trigger_error(ERROR_FILE_TOO_BIG, ERROR);
    }
    $c_file_size = db_prepare_int($t_file_size);
    $t_method = config_get('file_upload_method');
    switch ($t_method) {
        case FTP:
        case DISK:
            file_ensure_valid_upload_path($t_file_path);
            if (!file_exists($t_disk_file_name)) {
                if (FTP == $t_method) {
                    $conn_id = file_ftp_connect();
                    file_ftp_put($conn_id, $t_disk_file_name, $t_tmp_file);
                    file_ftp_disconnect($conn_id);
                }
                if (!move_uploaded_file($t_tmp_file, $t_disk_file_name)) {
                    trigger_error(ERROR_FILE_MOVE_FAILED, ERROR);
                }
                chmod($t_disk_file_name, config_get('attachments_file_permissions'));
                $c_content = "''";
            } else {
                trigger_error(ERROR_FILE_DUPLICATE, ERROR);
            }
            break;
        case DATABASE:
            $c_content = db_prepare_binary_string(fread(fopen($t_tmp_file, 'rb'), $t_file_size));
            break;
        default:
            trigger_error(ERROR_GENERIC, ERROR);
    }
    $t_file_table = db_get_table('mantis_' . $p_table . '_file_table');
    $c_id = 'bug' == $p_table ? $c_bug_id : $c_project_id;
    $query = "INSERT INTO {$t_file_table}\n\t\t\t\t\t\t(" . $p_table . "_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, user_id)\n\t\t\t\t\t  VALUES\n\t\t\t\t\t\t({$c_id}, '{$c_title}', '{$c_desc}', '{$c_unique_name}', '{$c_new_file_name}', '{$c_file_path}', {$c_file_size}, '{$c_file_type}', '" . db_now() . "', {$c_content}, {$c_user_id})";
    db_query($query);
    if ('bug' == $p_table) {
        # updated the last_updated date
        $result = bug_update_date($p_bug_id);
        # log new bug
        history_log_event_special($p_bug_id, FILE_ADDED, $t_file_name);
    }
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:95,代码来源:file_api.php

示例6: bug_get

 $t_bug = bug_get($t_sponsor_row['bug']);
 $t_sponsor = sponsorship_get($t_sponsor_row['sponsor']);
 $t_buglist[] = $t_sponsor_row['bug'] . ':' . $t_sponsor_row['sponsor'];
 # describe bug
 $t_status = string_attribute(get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id));
 $t_resolution = string_attribute(get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id));
 $t_version_id = version_get_id($t_bug->fixed_in_version, $t_bug->project_id);
 if (false !== $t_version_id && VERSION_RELEASED == version_get_field($t_version_id, 'released')) {
     $t_released_label = '<a title="' . lang_get('released') . '">' . $t_bug->fixed_in_version . '</a>';
 } else {
     $t_released_label = $t_bug->fixed_in_version;
 }
 # choose color based on status
 $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
 echo '<tr class="' . $t_status_label . '">';
 echo '<td><a href="' . string_get_bug_view_url($t_sponsor_row['bug']) . '">' . bug_format_id($t_sponsor_row['bug']) . '</a></td>';
 echo '<td>' . string_display_line(project_get_field($t_bug->project_id, 'name')) . '&#160;</td>';
 echo '<td class="right">' . $t_released_label . '&#160;</td>';
 echo '<td><a title="' . $t_resolution . '"><span class="underline">' . $t_status . '</span>&#160;</a></td>';
 # summary
 echo '<td>' . string_display_line($t_bug->summary);
 if (VS_PRIVATE == $t_bug->view_state) {
     printf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private'));
 }
 echo '</td>';
 # describe sponsorship amount
 echo '<td>';
 print_user($t_sponsor->user_id);
 echo '</td>';
 echo '<td class="right">' . sponsorship_format_amount($t_sponsor->amount) . '</td>';
 echo '<td><select name="sponsor_' . $t_row['bug'] . '_' . $t_sponsor->id . '">';
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:account_sponsor_page.php

示例7: excel_format_id

/**
 * Gets the formatted bug id value.
 * @param BugData $p_bug The bug object.
 * @return string The bug id prefixed with 0s.
 */
function excel_format_id(BugData $p_bug)
{
    return excel_prepare_number(bug_format_id($p_bug->id));
}
开发者ID:spring,项目名称:spring-website,代码行数:9,代码来源:excel_api.php

示例8: relgraph_generate_dep_graph

function relgraph_generate_dep_graph($p_bug_id, $p_bug = null, $p_horizontal = false)
{
    # List of visited issues and their data.
    $v_bug_list = array();
    # Firstly, we visit all ascendant issues and all descendant issues
    # and collect all the necessary data in the $v_bug_list variable.
    # We do not visit other descendants of our parents, neither other
    # ascendants of our children, to avoid displaying too much unrelated
    # issues. We still collect the information about those relationships,
    # so, if these issues happen to be visited also, relationship links
    # will be preserved.
    # The first issue in the list is the one we are parting from.
    if (null === $p_bug) {
        $p_bug = bug_prepare_display(bug_get($p_bug_id, true));
    }
    $v_bug_list[$p_bug_id] = $p_bug;
    $v_bug_list[$p_bug_id]->is_descendant = true;
    $v_bug_list[$p_bug_id]->parents = array();
    $v_bug_list[$p_bug_id]->children = array();
    # Now we visit all ascendants of the root issue.
    $t_relationships = relationship_get_all_dest($p_bug_id);
    foreach ($t_relationships as $t_relationship) {
        if ($t_relationship->type != BUG_DEPENDANT) {
            continue;
        }
        $v_bug_list[$p_bug_id]->parents[] = $t_relationship->src_bug_id;
        relgraph_add_parent($v_bug_list, $t_relationship->src_bug_id);
    }
    $t_relationships = relationship_get_all_src($p_bug_id);
    foreach ($t_relationships as $t_relationship) {
        if ($t_relationship->type != BUG_DEPENDANT) {
            continue;
        }
        $v_bug_list[$p_bug_id]->children[] = $t_relationship->dest_bug_id;
        relgraph_add_child($v_bug_list, $t_relationship->dest_bug_id);
    }
    # We have already collected all the information we need to generate
    # the graph. Now it is the matter to create a Digraph object and
    # store the information there, along with graph formatting attributes.
    $t_id_string = bug_format_id($p_bug_id);
    $t_graph_fontname = config_get('relationship_graph_fontname');
    $t_graph_fontsize = config_get('relationship_graph_fontsize');
    $t_graph_fontpath = config_get('system_font_folder');
    $t_view_on_click = config_get('relationship_graph_view_on_click');
    $t_dot_tool = config_get('dot_tool');
    $t_graph_attributes = array();
    if (!empty($t_graph_fontpath)) {
        $t_graph_attributes['fontpath'] = $t_graph_fontpath;
    }
    if ($p_horizontal) {
        $t_graph_attributes['rankdir'] = 'LR';
        $t_graph_orientation = 'horizontal';
    } else {
        $t_graph_orientation = 'vertical';
    }
    $t_graph = new Digraph($t_id_string, $t_graph_attributes, $t_dot_tool);
    $t_graph->set_default_node_attr(array('fontname' => $t_graph_fontname, 'fontsize' => $t_graph_fontsize, 'shape' => 'record', 'style' => 'filled', 'height' => '0.2', 'width' => '0.4'));
    $t_graph->set_default_edge_attr(array('style' => 'solid', 'color' => '#C00000', 'dir' => 'back'));
    # Add all issue nodes and edges to the graph.
    foreach ($v_bug_list as $t_related_bug_id => $t_related_bug) {
        $t_id_string = bug_format_id($t_related_bug_id);
        if ($t_view_on_click) {
            $t_url = string_get_bug_view_url($t_related_bug_id);
        } else {
            $t_url = 'bug_relationship_graph.php?bug_id=' . $t_related_bug_id . '&amp;graph=dependency&orientation=' . $t_graph_orientation;
        }
        relgraph_add_bug_to_graph($t_graph, $t_id_string, $t_related_bug, $t_url, $t_related_bug_id == $p_bug_id);
        # Now add all relationship edges to the graph.
        foreach ($v_bug_list[$t_related_bug_id]->parents as $t_parent_id) {
            # Do not create edges for unvisited bugs.
            if (!isset($v_bug_list[$t_parent_id])) {
                continue;
            }
            $t_parent_node = bug_format_id($t_parent_id);
            $t_graph->add_edge($t_parent_node, $t_id_string);
        }
    }
    return $t_graph;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:79,代码来源:relationship_graph_api.php

示例9: helper_alternate_class

    ?>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('relationship_with_parent');
    ?>
	</td>
	<td>
		<?php 
    relationship_list_box(-2, "rel_type", false, true);
    ?>
		<?php 
    print '<b>' . lang_get('bug') . ' ' . bug_format_id($f_master_bug_id) . '</b>';
    ?>
	</td>
</tr>
<?php 
}
?>

<!-- Report Stay (report more bugs) -->
<tr <?php 
echo helper_alternate_class();
?>
>
	<td class="category">
		<?php 
echo lang_get('report_stay');
开发者ID:jin255ff,项目名称:company_website,代码行数:31,代码来源:bug_report_page.php

示例10: filter_db_get_filter

    $t_custom_filter['sort'] = $c_sort_field;
} else {
    # null will be returned if the user doesn't have access right to access the filter.
    $t_custom_filter = filter_db_get_filter($f_filter_id, $t_user_id);
    if (null === $t_custom_filter) {
        access_denied();
    }
    $t_custom_filter = filter_deserialize($t_custom_filter);
}
$t_issues = filter_get_bug_rows($t_page_number, $t_issues_per_page, $t_page_count, $t_issues_count, $t_custom_filter, $t_project_id, $t_user_id, $t_show_sticky);
# Loop through results
for ($i = 0; $i < count($t_issues); $i++) {
    $row = $t_issues[$i];
    $t_bug = bug_get($row['id'], true);
    $about = $link = $t_path . "view.php?id=" . $row['id'];
    $title = string_rss_links(bug_format_id($row['id']) . ': ' . $t_bug->summary);
    $description = string_rss_links($t_bug->description);
    # subject is category.
    $subject = string_rss_links($t_bug->category);
    # optional DC value
    $date = date('Y-m-d\\TH:i:sO', $t_bug->last_updated);
    # author of item
    $author = string_rss_links(user_get_name($t_bug->reporter_id));
    if (access_has_global_level(config_get('show_user_email_threshold'))) {
        $t_author_email = user_get_field($t_bug->reporter_id, 'email');
        if (is_blank($t_author_email)) {
            $t_author_email = $author . '@example.com';
        }
    } else {
        $t_author_email = $author . '@example.com';
    }
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:issues_rss.php

示例11: csv_escape_string

echo csv_escape_string(lang_get('summary')) . $t_separator;
if ($t_show_realname) {
    echo csv_escape_string(lang_get('realname')) . $t_separator;
} else {
    echo csv_escape_string(lang_get('username')) . $t_separator;
}
echo csv_escape_string(lang_get('timestamp')) . $t_separator;
echo csv_escape_string(lang_get('minutes')) . $t_separator;
echo csv_escape_string(lang_get('time_tracking_time_spent')) . $t_separator;
if ($t_show_cost) {
    echo csv_escape_string('cost') . $t_separator;
}
echo csv_escape_string('note');
echo "\n";
foreach ($t_billing_rows as $t_billing) {
    echo csv_escape_string(bug_format_id($t_billing['bug_id'])) . $t_separator;
    echo csv_escape_string($t_billing['project_name']) . $t_separator;
    echo csv_escape_string($t_billing['bug_summary']) . $t_separator;
    if ($t_show_realname) {
        echo csv_escape_string($t_billing['reporter_realname']) . $t_separator;
    } else {
        echo csv_escape_string($t_billing['reporter_username']) . $t_separator;
    }
    echo csv_escape_string(date($t_date_format, $t_billing['date_submitted'])) . $t_separator;
    echo csv_escape_string($t_billing['minutes']) . $t_separator;
    echo csv_escape_string($t_billing['duration']) . $t_separator;
    if ($t_show_cost) {
        echo csv_escape_string($t_billing['cost']) . $t_separator;
    }
    echo csv_escape_string($t_billing['note']);
    echo "\n";
开发者ID:spidgorny,项目名称:mantisbt,代码行数:31,代码来源:billing_export_to_csv.php

示例12: gen_up_view_status_bug_msg

/**
 * Gen update view status bug message.
 */
function gen_up_view_status_bug_msg($user_id, $bug_id, $bugnote_text)
{
    $send_msg = plugin_lang_get('msg_call') . ' ' . get_username($user_id) . '! ' . plugin_lang_get('msg_action_bug_up_view') . "\n" . plugin_lang_get('msg_bug_id') . ' ' . bug_format_id($bug_id, 'category_id') . "\n" . plugin_lang_get('msg_state') . ' ' . get_enum_element('status', bug_get_field($bug_id, 'status')) . "\n" . plugin_lang_get('msg_proj_id') . ' ' . project_get_name(bug_get_field($bug_id, 'project_id')) . "\n" . plugin_lang_get('msg_header') . ' ' . bug_get_field($bug_id, 'summary') . "\n" . plugin_lang_get('separator') . "\n" . plugin_lang_get('msg_action_bug_up_view_str') . ' ' . get_enum_element('view_state', gpc_get_int('view_status')) . "\n" . plugin_lang_get('msg_initiator') . ' ' . get_auth_username() . "\n" . plugin_lang_get('separator') . "\n" . plugin_lang_get('msg_link_bug') . ' ' . get_bug_link($bug_id);
    return $send_msg;
}
开发者ID:JeromyK,项目名称:jabber-notify,代码行数:8,代码来源:JabberNotifierSystem_API.php

示例13: mci_file_add

/**
 * Add a file
 * @param integer $p_id        File id.
 * @param string  $p_name      File name.
 * @param string  $p_content   File content to write.
 * @param string  $p_file_type File type.
 * @param string  $p_table     Database table name.
 * @param string  $p_title     Title.
 * @param string  $p_desc      Description.
 * @param string  $p_user_id   User id.
 * @return mixed
 */
function mci_file_add($p_id, $p_name, $p_content, $p_file_type, $p_table, $p_title = '', $p_desc = '', $p_user_id = null)
{
    if (!file_type_check($p_name)) {
        return SoapObjectsFactory::newSoapFault('Client', 'File type not allowed.');
    }
    if (!file_is_name_unique($p_name, $p_id)) {
        return SoapObjectsFactory::newSoapFault('Client', 'Duplicate filename.');
    }
    $t_file_size = strlen($p_content);
    $t_max_file_size = (int) min(ini_get_number('upload_max_filesize'), ini_get_number('post_max_size'), config_get('max_file_size'));
    if ($t_file_size > $t_max_file_size) {
        return SoapObjectsFactory::newSoapFault('Client', 'File is too big.');
    }
    if ('bug' == $p_table) {
        $t_project_id = bug_get_field($p_id, 'project_id');
        $t_id = (int) $p_id;
        $t_issue_id = bug_format_id($p_id);
    } else {
        $t_project_id = $p_id;
        $t_id = $t_project_id;
        $t_issue_id = 0;
    }
    if ($p_user_id === null) {
        $p_user_id = auth_get_current_user_id();
    }
    if ($t_project_id == ALL_PROJECTS) {
        $t_file_path = config_get('absolute_path_default_upload_folder');
    } else {
        $t_file_path = project_get_field($t_project_id, 'file_path');
        if (is_blank($t_file_path)) {
            $t_file_path = config_get('absolute_path_default_upload_folder');
        }
    }
    $t_unique_name = file_generate_unique_name($t_file_path);
    $t_disk_file_name = $t_file_path . $t_unique_name;
    $t_method = config_get('file_upload_method');
    switch ($t_method) {
        case DISK:
            if (!file_exists($t_file_path) || !is_dir($t_file_path) || !is_writable($t_file_path) || !is_readable($t_file_path)) {
                return SoapObjectsFactory::newSoapFault('Server', 'Upload folder \'' . $t_file_path . '\' doesn\'t exist.');
            }
            file_ensure_valid_upload_path($t_file_path);
            if (!file_exists($t_disk_file_name)) {
                mci_file_write_local($t_disk_file_name, $p_content);
                chmod($t_disk_file_name, config_get('attachments_file_permissions'));
                $c_content = "''";
            }
            break;
        case DATABASE:
            $c_content = db_prepare_binary_string($p_content);
            $t_file_path = '';
            break;
    }
    $t_file_table = db_get_table($p_table . '_file');
    $t_id_col = $p_table . '_id';
    $t_param = array($t_id_col => $t_id, 'title' => $p_title, 'description' => $p_desc, 'diskfile' => $t_unique_name, 'filename' => $p_name, 'folder' => $t_file_path, 'filesize' => $t_file_size, 'file_type' => $p_file_type, 'date_added' => db_now(), 'user_id' => (int) $p_user_id);
    # Oracle has to update BLOBs separately
    if (!db_is_oracle()) {
        $t_param['content'] = $c_content;
    }
    $t_query_param = db_param();
    for ($i = 1; $i < count($t_param); $i++) {
        $t_query_param .= ', ' . db_param();
    }
    $t_query = 'INSERT INTO ' . $t_file_table . '
		( ' . implode(', ', array_keys($t_param)) . ' )
	VALUES
		( ' . $t_query_param . ' )';
    db_query($t_query, array_values($t_param));
    # get attachment id
    $t_attachment_id = db_insert_id($t_file_table);
    if (db_is_oracle()) {
        db_update_blob($t_file_table, 'content', $c_content, "diskfile='{$t_unique_name}'");
    }
    if ('bug' == $p_table) {
        # bump the last_updated date
        bug_update_date($t_issue_id);
        # add history entry
        history_log_event_special($t_issue_id, FILE_ADDED, $p_name);
    }
    return $t_attachment_id;
}
开发者ID:martijnveen,项目名称:mantisbt,代码行数:94,代码来源:mc_file_api.php

示例14: GetRelationshipContent

function GetRelationshipContent($p_bug_id, $p_html = false, $p_html_preview = false, $p_summary = false, $p_icons = false)
{
    $t_summary = '';
    $t_icons = '';
    $t_show_project = false;
    $t_summary_wrap_at = utf8_strlen(config_get('email_separator2')) - 10;
    $t_relationship_all = relationship_get_all($p_bug_id, $t_show_project);
    $t_relationship_all_count = count($t_relationship_all);
    if ($p_summary) {
        for ($i = 0; $i < $t_relationship_all_count; $i++) {
            $p_relationship = $t_relationship_all[$i];
            if ($p_bug_id == $p_relationship->src_bug_id) {
                # root bug is in the src side, related bug in the dest side
                $t_related_bug_id = $p_relationship->dest_bug_id;
                $t_relationship_descr = relationship_get_description_src_side($p_relationship->type);
            } else {
                # root bug is in the dest side, related bug in the src side
                $t_related_bug_id = $p_relationship->src_bug_id;
                $t_relationship_descr = relationship_get_description_dest_side($p_relationship->type);
            }
            # get the information from the related bug and prepare the link
            $t_bug = bug_get($t_related_bug_id, false);
            $t_text = trim(utf8_str_pad($t_relationship_descr, 20)) . ' ';
            if ($p_html_preview == true) {
                $t_text .= '<a href="' . string_get_bug_view_url($t_related_bug_id) . '"';
                $t_text .= ' class="rcv_tooltip"';
                //$t_text .= ' title="' . utf8_str_pad (bug_format_id ($t_related_bug_id), 8) . "\n" . string_attribute ($t_bug->summary) . '"';
                $t_text .= '>';
            }
            $t_text .= string_display_line(bug_format_id($t_related_bug_id));
            if ($p_html_preview == true) {
                $t_text .= '<span class="rcv_tooltip_box">';
                $t_text .= '<span class="rcv_tooltip_title">' . bug_format_id($t_related_bug_id) . '</span>';
                $t_text .= '<span class="rcv_tooltip_content">' . utf8_substr(string_email_links($t_bug->summary), 0, MAX_TOOLTIP_CONTENT_LENGTH);
                $t_text .= MAX_TOOLTIP_CONTENT_LENGTH < strlen($t_bug->summary) ? '...' : '';
                $t_text .= '</span>';
                $t_text .= '</span>';
                $t_text .= '</a>';
            }
            if (plugin_config_get('ShowRelationshipsControl') && !bug_is_readonly($p_bug_id) && !current_user_is_anonymous() && true == $p_html_preview) {
                // bug not read only
                if (access_has_bug_level(config_get('update_bug_threshold'), $p_bug_id)) {
                    // user has access level
                    // add a delete link
                    $t_text .= ' [';
                    $t_text .= '<a class="small" href="bug_relationship_delete.php?bug_id=' . $p_bug_id;
                    $t_text .= '&amp;rel_id=' . $p_relationship->id;
                    $t_text .= '&amp;redirect_url=view_all_bug_page.php';
                    $t_text .= htmlspecialchars(form_security_param('bug_relationship_delete'));
                    $t_text .= '">' . lang_get('delete_link') . '</a>';
                    $t_text .= ']';
                }
            }
            // $t_text = relationship_get_details ($p_bug_id, $t_relationship_all[$i], true, false, $t_show_project);
            if (false == $p_html) {
                // p_html == No
                if ($i != 0) {
                    if ($p_html_preview == true) {
                        $t_summary .= ",<br/>";
                    } else {
                        $t_summary .= ", ";
                    }
                }
                $t_summary .= $t_text;
            } else {
                // p_html == Yes
                if ($p_html_preview == true) {
                    $t_summary .= '<tr bgcolor="' . get_status_color($t_bug->status, auth_get_current_user_id(), $t_bug->project_id) . '">';
                    $t_summary .= '<td>' . $t_text . '</td>';
                    $t_summary .= '</tr>' . "\n";
                } else {
                    if ($i != 0) {
                        $t_summary .= ", ";
                    }
                    $t_summary .= $t_text;
                }
            }
        }
    }
    if (plugin_config_get('ShowRelationshipIcons') && !current_user_is_anonymous() && true == $p_html_preview) {
        $t_text = RelationshipsUtils::GetBugSmybols($p_bug_id, !is_blank($t_summary));
        if (!is_blank($t_text)) {
            if (false == $p_html) {
                // p_html == No
                $t_icons .= $t_text;
            } else {
                // p_html == Yes
                if ($p_html_preview == true) {
                    $t_icons .= '<tr><td>' . $t_text . '</td></tr>' . "\n";
                } else {
                    $t_icons .= $t_text;
                }
            }
        }
    }
    if ($p_html_preview == true) {
        $t_icons_table = '';
        $t_summary_table = '';
        if (!is_blank($t_icons)) {
            $t_icons_table = '<table border="0" width="100%" cellpadding="0" cellspacing="1">' . $t_icons . '</table>';
//.........这里部分代码省略.........
开发者ID:QuestorX,项目名称:MantisBT-Plugin.RelationshipColumnView,代码行数:101,代码来源:RelationshipColumn.php

示例15: email_build_subject

/**
 * formats the subject correctly
 * we include the project name, bug id, and summary.
 *
 * @param integer $p_bug_id A bug identifier.
 * @return string
 */
function email_build_subject($p_bug_id)
{
    # grab the project name
    $p_project_name = project_get_field(bug_get_field($p_bug_id, 'project_id'), 'name');
    # grab the subject (summary)
    $p_subject = bug_get_field($p_bug_id, 'summary');
    # pad the bug id with zeros
    $t_bug_id = bug_format_id($p_bug_id);
    # build standard subject string
    $t_email_subject = '[' . $p_project_name . ' ' . $t_bug_id . ']: ' . $p_subject;
    # update subject as defined by plugins
    $t_email_subject = event_signal('EVENT_DISPLAY_EMAIL_BUILD_SUBJECT', $t_email_subject, array('bug_id' => $p_bug_id));
    return $t_email_subject;
}
开发者ID:sfranks1124,项目名称:mantisbt,代码行数:21,代码来源:email_api.php


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