Procedural File: relationship_api.php
Source Location: /core/relationship_api.php
Classes:
BugRelationshipData
RelationshipData Structure Definition
Page Details:
Relationship API
RELATIONSHIP DEFINITIONS * Child/parent relationship: the child bug is generated by the parent bug or is directly linked with the parent with the following meaning the child bug has to be resolved before resolving the parent bug (the child bug "blocks" the parent bug) example: bug A is child bug of bug B. It means: A blocks B and B is blocked by A * General relationship: two bugs related each other without any hierarchy dependance bugs A and B are related * Duplicates: it's used to mark a bug as duplicate of an other bug already stored in the database bug A is marked as duplicate of B. It means: A duplicates B, B has duplicates Relations are always visible in the email body -------------------------------------------------------------------- ADD NEW RELATIONSHIP - Permission: user can update the source bug and at least view the destination bug
- Action recorded in the history of both the bugs
- Email notification sent to the users of both the bugs based based on the 'updated' bug notify type.
- -------------------------------------------------------
DELETE RELATIONSHIP - Permission: user can update the source bug and at least view the destination bug
- Action recorded in the history of both the bugs
- Email notification sent to the users of both the bugs based based on the 'updated' bug notify type.
- -------------------------------------------------------
RESOLVE/CLOSE BUGS WITH BLOCKING CHILD BUGS STILL OPEN Just a warning is print out on the form when an user attempts to resolve or close a bug with related bugs in relation BUG_DEPENDANT still not resolved. Anyway the user can force the resolving/closing action. -------------------------------------------------------- EMAIL NOTIFICATION TO PARENT BUGS WHEN CHILDREN BUGS ARE RESOLVED/CLOSED Every time a child bug is resolved or closed, an email notification is sent directly to all the handlers of the parent bugs. The notification is sent to bugs not already marked as resolved or closed. -------------------------------------------------------- ADD CHILD This function gives the opportunity to generate a child bug. In details the function: - create a new bug with the same basic information of the parent bug (plus the custom fields)
- copy all the attachment of the parent bug to the child
- not copy history, bugnotes, monitoring users
- set a relationship between parent and child
Tags:
Includes:
relationship_add [line 160]
BugRelationshipData relationship_add(
int $p_src_bug_id, int $p_dest_bug_id, int $p_relationship_type)
|
|
Add a new relationship
Tags:
Parameters
int |
$p_src_bug_id |
Source Bug Id |
int |
$p_dest_bug_id |
Destination Bug Id |
int |
$p_relationship_type |
Relationship type |
relationship_can_resolve_bug [line 557]
bool relationship_can_resolve_bug(
int $p_bug_id)
|
|
return false if there are child bugs not resolved/closed N.B. we don't check if the parent bug is read-only. This is because the answer of this function is indepedent from the state of the parent bug itself.
Parameters
relationship_copy_all [line 264]
void relationship_copy_all(
int $p_bug_id, int $p_new_bug_id)
|
|
copy all the relationships related to a specific bug to a new bug
Parameters
int |
$p_bug_id |
Source Bug Id |
int |
$p_new_bug_id |
Destination Bug Id |
relationship_delete [line 234]
void relationship_delete(
int $p_relationship_id)
|
|
Delete a relationship
Parameters
int |
$p_relationship_id |
Relationship Id to update |
relationship_delete_all [line 248]
void relationship_delete_all(
int $p_bug_id)
|
|
Deletes all the relationships related to a specific bug (both source and destination)
Parameters
relationship_exists [line 429]
int relationship_exists(
int $p_src_bug_id, int $p_dest_bug_id)
|
|
check if there is a relationship between two bugs return id if found 0 otherwise
Tags:
Parameters
int |
$p_src_bug_id |
Source Bug Id |
int |
$p_dest_bug_id |
Destination Bug Id |
relationship_get [line 290]
get a relationship from id
Tags:
Parameters
int |
$p_relationship_id |
Relationship ID |
relationship_get_all [line 409]
array relationship_get_all(
int $p_bug_id, bool &$p_is_different_projects)
|
|
get all relationships associated with the given bug
Tags:
Parameters
int |
$p_bug_id |
Bug id |
bool |
&$p_is_different_projects |
Returned Boolean value indicating if some relationships cross project boundaries |
relationship_get_all_dest [line 364]
array relationship_get_all_dest(
int $p_dest_bug_id)
|
|
get all relationships with the given bug as destination
Tags:
Parameters
int |
$p_dest_bug_id |
Destination Bug id |
relationship_get_all_src [line 320]
array relationship_get_all_src(
int $p_src_bug_id)
|
|
get all relationships with the given bug as source
Tags:
Parameters
int |
$p_src_bug_id |
Source Bug id |
relationship_get_complementary_type [line 145]
int relationship_get_complementary_type(
int $p_relationship_type)
|
|
Return the complementary type of the provided relationship
Tags:
Parameters
int |
$p_relationship_type |
Relationship type |
relationship_get_description_dest_side [line 533]
string relationship_get_description_dest_side(
int $p_relationship_type)
|
|
get class description of a relationship (destination side)
Tags:
Parameters
int |
$p_relationship_type |
Relationship type |
relationship_get_description_for_history [line 546]
string relationship_get_description_for_history(
int $p_relationship_code)
|
|
get class description of a relationship as it's stored in the history
Tags:
Parameters
int |
$p_relationship_code |
Relationship Type |
relationship_get_description_src_side [line 520]
string relationship_get_description_src_side(
int $p_relationship_type)
|
|
get class description of a relationship (source side)
Tags:
Parameters
int |
$p_relationship_type |
Relationship type |
relationship_get_details [line 592]
string relationship_get_details(
int $p_bug_id, BugRelationshipData $p_relationship, [bool $p_html = false], [bool $p_html_preview = false], [bool $p_show_project = false])
|
|
return formatted string with all the details on the requested relationship
Parameters
int |
$p_bug_id |
Bug id |
BugRelationshipData |
$p_relationship |
Relationsip object |
bool |
$p_html |
Generate html |
bool |
$p_html_preview |
???? generate printable version??? |
bool |
$p_show_project |
Show Project details |
relationship_get_linked_bug_id [line 500]
int relationship_get_linked_bug_id(
int $p_relationship_id, int $p_bug_id)
|
|
retrieve the linked bug id of the relationship: provide src -> return dest; provide dest -> return src
Tags:
Parameters
int |
$p_relationship_id |
Relationship id |
int |
$p_bug_id |
Bug Id |
relationship_get_summary_html [line 697]
string relationship_get_summary_html(
int $p_bug_id)
|
|
print ALL the RELATIONSHIPS OF A SPECIFIC BUG
Parameters
relationship_get_summary_html_preview [line 724]
string relationship_get_summary_html_preview(
int $p_bug_id)
|
|
print ALL the RELATIONSHIPS OF A SPECIFIC BUG
Parameters
relationship_get_summary_text [line 751]
string relationship_get_summary_text(
int $p_bug_id)
|
|
print ALL the RELATIONSHIPS OF A SPECIFIC BUG in text format (used by email_api.php
Parameters
relationship_list_box [line 775]
null relationship_list_box(
[int $p_default_rel_type = -1], [string $p_select_name = "rel_type"], [bool $p_include_any = false], [bool $p_include_none = false], int $p_bug_id)
|
|
print HTML relationship listbox
Parameters
int |
$p_default_rel_type |
Relationship Type (default -1) |
string |
$p_select_name |
List box name (default "rel_type") |
bool |
$p_include_any |
Include an ANY option in list box (default false) |
bool |
$p_include_none |
Include a NONE option in list box (default false) |
int |
$p_bug_id |
Bug id |
relationship_same_type_exists [line 470]
int relationship_same_type_exists(
int $p_src_bug_id, int $p_dest_bug_id, int $p_rel_type)
|
|
check if there is a relationship between two bugs return: - if the relationship is not found
-1 if the relationship is found and it's of the same type $p_rel_type id if the relationship is found and it's of a different time (this means it can be replaced with the new type $p_rel_type
Tags:
Parameters
int |
$p_src_bug_id |
Source Bug Id |
int |
$p_dest_bug_id |
Destination Bug Id |
int |
$p_rel_type |
Relationship Type |
relationship_update [line 198]
BugRelationshipData relationship_update(
int $p_relationship_id, int $p_src_bug_id, int $p_dest_bug_id, int $p_relationship_type)
|
|
Update a relationship
Tags:
Parameters
int |
$p_relationship_id |
Relationship Id to update |
int |
$p_src_bug_id |
Source Bug Id |
int |
$p_dest_bug_id |
Destination Bug Id |
int |
$p_relationship_type |
Relationship type |
relationship_view_box [line 803]
null relationship_view_box(
int $p_bug_id)
|
|
print HTML relationship form
Parameters
|