本文整理汇总了PHP中bug_get函数的典型用法代码示例。如果您正苦于以下问题:PHP bug_get函数的具体用法?PHP bug_get怎么用?PHP bug_get使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bug_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateMantisBugStatusById
function updateMantisBugStatusById($bug_id, $status)
{
$bug = bug_get($bug_id);
$bug->status = $status;
$result = bug_update($bug_id, $bug);
return $result;
}
示例2: 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;
}
示例3: twitter_issue_resolved
/**
* Posts a twitter update when a bug is resolved.
*
* @param $p_bug_id The bug id that was resolved.
* @access public
*/
function twitter_issue_resolved($p_bug_id)
{
if (!twitter_enabled()) {
return true;
}
$t_bug = bug_get($p_bug_id, false);
# Do not twitter except fixed issues
if ($t_bug->resolution < config_get('bug_resolution_fixed_threshold') || $t_bug->resolution >= config_get('bug_resolution_not_fixed_threshold')) {
return true;
}
# Do not twitter private bugs.
if ($t_bug->view_state != VS_PUBLIC) {
return true;
}
# Do not twitter bugs belonging to private projects.
if (VS_PRIVATE == project_get_field($t_bug->project_id, 'view_state')) {
return true;
}
$c_bug_id = db_prepare_int($p_bug_id);
if (is_blank($t_bug->fixed_in_version)) {
$t_message = sprintf(lang_get('twitter_resolved_no_version'), $c_bug_id, category_full_name($t_bug->category_id, false), $t_bug->summary, user_get_name($t_bug->handler_id));
} else {
$t_message = sprintf(lang_get('twitter_resolved'), $c_bug_id, category_full_name($t_bug->category_id, false), $t_bug->summary, user_get_name($t_bug->handler_id), $t_bug->fixed_in_version);
}
return twitter_update($t_message);
}
示例4: 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, ' '), '- ', $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 />';
}
示例5: 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 />';
}
示例6: get_bug_description
/**
* @param $bug_id
* @param $version_date
* @return array
*/
function get_bug_description($bug_id, $version_date)
{
$specmanagement_database_api = new specmanagement_database_api();
$description_value = null;
$bug = bug_get($bug_id);
$value_type = 1;
$description_value = $specmanagement_database_api->calculate_last_text_fields($bug_id, $version_date, $value_type);
if (strlen($description_value) == 0) {
$description_value = $bug->description;
}
return $description_value;
}
开发者ID:Cre-ator,项目名称:Whiteboard.SpecificationManagement-Plugin,代码行数:17,代码来源:specmanagement_editor_api.php
示例7: mc_issue_get
/**
* Get all details about an issue.
*
* @param string $p_username The name of the user trying to access the issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the issue to retrieve.
* @return Array that represents an IssueData structure
*/
function mc_issue_get($p_username, $p_password, $p_issue_id)
{
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return mci_soap_fault_login_failed();
}
$t_lang = mci_get_user_lang($t_user_id);
if (!bug_exists($p_issue_id)) {
return new soap_fault('Client', '', 'Issue does not exist.');
}
$t_project_id = bug_get_field($p_issue_id, 'project_id');
if (!mci_has_readonly_access($t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
$t_bug = bug_get($p_issue_id, true);
$t_issue_data = array();
$t_issue_data['id'] = $p_issue_id;
$t_issue_data['view_state'] = mci_enum_get_array_by_id($t_bug->view_state, 'view_state', $t_lang);
$t_issue_data['last_updated'] = timestamp_to_iso8601($t_bug->last_updated);
$t_issue_data['project'] = mci_project_as_array_by_id($t_bug->project_id);
$t_issue_data['category'] = mci_get_category($t_bug->category_id);
$t_issue_data['priority'] = mci_enum_get_array_by_id($t_bug->priority, 'priority', $t_lang);
$t_issue_data['severity'] = mci_enum_get_array_by_id($t_bug->severity, 'severity', $t_lang);
$t_issue_data['status'] = mci_enum_get_array_by_id($t_bug->status, 'status', $t_lang);
$t_issue_data['reporter'] = mci_account_get_array_by_id($t_bug->reporter_id);
$t_issue_data['summary'] = $t_bug->summary;
$t_issue_data['version'] = mci_null_if_empty($t_bug->version);
$t_issue_data['build'] = mci_null_if_empty($t_bug->build);
$t_issue_data['platform'] = mci_null_if_empty($t_bug->platform);
$t_issue_data['os'] = mci_null_if_empty($t_bug->os);
$t_issue_data['os_build'] = mci_null_if_empty($t_bug->os_build);
$t_issue_data['reproducibility'] = mci_enum_get_array_by_id($t_bug->reproducibility, 'reproducibility', $t_lang);
$t_issue_data['date_submitted'] = timestamp_to_iso8601($t_bug->date_submitted);
$t_issue_data['sponsorship_total'] = $t_bug->sponsorship_total;
if (!empty($t_bug->handler_id)) {
$t_issue_data['handler'] = mci_account_get_array_by_id($t_bug->handler_id);
}
$t_issue_data['projection'] = mci_enum_get_array_by_id($t_bug->projection, 'projection', $t_lang);
$t_issue_data['eta'] = mci_enum_get_array_by_id($t_bug->eta, 'eta', $t_lang);
$t_issue_data['resolution'] = mci_enum_get_array_by_id($t_bug->resolution, 'resolution', $t_lang);
$t_issue_data['fixed_in_version'] = mci_null_if_empty($t_bug->fixed_in_version);
$t_issue_data['target_version'] = mci_null_if_empty($t_bug->target_version);
$t_issue_data['due_date'] = mci_issue_get_due_date($t_bug);
$t_issue_data['description'] = $t_bug->description;
$t_issue_data['steps_to_reproduce'] = mci_null_if_empty($t_bug->steps_to_reproduce);
$t_issue_data['additional_information'] = mci_null_if_empty($t_bug->additional_information);
$t_issue_data['attachments'] = mci_issue_get_attachments($p_issue_id);
$t_issue_data['relationships'] = mci_issue_get_relationships($p_issue_id, $t_user_id);
$t_issue_data['notes'] = mci_issue_get_notes($p_issue_id);
$t_issue_data['custom_fields'] = mci_issue_get_custom_fields($p_issue_id);
return $t_issue_data;
}
示例8: populate_from_db
public function populate_from_db()
{
/**
* Populates the Bug instance based on what's in the Mantis DB.
*/
$bugdata = bug_get($this->bug_id, TRUE);
foreach (Bug::$mantis_attrs as $a) {
$this->mantis_data[$a] = $bugdata->{$a};
}
foreach (Bug::$rsrc_attrs as $a) {
$this->rsrc_data[$a] = $this->_get_rsrc_attr($a);
}
}
示例9: 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, ' '), '- ', $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 />';
}
示例10: buildNotificationEmails
/**
* Builds notification emails for the selected customers about changes made in bugs reports they are linked to
*
* @param array $customer_ids the ids of the customer to notify
* @param string $from the start of the interval
* @param string $to the end of the interval
*
* @return array notified customers
*/
static function buildNotificationEmails($customer_ids, $from, $to)
{
$emails = array();
lang_push(plugin_config_get('email_notification_language'));
$fromDate = self::startOfDay(strtotime($from));
$toDate = self::endOfDay(strtotime($to));
$changedBugIds = CustomerManagementDao::findAllChangedBugIds($customer_ids, $fromDate, $toDate);
$dateFormat = config_get('short_date_format');
foreach ($customer_ids as $customer_id) {
$changesForCustomer = array();
foreach ($changedBugIds as $changedBugId) {
if ($changedBugId['customer_id'] == $customer_id) {
$changesForCustomer[] = array('bug' => bug_get($changedBugId['bug_id']));
}
}
if (count($changesForCustomer) > 0) {
$counter = 0;
$text = '';
foreach ($changesForCustomer as $changeForCustomer) {
$counter++;
$bugId = $changeForCustomer['bug']->id;
$text .= $counter . '. ';
$text .= sprintf(plugin_lang_get('email_notification_bug_header'), $changeForCustomer['bug']->id, $changeForCustomer['bug']->summary, date($dateFormat, $changeForCustomer['bug']->date_submitted), get_enum_element('status', $changeForCustomer['bug']->status));
$text .= "\n";
$reporterName = user_get_name($changeForCustomer['bug']->reporter_id);
$reporterEmail = user_get_email($changeForCustomer['bug']->reporter_id);
$text .= sprintf(plugin_lang_get('email_notification_bug_reported_by'), $reporterName, $reporterEmail);
$text .= "\n";
$text .= sprintf(plugin_lang_get('email_notification_bug_description'), $changeForCustomer['bug']->description);
$text .= "\n\n";
}
$customer = CustomerManagementDao::getCustomer($customer_id);
$email = new EmailData();
$email->email = $customer['email'];
$email->subject = sprintf(plugin_lang_get('email_notification_title'), $customer['name'], $from, $to);
$email->body = $text;
$email->metadata['priority'] = config_get('mail_priority');
$email->metadata['charset'] = 'utf-8';
array_push($emails, $email);
}
}
lang_pop();
return $emails;
}
示例11: worklogmenu
function worklogmenu()
{
if (ON == plugin_config_get('promote_text')) {
$bugid = gpc_get_int('id');
if (access_has_bug_level(plugin_config_get('promote_threshold'), $bugid)) {
$t_bug_p = bug_get($bugid, true);
if (OFF == plugin_config_get('project_text')) {
$proj_id = 0;
} else {
$proj_id = $t_bug_p->project_id;
}
$subject = urlencode($t_bug_p->description);
$subject .= " ";
$subject .= urlencode($t_bug_p->additional_information);
$content = category_full_name($t_bug_p->category_id);
$content .= " -> ";
$content .= urlencode($t_bug_p->summary);
if (ON == plugin_config_get('worklog_view_check')) {
$import_page = 'worklog_add_page2.php';
} else {
$import_page = 'worklog_add.php';
}
$import_page .= '&log_type=0&';
$import_page .= '&ref_log_ids=';
$import_page .= '&ref_issue_ids=';
$import_page .= '&log_begin=';
$import_page .= '&log_end=';
$import_page .= '&content=';
$import_page .= $content;
$import_page .= '&subject=';
$import_page .= $subject;
$import_page .= '&project_id=';
$import_page .= $proj_id;
if (ON == plugin_config_get('worklog_view_check')) {
return array(plugin_lang_get('import_worklog') => plugin_page($import_page) . '" target=_new>');
} else {
return array(plugin_lang_get('import_worklog') => plugin_page($import_page));
}
}
}
}
示例12: display_bug_id
function display_bug_id($p_event, $p_text)
{
$p_bug_id = (int) $p_text;
if (!bug_exists($p_bug_id)) {
return $p_text;
}
$bug = bug_get($p_bug_id);
$project = $bug->__get("project_id");
if ($project != plugin_config_get('project_id')) {
return $p_text;
}
$p_field_id = plugin_config_get('field_id');
$prefix = plugin_config_get('prefix');
$has_parent = false;
$t_bugs_ids = relationship_get_all_src($p_bug_id);
foreach ($t_bugs_ids as $t_relaship) {
if ($t_relaship->type == BUG_BLOCKS) {
$has_parent = true;
break;
}
}
$t_bugs_ids = relationship_get_all_dest($p_bug_id);
foreach ($t_bugs_ids as $t_relaship) {
if ($t_relaship->type == BUG_DEPENDANT) {
$has_parent = true;
break;
}
}
$prefix_two = plugin_config_get('prefix_two');
if ($has_parent) {
$prefix = $prefix_two;
}
$p_def = custom_field_get_definition($p_field_id);
$t_custom_field_value = custom_field_get_value($p_field_id, $p_bug_id);
global $g_custom_field_type_definition;
if (isset($g_custom_field_type_definition[$p_def['type']]['#function_string_value'])) {
return $prefix . call_user_func($g_custom_field_type_definition[$p_def['type']]['#function_string_value'], $t_custom_field_value);
}
return $prefix . $t_custom_field_value;
}
示例13: faqmenu
function faqmenu()
{
if (ON == plugin_config_get('promote_text')) {
$bugid = gpc_get_int('id');
if (access_has_bug_level(plugin_config_get('promote_threshold'), $bugid)) {
$t_bug_p = bug_get($bugid, true);
if (OFF == plugin_config_get('project_text')) {
$proj_id = 0;
} else {
$proj_id = $t_bug_p->project_id;
}
$answer = urlencode($t_bug_p->description);
$answer .= " ";
$answer .= urlencode($t_bug_p->additional_information);
$question = category_full_name($t_bug_p->category_id);
$question .= " -> ";
$question .= urlencode($t_bug_p->summary);
if (ON == plugin_config_get('faq_view_check')) {
$import_page = 'faq_add_page2.php';
} else {
$import_page = 'faq_add.php';
}
$import_page .= '&question=';
$import_page .= $question;
$import_page .= '&answere=';
$import_page .= $answer;
$import_page .= '&project_id=';
$import_page .= $proj_id;
if (ON == plugin_config_get('faq_view_check')) {
return array(plugin_lang_get('import_faq') => plugin_page($import_page) . '" target=_new>');
} else {
return array(plugin_lang_get('import_faq') => plugin_page($import_page));
}
}
}
}
示例14: display_commit_message
function display_commit_message($event, $bugid)
{
if (!$bugid) {
return;
}
$t_fields = config_get('bug_view_page_fields');
$t_fields = columns_filter_disabled($t_fields);
$tpl_show_id = in_array('id', $t_fields);
$tpl_show_description = in_array('description', $t_fields);
$tpl_show_status = in_array('status', $t_fields);
if ($tpl_show_id && $tpl_show_description && $tpl_show_status) {
bug_ensure_exists($bugid);
$bug = bug_get($bugid, true);
access_ensure_bug_level(VIEWER, $bugid);
$tpl_description = string_display_links($bug->summary);
$tpl_status = get_enum_element('status', $bug->status);
$tpl_link = config_get('path') . string_get_bug_view_url($bugid, null);
$message = sprintf('%s - #JJ%d: %s<br/>%s', strtoupper($tpl_status), $bugid, $tpl_description, $tpl_link);
echo '<tr ', helper_alternate_class(), '>';
echo '<td class="category">', plugin_lang_get('commit_message'), '</td>';
echo '<td colspan="5">' . $message . '</td>';
echo '</tr>';
}
}
示例15: array_reverse
$t_bug_revisions = array_reverse(bug_revision_list($t_bug_id), true);
$t_title = lang_get('issue_id') . $t_bug_id;
} else {
if ($f_bugnote_id) {
$t_bug_id = bugnote_get_field($f_bugnote_id, 'bug_id');
$t_bug_data = bug_get($t_bug_id, true);
$t_bug_revisions = bug_revision_list($t_bug_id, REV_ANY, $f_bugnote_id);
$t_title = lang_get('bugnote') . ' ' . $f_bugnote_id;
} else {
if ($f_rev_id) {
$t_bug_revisions = bug_revision_like($f_rev_id);
if (count($t_bug_revisions) < 1) {
trigger_error(ERROR_GENERIC, ERROR);
}
$t_bug_id = $t_bug_revisions[$f_rev_id]['bug_id'];
$t_bug_data = bug_get($t_bug_id, true);
$t_title = lang_get('issue_id') . $t_bug_id;
} else {
trigger_error(ERROR_GENERIC, ERROR);
}
}
}
function show_revision($t_revision)
{
static $s_can_drop = null;
static $s_drop_token = null;
static $s_user_access = null;
if (is_null($s_can_drop)) {
$s_can_drop = access_has_bug_level(config_get('bug_revision_drop_threshold'), $t_revision['bug_id']);
$s_drop_token = form_security_param('bug_revision_drop');
}