CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

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:

author:  Marcello Scata' <at users.sourceforge.net marcelloscata at users.sourceforge.net> ITALY
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
link:  http://www.mantisbt.org


Includes:

require_once('collapse_api.php') [line 71]
requires collapse_api

require_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'custom_relationships_inc.php') [line 137]






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:

return:  Bug Relationship


Parameters

int   $p_src_bug_id   Source Bug Id
int   $p_dest_bug_id   Destination Bug Id
int   $p_relationship_type   Relationship type
[ Top ]



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

int   $p_bug_id   Bug id
[ Top ]



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
[ Top ]



relationship_delete [line 234]

void relationship_delete( int $p_relationship_id)

Delete a relationship



Parameters

int   $p_relationship_id   Relationship Id to update
[ Top ]



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

int   $p_bug_id   Bug Id
[ Top ]



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:

return:  Relationship ID


Parameters

int   $p_src_bug_id   Source Bug Id
int   $p_dest_bug_id   Destination Bug Id
[ Top ]



relationship_get [line 290]

null|BugRelationshipData relationship_get( int $p_relationship_id)

get a relationship from id



Tags:

return:  BugRelationshipData object


Parameters

int   $p_relationship_id   Relationship ID
[ Top ]



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:

return:  Array of BugRelationshipData objects


Parameters

int   $p_bug_id   Bug id
bool   &$p_is_different_projects   Returned Boolean value indicating if some relationships cross project boundaries
[ Top ]



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:

return:  Array of BugRelationshipData objects


Parameters

int   $p_dest_bug_id   Destination Bug id
[ Top ]



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:

return:  Array of BugRelationshipData objects


Parameters

int   $p_src_bug_id   Source Bug id
[ Top ]



relationship_get_complementary_type [line 145]

int relationship_get_complementary_type( int $p_relationship_type)

Return the complementary type of the provided relationship



Tags:

return:  Complementary type


Parameters

int   $p_relationship_type   Relationship type
[ Top ]



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:

return:  Relationship description


Parameters

int   $p_relationship_type   Relationship type
[ Top ]



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:

return:  Relationship description


Parameters

int   $p_relationship_code   Relationship Type
[ Top ]



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:

return:  Relationship description


Parameters

int   $p_relationship_type   Relationship type
[ Top ]



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
[ Top ]



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:

return:  Complementary bug id


Parameters

int   $p_relationship_id   Relationship id
int   $p_bug_id   Bug Id
[ Top ]



relationship_get_summary_html [line 697]

string relationship_get_summary_html( int $p_bug_id)

print ALL the RELATIONSHIPS OF A SPECIFIC BUG



Parameters

int   $p_bug_id   Bug id
[ Top ]



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

int   $p_bug_id   Bug id
[ Top ]



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

int   $p_bug_id   Bug id
[ Top ]



relationship_list_box [line 775]

null relationship_list_box( [int $p_default_rel_type = -1], [string $p_select_name = &quot;rel_type&quot;], [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
[ Top ]



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:

  1. 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:

return:  0, -1 or id


Parameters

int   $p_src_bug_id   Source Bug Id
int   $p_dest_bug_id   Destination Bug Id
int   $p_rel_type   Relationship Type
[ Top ]



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:

return:  Bug Relationship


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
[ Top ]



relationship_view_box [line 803]

null relationship_view_box( int $p_bug_id)

print HTML relationship form



Parameters

int   $p_bug_id   Bug id
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:48 +0900 by phpDocumentor 1.4.3
inserted by FC2 system