本文整理汇总了PHP中relationship_get_all_dest函数的典型用法代码示例。如果您正苦于以下问题:PHP relationship_get_all_dest函数的具体用法?PHP relationship_get_all_dest怎么用?PHP relationship_get_all_dest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了relationship_get_all_dest函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: relationship_get_all
/**
* get all relationships associated with the given bug
* @param integer $p_bug_id A bug identifier.
* @param boolean &$p_is_different_projects Returned Boolean value indicating if some relationships cross project boundaries.
* @return array Array of BugRelationshipData objects
*/
function relationship_get_all($p_bug_id, &$p_is_different_projects)
{
$t_src = relationship_get_all_src($p_bug_id);
$t_dest = relationship_get_all_dest($p_bug_id);
$t_all = array_merge($t_src, $t_dest);
$p_is_different_projects = false;
$t_count = count($t_all);
for ($i = 0; $i < $t_count; $i++) {
$p_is_different_projects |= $t_all[$i]->src_project_id != $t_all[$i]->dest_project_id;
}
return $t_all;
}
示例3: mci_issue_get_relationships
/**
* Get the relationships of an issue.
*
* @param integer $p_issue_id The id of the issue to retrieve the relationships for.
* @param integer $p_user_id The user id of the user trying to access the information.
* @return array that represents an RelationShipData structure
*/
function mci_issue_get_relationships($p_issue_id, $p_user_id)
{
$t_relationships = array();
$t_src_relationships = relationship_get_all_src($p_issue_id);
foreach ($t_src_relationships as $t_relship_row) {
if (access_has_bug_level(config_get('webservice_readonly_access_level_threshold'), $t_relship_row->dest_bug_id, $p_user_id)) {
$t_relationship = array();
$t_reltype = array();
$t_relationship['id'] = $t_relship_row->id;
$t_reltype['id'] = $t_relship_row->type;
$t_reltype['name'] = relationship_get_description_src_side($t_relship_row->type);
$t_relationship['type'] = $t_reltype;
$t_relationship['target_id'] = $t_relship_row->dest_bug_id;
$t_relationships[] = $t_relationship;
}
}
$t_dest_relationships = relationship_get_all_dest($p_issue_id);
foreach ($t_dest_relationships as $t_relship_row) {
if (access_has_bug_level(config_get('webservice_readonly_access_level_threshold'), $t_relship_row->src_bug_id, $p_user_id)) {
$t_relationship = array();
$t_relationship['id'] = $t_relship_row->id;
$t_reltype = array();
$t_reltype['id'] = relationship_get_complementary_type($t_relship_row->type);
$t_reltype['name'] = relationship_get_description_dest_side($t_relship_row->type);
$t_relationship['type'] = $t_reltype;
$t_relationship['target_id'] = $t_relship_row->src_bug_id;
$t_relationships[] = $t_relationship;
}
}
return count($t_relationships) == 0 ? null : $t_relationships;
}
示例4: custom_function_override_print_bug_view_page_custom_buttons
function custom_function_override_print_bug_view_page_custom_buttons($p_bug_id)
{
# Zuerst die lokalierten Buttontexte auslesen
if (lang_get_current() === 'german') {
$t_bfe_clone_issue_button = 'Klon in anderes Projekt...';
$t_bfe_edit_failure_class_button = 'Fehlerklasse bearbeiten...';
} else {
$t_bfe_clone_issue_button = 'Clone To Other Project...';
$t_bfe_edit_failure_class_button = 'Edit Failure Class...';
}
# Wenn Zugriff mindestens onsite developer, dann darf er Issues klonen
if (access_has_project_level(50)) {
echo '<td>';
html_button_bug_clone_to_project($p_bug_id, $t_bfe_clone_issue_button);
echo '</td>';
}
# Wenn Zugriff ändern von Fehlerklasse erlaubt, dann darf er sie ändern
# Aber nur bis Status 'bestätigt' (40=confirmed)
# Und nur für QS-Reporter (30) und ab Entwickler vor Ort (50) aufwärts
if (custom_field_has_write_access(1, $p_bug_id)) {
if (bug_get_field($p_bug_id, 'status') < 40) {
if (access_compare_level(access_get_project_level(), array(30, 50, 55, 70, 90))) {
echo '<td>';
$t_bfe_bugs[] = $p_bug_id;
$t_src = relationship_get_all_src($p_bug_id);
$t_src_count = count($t_src);
$t_dest = relationship_get_all_dest($p_bug_id);
$t_dest_count = count($t_dest);
if ($t_src_count || $t_dest_count) {
# Zunächst die Destination Bug IDs
for ($x = 0; $x < $t_src_count; $x++) {
$t_thisbugid = $t_src[$x]->dest_bug_id;
if (access_has_bug_level(50, $t_thisbugid)) {
$t_bfe_bugs[] = $t_thisbugid;
}
}
# und jetzt die Source Bug IDs
for ($y = 0; $y < $t_dest_count; $y++) {
$t_thisbugid = $t_dest[$y]->src_bug_id;
if (access_has_bug_level(50, $t_thisbugid)) {
$t_bfe_bugs[] = $t_thisbugid;
}
}
}
if (count($t_bfe_bugs) > 1) {
bfe_fehlerklasse_button('bug_actiongroup_page.php', $t_bfe_edit_failure_class_button, $t_bfe_bugs);
} else {
html_button('bug_actiongroup_page.php', $t_bfe_edit_failure_class_button, array('bug_arr[]' => $p_bug_id, 'action' => 'custom_field_1'));
}
echo '</td>';
}
}
}
}
示例5: relgraph_add_child
function relgraph_add_child(&$p_bug_list, $p_bug_id)
{
# Check if the issue is already in the issue list.
if (isset($p_bug_list[$p_bug_id])) {
# The issue is in the list, but we cannot discard it since it
# may be a parent issue (whose children were not visited).
if (!$p_bug_list[$p_bug_id]->is_descendant) {
# Yes, we visited this issue as a parent... This is the case
# where someone set up a cyclic relationship (I really hope
# nobody ever do this, but should keep sanity) for this
# issue. We just have to finish the job, visiting all issues
# that were already listed by _add_parent().
$p_bug_list[$p_bug_id]->is_descendant = true;
foreach ($p_bug_list[$p_bug_id]->children as $t_child) {
relgraph_add_child($p_bug_id, $t_child);
}
}
} else {
# The issue is not in the list, proceed as usual.
# Check if the issue really exists and we have access to it.
# If not, it is like it didn't exist.
if (!bug_exists($p_bug_id)) {
return false;
}
if (!access_has_bug_level(VIEWER, $p_bug_id)) {
return false;
}
# Add the issue to the list.
$p_bug_list[$p_bug_id] = bug_get($p_bug_id, false);
$p_bug_list[$p_bug_id]->is_descendant = true;
$p_bug_list[$p_bug_id]->parents = array();
$p_bug_list[$p_bug_id]->children = array();
# Add all parent issues to the list of parents. Do not visit them
# for the same reason we didn't visit the children of all
# ancestors.
$t_relationships = relationship_get_all_dest($p_bug_id);
foreach ($t_relationships as $t_relationship) {
if ($t_relationship->type != BUG_DEPENDANT) {
continue;
}
$p_bug_list[$p_bug_id]->parents[] = $t_relationship->src_bug_id;
}
# Add all child issues to the list of children and visit them
# recursively.
$t_relationships = relationship_get_all_src($p_bug_id);
foreach ($t_relationships as $t_relationship) {
if ($t_relationship->type != BUG_DEPENDANT) {
continue;
}
$p_bug_list[$p_bug_id]->children[] = $t_relationship->dest_bug_id;
relgraph_add_child($p_bug_list, $t_relationship->dest_bug_id);
}
}
return true;
}
示例6: bfebugnote
function bfebugnote($t_event, $t_bug_id, $t_bugnote_id, $t_bugnote_is_private)
{
if ($t_bugnote_is_private) {
# WK: zwei neue CSS-Klassen für unsere zusätzlichen Links
$t_bugnote_bfe_css = 'bugnote-bfe-private';
$t_spacer_bfe_css = 'spacer-bfe-private';
} else {
# WK: zwei weitere CSS-Klassen für unsere zusätzlichen Links
$t_bugnote_bfe_css = 'bugnote-bfe-public';
$t_spacer_bfe_css = 'spacer-bfe-public';
}
# Mod WK/BFE: Diese Links sind die neue BFE-Funktion Notiz klonen. Nur ab Recht 'Projekte bearbeiten' oder ab Rolle 'Entwickler vor Ort'
if (!bug_is_readonly($t_bug_id)) {
if (access_has_bug_level(config_get('manage_project_threshold'), $t_bug_id) || access_has_project_level(50)) {
$t_src = relationship_get_all_src($t_bug_id);
$t_src_count = count($t_src);
$t_dest = relationship_get_all_dest($t_bug_id);
$t_dest_count = count($t_dest);
if ($t_src_count || $t_dest_count) {
echo '<tr class="row-1">';
echo ' <td class="' . $t_bugnote_bfe_css . '" colspan="2">';
# Zunächst die Destination Bug IDs
for ($z = 0; $z < $t_src_count; $z++) {
$t_thisbugid = $t_src[$z]->dest_bug_id;
$t_thisbugsumm = bug_get_field($t_thisbugid, 'summary');
$t_thisprojectid = bug_get_field($t_thisbugid, 'project_id');
echo '<a href="view.php?id=' . $t_thisbugid . '&bugnote_id=' . $t_bugnote_id . '#bugnotes">';
echo "Notiz klonen in Issue ";
echo bug_format_id($t_thisbugid) . ': ' . $t_thisbugsumm . ' [' . project_get_field($t_thisprojectid, 'name') . ']</a><br />';
}
# und jetzt die Source Bug IDs
for ($z = 0; $z < $t_dest_count; $z++) {
$t_thisbugid = $t_dest[$z]->src_bug_id;
$t_thisbugsumm = bug_get_field($t_thisbugid, 'summary');
$t_thisprojectid = bug_get_field($t_thisbugid, 'project_id');
echo '<a href="view.php?id=' . $t_thisbugid . '&bugnote_id=' . $t_bugnote_id . '#bugnotes">';
echo "Notiz klonen in Issue ";
echo bug_format_id($t_thisbugid) . ': ' . $t_thisbugsumm . ' [' . project_get_field($t_thisprojectid, 'name') . ']</a><br />';
}
echo ' </td>';
echo '</tr>';
}
}
}
echo '<tr class="' . $t_spacer_bfe_css . '" />';
}