本文整理汇总了PHP中bug_exists函数的典型用法代码示例。如果您正苦于以下问题:PHP bug_exists函数的具体用法?PHP bug_exists怎么用?PHP bug_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bug_exists函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_function_default_checkin
function custom_function_default_checkin($p_issue_id, $p_comment, $p_file, $p_new_version, $p_fixed)
{
if (bug_exists($p_issue_id)) {
history_log_event_special($p_issue_id, CHECKIN, $p_file, $p_new_version);
bugnote_add($p_issue_id, $p_comment, VS_PRIVATE == config_get('source_control_notes_view_status'));
$t_status = config_get('source_control_set_status_to');
if (OFF != $t_status && $p_fixed) {
bug_set_field($p_issue_id, 'status', $t_status);
bug_set_field($p_issue_id, 'resolution', config_get('source_control_set_resolution_to'));
}
}
}
示例2: 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;
}
示例3: process_content
/**
* @param PDF $pdf
* @param $bug_ids
* @param $version_date
* @param $chapter_prefix
* @param $option_show_duration
* @param $detail_flag
*/
function process_content(PDF $pdf, $bug_ids, $version_date, $chapter_prefix, $option_show_duration, $detail_flag)
{
$specmanagement_editor_api = new specmanagement_editor_api();
$bug_counter = 10;
foreach ($bug_ids as $bug_id) {
if (bug_exists($bug_id)) {
$bug_data = $specmanagement_editor_api->calculate_bug_data($bug_id, $version_date);
if ($detail_flag) {
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(95, 10, $chapter_prefix . '.' . $bug_counter . ' ' . utf8_decode(string_display($bug_data[1]) . ' (' . bug_format_id($bug_data[0])) . ')');
$pdf->SetFont('Arial', '', 12);
if ($option_show_duration == '1' && !($bug_data[7] == 0 || is_null($bug_data[7]))) {
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(95, 10, plugin_lang_get('editor_bug_duration') . ': ' . $bug_data[7] . ' ' . plugin_lang_get('editor_duration_unit'), '', 0, 0);
$pdf->SetFont('Arial', '', 12);
}
$pdf->Ln();
$pdf->MultiCell(0, 10, utf8_decode(trim($bug_data[2])), 0, 1);
$pdf->MultiCell(0, 10, utf8_decode(trim($bug_data[3])), 0, 1);
$pdf->MultiCell(0, 10, utf8_decode(trim($bug_data[4])), 0, 1);
if (!empty($bug_data[5])) {
$bug_attachements = file_get_visible_attachments($bug_id);
$bug_attachements_count = count($bug_attachements);
$pdf->MultiCell(0, 10, utf8_decode(plugin_lang_get('editor_bug_attachments')) . ' (' . $bug_attachements_count . ')', 0, 1);
foreach ($bug_attachements as $bug_attachement) {
// var_dump( $bug_attachement );
/** TODO: Bilder anzeigen */
if ($bug_attachement['type'] == 'image') {
$file_download_url = config_get_global('path') . $bug_attachement['download_url'];
// $file_download_url = 'https://upload.wikimedia.org/wikipedia/commons/c/c6/Bayerischer_Wald_-_Aufichtenwald_001.jpg';
fopen($file_download_url, 'r');
$contents = file_get_contents($file_download_url);
$savename = '_' . $bug_attachement['id'] . $bug_attachement['display_name'];
$savefile = fopen($savename, 'w');
fwrite($savefile, $contents);
fclose($savefile);
// $pdf->Image( $savename );
}
}
}
if (!is_null($bug_data[6]) && $bug_data[6] != 0) {
$pdf->MultiCell(0, 10, utf8_decode(plugin_lang_get('editor_bug_notes_note')) . ' (' . $bug_data[6] . ')', 0, 1);
}
} else {
$pdf->Cell(95, 10, $chapter_prefix . '.' . $bug_counter . ' ' . utf8_decode(string_display($bug_data[1]) . ' (' . bug_format_id($bug_data[0])) . ')', 0, 0);
$pdf->Cell(95, 10, $pdf->PageNo(), 0, 1, 'R');
}
$bug_counter += 10;
}
}
}
示例4: Source_Process_Changesets
/**
* Given a set of changeset objects, parse the bug links
* and save the changes.
* @param array Changeset objects
* @param object Repository object
*/
function Source_Process_Changesets($p_changesets, $p_repo = null)
{
global $g_cache_current_user_id;
if (!is_array($p_changesets)) {
return;
}
if (is_null($p_repo)) {
$t_repos = SourceRepo::load_by_changesets($p_changesets);
} else {
$t_repos = array($p_repo->id => $p_repo);
}
$t_resolved_threshold = config_get('bug_resolved_status_threshold');
$t_fixed_threshold = config_get('bug_resolution_fixed_threshold');
$t_notfixed_threshold = config_get('bug_resolution_not_fixed_threshold');
# Link author and committer name/email to user accounts
foreach ($p_changesets as $t_key => $t_changeset) {
$p_changesets[$t_key] = Source_Parse_Users($t_changeset);
}
# Parse normal bug links
foreach ($p_changesets as $t_changeset) {
$t_changeset->bugs = Source_Parse_Buglinks($t_changeset->message);
}
# Parse fixed bug links
$t_fixed_bugs = array();
# Find and associate resolve links with the changeset
foreach ($p_changesets as $t_changeset) {
$t_bugs = Source_Parse_Bugfixes($t_changeset->message);
foreach ($t_bugs as $t_bug_id) {
$t_fixed_bugs[$t_bug_id] = $t_changeset;
}
# Add the link to the normal set of buglinks
$t_changeset->bugs = array_unique(array_merge($t_changeset->bugs, $t_bugs));
}
# Save changeset data before processing their consequences
foreach ($p_changesets as $t_changeset) {
$t_changeset->repo = $p_repo;
$t_changeset->save();
}
# Precache information for resolved bugs
bug_cache_array_rows(array_keys($t_fixed_bugs));
$t_current_user_id = $g_cache_current_user_id;
$t_enable_resolving = config_get('plugin_Source_enable_resolving');
$t_enable_message = config_get('plugin_Source_enable_message');
$t_enable_mapping = config_get('plugin_Source_enable_mapping');
$t_bugfix_status = config_get('plugin_Source_bugfix_status');
$t_bugfix_status_pvm = config_get('plugin_Source_bugfix_status_pvm');
$t_resolution = config_get('plugin_Source_bugfix_resolution');
$t_handler = config_get('plugin_Source_bugfix_handler');
$t_message_template = str_replace(array('$1', '$2', '$3', '$4', '$5', '$6'), array('%1$s', '%2$s', '%3$s', '%4$s', '%5$s', '%6$s'), config_get('plugin_Source_bugfix_message'));
$t_mappings = array();
# Start fixing and/or resolving issues
foreach ($t_fixed_bugs as $t_bug_id => $t_changeset) {
# make sure the bug exists before processing
if (!bug_exists($t_bug_id)) {
continue;
}
# fake the history entries as the committer/author user ID
$t_user_id = null;
if ($t_changeset->committer_id > 0) {
$t_user_id = $t_changeset->committer_id;
} else {
if ($t_changeset->user_id > 0) {
$t_user_id = $t_changeset->user_id;
}
}
if (!is_null($t_user_id)) {
$g_cache_current_user_id = $t_user_id;
} else {
if (!is_null($t_current_user_id)) {
$g_cache_current_user_id = $t_current_user_id;
} else {
$g_cache_current_user_id = 0;
}
}
# generate the branch mappings
$t_version = '';
$t_pvm_version_id = 0;
if ($t_enable_mapping) {
$t_repo_id = $t_changeset->repo_id;
if (!isset($t_mappings[$t_repo_id])) {
$t_mappings[$t_repo_id] = SourceMapping::load_by_repo($t_repo_id);
}
if (isset($t_mappings[$t_repo_id][$t_changeset->branch])) {
$t_mapping = $t_mappings[$t_repo_id][$t_changeset->branch];
if (Source_PVM()) {
$t_pvm_version_id = $t_mapping->apply_pvm($t_bug_id);
} else {
$t_version = $t_mapping->apply($t_bug_id);
}
}
}
# generate a note message
if ($t_enable_message) {
$t_message = sprintf($t_message_template, $t_changeset->branch, $t_changeset->revision, $t_changeset->timestamp, $t_changeset->message, $t_repos[$t_changeset->repo_id]->name, $t_changeset->id);
//.........这里部分代码省略.........
示例5: mci_check_access_to_bug
/**
* Check if the bug exists and the user has a access right to read it.
*
* @param integer $p_user_id The user id.
* @param integer $p_bug_id The bug id.
* @return true if the user has access rights and the bug exists, otherwise return false
*/
function mci_check_access_to_bug($p_user_id, $p_bug_id)
{
if (!bug_exists($p_bug_id)) {
return false;
}
$t_project_id = bug_get_field($p_bug_id, 'project_id');
$g_project_override = $t_project_id;
if (!mci_has_readonly_access($p_user_id, $t_project_id)) {
return false;
}
if (!access_has_bug_level(config_get('view_bug_threshold', null, null, $t_project_id), $p_bug_id, $p_user_id)) {
return false;
}
return true;
}
示例6: history_get_raw_events_array
//.........这里部分代码省略.........
# @@@ by MASC I guess it's better by id then by field_name. When we have more history lines with the same
# date, it's better to respect the storing order otherwise we should risk to mix different information
# I give you an example. We create a child of a bug with different custom fields. In the history of the child
# bug we will find the line related to the relationship mixed with the custom fields (the history is creted
# for the new bug with the same timestamp...)
$query = "SELECT *\n\t\t\t\tFROM {$t_mantis_bug_history_table}\n\t\t\t\tWHERE bug_id=" . db_param() . "\n\t\t\t\tORDER BY date_modified {$t_history_order},id";
$result = db_query_bound($query, array($c_bug_id));
$raw_history_count = db_num_rows($result);
$raw_history = array();
$t_private_bugnote_threshold = config_get('private_bugnote_threshold');
$t_private_bugnote_visible = access_has_bug_level(config_get('private_bugnote_threshold'), $p_bug_id, $t_user_id);
$t_tag_view_threshold = config_get('tag_view_threshold');
$t_view_attachments_threshold = config_get('view_attachments_threshold');
$t_show_monitor_list_threshold = config_get('show_monitor_list_threshold');
$t_show_handler_threshold = config_get('view_handler_threshold');
$t_standard_fields = columns_get_standard();
for ($i = 0, $j = 0; $i < $raw_history_count; ++$i) {
$t_row = db_fetch_array($result);
$v_type = $t_row['type'];
$v_field_name = $t_row['field_name'];
$v_user_id = $t_row['user_id'];
$v_new_value = $t_row['new_value'];
$v_old_value = $t_row['old_value'];
$v_date_modified = $t_row['date_modified'];
if ($v_type == NORMAL_TYPE) {
if (!in_array($v_field_name, $t_standard_fields)) {
# check that the item should be visible to the user
# We are passing 32 here to notify the custom field API
# that legacy history entries for field names longer than
# 32 chars created when the db column was of that size were
# truncated (no longer the case since 1.1.0a4, see #8002)
$t_field_id = custom_field_get_id_from_name($v_field_name, 32);
if (false !== $t_field_id && !custom_field_has_read_access($t_field_id, $p_bug_id, $t_user_id)) {
continue;
}
}
if ($v_field_name == 'target_version' && !access_has_bug_level($t_roadmap_view_access_level, $p_bug_id, $t_user_id)) {
continue;
}
if ($v_field_name == 'due_date' && !access_has_bug_level($t_due_date_view_threshold, $p_bug_id, $t_user_id)) {
continue;
}
if ($v_field_name == 'handler_id' && !access_has_bug_level($t_show_handler_threshold, $p_bug_id, $t_user_id)) {
continue;
}
}
// bugnotes
if ($t_user_id != $v_user_id) {
// bypass if user originated note
if ($v_type == BUGNOTE_ADDED || $v_type == BUGNOTE_UPDATED || $v_type == BUGNOTE_DELETED) {
if (!$t_private_bugnote_visible && bugnote_get_field($v_old_value, 'view_state') == VS_PRIVATE) {
continue;
}
}
if ($v_type == BUGNOTE_STATE_CHANGED) {
if (!$t_private_bugnote_visible && bugnote_get_field($v_new_value, 'view_state') == VS_PRIVATE) {
continue;
}
}
}
// tags
if ($v_type == TAG_ATTACHED || $v_type == TAG_DETACHED || $v_type == TAG_RENAMED) {
if (!access_has_bug_level($t_tag_view_threshold, $p_bug_id, $t_user_id)) {
continue;
}
}
# attachments
if ($v_type == FILE_ADDED || $v_type == FILE_DELETED) {
if (!access_has_bug_level($t_view_attachments_threshold, $p_bug_id, $t_user_id)) {
continue;
}
}
// monitoring
if ($v_type == BUG_MONITOR || $v_type == BUG_UNMONITOR) {
if (!access_has_bug_level($t_show_monitor_list_threshold, $p_bug_id, $t_user_id)) {
continue;
}
}
# relationships
if ($v_type == BUG_ADD_RELATIONSHIP || $v_type == BUG_DEL_RELATIONSHIP || $v_type == BUG_REPLACE_RELATIONSHIP) {
$t_related_bug_id = $v_new_value;
# If bug doesn't exist, then we don't know whether to expose it or not based on the fact whether it was
# accessible to user or not. This also simplifies client code that is accessing the history log.
if (!bug_exists($t_related_bug_id) || !access_has_bug_level(VIEWER, $t_related_bug_id, $t_user_id)) {
continue;
}
}
$raw_history[$j]['date'] = $v_date_modified;
$raw_history[$j]['userid'] = $v_user_id;
# user_get_name handles deleted users, and username vs realname
$raw_history[$j]['username'] = user_get_name($v_user_id);
$raw_history[$j]['field'] = $v_field_name;
$raw_history[$j]['type'] = $v_type;
$raw_history[$j]['old_value'] = $v_old_value;
$raw_history[$j]['new_value'] = $v_new_value;
$j++;
}
# end for loop
return $raw_history;
}
示例7: bug_ensure_exists
/**
* Check if a bug exists. If it doesn't then trigger an error
* @param int p_bug_id integer representing bug id
* @return null
* @access public
*/
function bug_ensure_exists($p_bug_id)
{
if (!bug_exists($p_bug_id)) {
error_parameters($p_bug_id);
trigger_error(ERROR_BUG_NOT_FOUND, ERROR);
}
}
示例8: get_workpackage_by_bug_id
/**
* @param $bug_id
*/
public function get_workpackage_by_bug_id($bug_id)
{
$plugin_src_table = $this->get_mantis_plugin_table('src');
if (bug_exists($bug_id)) {
$query = "SELECT work_package FROM {$plugin_src_table}\n WHERE bug_id = " . $bug_id;
var_dump($query);
$result = $this->mysqli->query($query);
if (0 != $result->num_rows) {
$row = mysqli_fetch_row($result);
$work_package = $row[0];
return $work_package;
}
}
}
开发者ID:Cre-ator,项目名称:Whiteboard.SpecificationManagement-Plugin,代码行数:17,代码来源:specmanagement_database_api.php
示例9: relationship_get_details
function relationship_get_details($p_bug_id, $p_relationship, $p_html = false, $p_html_preview = false, $p_show_project = false)
{
$t_summary_wrap_at = strlen(config_get('email_separator2')) - 28;
$t_icon_path = config_get('icon_path');
$p_user_id = auth_get_current_user_id();
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_related_project_name = project_get_name($p_relationship->dest_project_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_related_project_name = project_get_name($p_relationship->src_project_id);
$t_relationship_descr = relationship_get_description_dest_side($p_relationship->type);
}
# related bug not existing...
if (!bug_exists($t_related_bug_id)) {
return '';
}
# user can access to the related bug at least as a viewer
if (!access_has_bug_level(VIEWER, $t_related_bug_id)) {
return '';
}
if ($p_html_preview == false) {
$t_td = '<td>';
} else {
$t_td = '<td class="print">';
}
# get the information from the related bug and prepare the link
$t_bug = bug_prepare_display(bug_get($t_related_bug_id, true));
$t_status = string_attribute(get_enum_element('status', $t_bug->status));
$t_resolution = string_attribute(get_enum_element('resolution', $t_bug->resolution));
$t_relationship_info_html = $t_td . '<nobr>' . $t_relationship_descr . '</nobr> </td>';
if ($p_html_preview == false) {
$t_relationship_info_html .= '<td><a href="' . string_get_bug_view_url($t_related_bug_id) . '">' . bug_format_id($t_related_bug_id) . '</a></td>';
$t_relationship_info_html .= '<td><a title="' . $t_resolution . '"><u>' . $t_status . '</u> </a></td>';
} else {
$t_relationship_info_html .= $t_td . bug_format_id($t_related_bug_id) . '</td>';
$t_relationship_info_html .= $t_td . $t_status . ' </td>';
}
$t_relationship_info_text = str_pad($t_relationship_descr, 20);
$t_relationship_info_text .= str_pad(bug_format_id($t_related_bug_id), 8);
# get the handler name of the related bug
$t_relationship_info_html .= $t_td;
if ($t_bug->handler_id > 0) {
$t_relationship_info_html .= '<nobr>' . prepare_user_name($t_bug->handler_id) . '</nobr>';
}
$t_relationship_info_html .= ' </td>';
# add project name
if ($p_show_project) {
$t_relationship_info_html .= $t_td . $t_related_project_name . ' </td>';
}
# add summary
$t_relationship_info_html .= $t_td . $t_bug->summary;
if (VS_PRIVATE == $t_bug->view_state) {
$t_relationship_info_html .= sprintf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private'));
}
if (strlen($t_bug->summary) <= $t_summary_wrap_at) {
$t_relationship_info_text .= $t_bug->summary;
} else {
$t_relationship_info_text .= substr($t_bug->summary, 0, $t_summary_wrap_at - 3) . '...';
}
# add delete link if bug not read only and user has access level
if (!bug_is_readonly($p_bug_id) && !current_user_is_anonymous() && $p_html_preview == false) {
if (access_has_bug_level(config_get('update_bug_threshold'), $p_bug_id)) {
$t_relationship_info_html .= " [<a class=\"small\" href=\"bug_relationship_delete.php?bug_id={$p_bug_id}&rel_id={$p_relationship->id}\">" . lang_get('delete_link') . '</a>]';
}
}
$t_relationship_info_html .= ' </td>';
$t_relationship_info_text .= "\n";
if ($p_html_preview == false) {
$t_relationship_info_html = '<tr bgcolor="' . get_status_color($t_bug->status) . '">' . $t_relationship_info_html . '</tr>' . "\n";
} else {
$t_relationship_info_html = '<tr>' . $t_relationship_info_html . '</tr>';
}
if ($p_html == true) {
return $t_relationship_info_html;
} else {
return $t_relationship_info_text;
}
}
示例10: getProductBacklogByBugId
function getProductBacklogByBugId($p_bug_id)
{
if (bug_exists($p_bug_id)) {
$this->getAdditionalProjectFields();
$t_value = custom_field_get_value($this->pb, $p_bug_id);
if (!empty($t_value)) {
$t_sql = "SELECT * FROM gadiv_productbacklogs WHERE name=" . db_param(0);
$t_result = $this->executeQuery($t_sql, array($t_value));
if (count($t_result) > 0) {
return $t_result[0];
}
}
}
return null;
}
示例11: Copyright
<?php
# Copyright (c) 2012 John Reese
# Licensed under the MIT license
form_security_validate('plugin_Source_attach');
access_ensure_global_level(plugin_config_get('update_threshold'));
$f_changeset_id = gpc_get_int('id');
$f_bug_ids = gpc_get_string('bug_ids');
$t_changeset = SourceChangeset::load($f_changeset_id);
$t_changeset->load_bugs();
$t_user_id = auth_get_current_user_id();
$t_bug_ids = explode(',', $f_bug_ids);
foreach ($t_bug_ids as $t_bug_id) {
$t_bug_id = (int) $t_bug_id;
if ($t_bug_id < 1 || !bug_exists($t_bug_id)) {
continue;
}
if (!in_array($t_bug_id, $t_changeset->bugs)) {
$t_changeset->bugs[] = $t_bug_id;
}
}
$t_changeset->save_bugs($t_user_id);
form_security_purge('plugin_Source_attach');
print_successful_redirect(plugin_page('view', true) . '&id=' . $t_changeset->id);
示例12: mc_issue_checkin
/**
* Log a checkin event on the 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 log a checkin.
* @param string $p_comment The comment to add
* @param boolean $p_fixed True if the issue is to be set to fixed
* @return boolean true success, false otherwise.
*/
function mc_issue_checkin($p_username, $p_password, $p_issue_id, $p_comment, $p_fixed)
{
global $g_project_override;
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return mci_soap_fault_login_failed();
}
if (!bug_exists($p_issue_id)) {
return SoapObjectsFactory::newSoapFault('Client', "Issue '{$p_issue_id}' not found.");
}
$t_project_id = bug_get_field($p_issue_id, 'project_id');
$g_project_override = $t_project_id;
if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
helper_call_custom_function('checkin', array($p_issue_id, $p_comment, '', '', $p_fixed));
return true;
}
示例13: session_validate_form_get_field
$req_id = $_POST["req_id"];
$req_version_id = $_POST["req_ver_id"];
$reason_for_change = session_validate_form_get_field("req_reason_change", "", session_use_FCKeditor());
$req_name = session_validate_form_get_field('req_name_required');
$req_area = session_validate_form_get_field('req_area');
$req_type = session_validate_form_get_field('req_type');
$req_status = session_validate_form_get_field('req_status');
$req_functionality = session_validate_form_get_field("req_functionality");
$req_priority = session_validate_form_get_field("req_priority");
$req_release = session_validate_form_get_field("assigned_release");
$req_defect_id = session_validate_form_get_field("defect_id");
if ($req_defect_id == '') {
$req_defect_id = 0;
}
# return the user to the previous page if the new_bug_id doesn't exist in the bug table
if (!bug_exists($req_defect_id) && $req_defect_id != 0) {
html_redirect($redirect_on_error);
}
requirement_edit($project_id, $req_id, $req_version_id, $req_defect_id, $req_name, $req_area, $req_type, $req_status, $detail, $reason_for_change, $req_functionality, $req_priority, $req_release);
session_validate_form_reset();
############################################################################
# EMAIL NOTIFICATION
############################################################################
$recipients = requirement_get_notify_users($project_id, $req_id);
requirement_email($project_id, $req_id, $recipients, $action = "updated");
############################################################################
############################################################################
html_print_operation_successful('req_edit_page', "requirement_detail_page.php");
# ---------------------------------------------------------------------
# $Log: requirement_edit_action.php,v $
# Revision 1.6 2006/09/27 23:58:33 gth2
示例14: bug_actions
/**
* Send message bug_actions.
*/
function bug_actions($p_event, $p_event_str, $p_bug_id)
{
if (!bug_exists($p_bug_id)) {
return;
}
if (check_user_from_projects_table($p_bug_id)) {
$f_action = gpc_get_string('action');
switch ($f_action) {
case 'CLOSE':
if (ON == plugin_config_get('send_mes_new_state_90')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
$bugnote_text = gpc_get_string('bugnote_text', '');
send_msg(get_xmpp_login($reporter_user_id), gen_close_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case 'MOVE':
if (ON == plugin_config_get('send_mes_move_bug')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
send_msg(get_xmpp_login($reporter_user_id), gen_move_bug_msg($reporter_user_id, $p_bug_id));
}
break;
case 'RESOLVE':
if (ON == plugin_config_get('send_mes_new_state_80')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
$bugnote_text = gpc_get_string('bugnote_text', '');
send_msg(get_xmpp_login($reporter_user_id), gen_resolve_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case 'ASSIGN':
if (ON == plugin_config_get('send_mes_new_assign')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
send_msg(get_xmpp_login($reporter_user_id), gen_assign_bug_msg_in($reporter_user_id, $p_bug_id));
send_msg(get_xmpp_login(gpc_get_int('assign')), gen_assign_bug_msg_out($reporter_user_id, $p_bug_id));
}
break;
case 'UP_PRIOR':
if (ON == plugin_config_get('send_mes_up_prior')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
send_msg(get_xmpp_login($reporter_user_id), gen_up_priority_bug_msg($reporter_user_id, $p_bug_id));
}
break;
case 'UP_STATUS':
if (ON == plugin_config_get('send_mes_up_status')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
$bugnote_text = gpc_get_string('bugnote_text', '');
$status = gpc_get_int('status');
switch ($status) {
case '10':
if (ON == plugin_config_get('send_mes_new_state_10')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case '20':
if (ON == plugin_config_get('send_mes_new_state_20')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case '30':
if (ON == plugin_config_get('send_mes_new_state_30')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case '40':
if (ON == plugin_config_get('send_mes_new_state_40')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case '50':
if (ON == plugin_config_get('send_mes_new_state_50')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case '80':
if (ON == plugin_config_get('send_mes_new_state_80')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
case '90':
if (ON == plugin_config_get('send_mes_new_state_90')) {
send_msg(get_xmpp_login($reporter_user_id), gen_up_status_bug_msg($reporter_user_id, $p_bug_id, $bugnote_text));
}
break;
}
}
break;
case 'UP_CATEGORY':
if (gpc_get_int('category') != 0 && ON == plugin_config_get('send_mes_up_category')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
send_msg(get_xmpp_login($reporter_user_id), gen_up_category_bug_msg($reporter_user_id, $p_bug_id));
}
break;
case 'VIEW_STATUS':
if (ON == plugin_config_get('send_mes_up_view')) {
$reporter_user_id = bug_get_field($p_bug_id, 'reporter_id');
send_msg(get_xmpp_login($reporter_user_id), gen_up_view_status_bug_msg($reporter_user_id, $p_bug_id));
}
break;
//.........这里部分代码省略.........
示例15: mc_issue_relationship_delete
/**
* Delete the relationship with the specified target id.
*
* @param string $p_username The name of the user trying to add a note to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the source issue for the relationship
* @param integer $p_relationship_id The id of relationship to delete.
* @return true: success, false: failure
*/
function mc_issue_relationship_delete( $p_username, $p_password, $p_issue_id, $p_relationship_id ) {
$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
return mci_soap_fault_login_failed();
}
$t_project_id = bug_get_field( $p_issue_id, 'project_id' );
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
return mci_soap_fault_access_denied( $t_user_id );
}
# user has access to update the bug...
if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $p_issue_id, $t_user_id ) ) {
return mci_soap_fault_access_denied( $t_user_id , "Active user does not have access level required to remove a relationship from this issue." );
}
# bug is not read-only...
if( bug_is_readonly( $p_issue_id ) ) {
return mci_soap_fault_access_denied( $t_user_id , "Issue '$p_issue_id' is readonly." );
}
# retrieve the destination bug of the relationship
$t_dest_issue_id = relationship_get_linked_bug_id( $p_relationship_id, $p_issue_id );
# user can access to the related bug at least as viewer, if it's exist...
if( bug_exists( $t_dest_issue_id ) ) {
if( !access_has_bug_level( VIEWER, $t_dest_issue_id, $t_user_id ) ) {
return mci_soap_fault_access_denied( $t_user_id , "The issue '$t_dest_issue_id' requires higher access level." );
}
}
$t_bug_relationship_data = relationship_get( $p_relationship_id );
$t_rel_type = $t_bug_relationship_data->type;
# delete relationship from the DB
relationship_delete( $p_relationship_id );
# update bug last updated
bug_update_date( $p_issue_id );
bug_update_date ( $t_dest_issue_id );
# set the rel_type for both bug and dest_bug based on $t_rel_type and on who is the dest bug
if( $p_issue_id == $t_bug_relationship_data->src_bug_id ) {
$t_bug_rel_type = $t_rel_type;
$t_dest_bug_rel_type = relationship_get_complementary_type( $t_rel_type );
} else {
$t_bug_rel_type = relationship_get_complementary_type( $t_rel_type );
$t_dest_bug_rel_type = $t_rel_type;
}
# send email and update the history for the src issue
history_log_event_special( $p_issue_id, BUG_DEL_RELATIONSHIP, $t_bug_rel_type, $t_dest_issue_id );
email_relationship_deleted( $p_issue_id, $t_dest_issue_id, $t_bug_rel_type );
if( bug_exists( $t_dest_issue_id ) ) {
# send email and update the history for the dest issue
history_log_event_special( $t_dest_issue_id, BUG_DEL_RELATIONSHIP, $t_dest_bug_rel_type, $p_issue_id );
email_relationship_deleted( $t_dest_issue_id, $p_issue_id, $t_dest_bug_rel_type );
}
return true;
}