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

Procedural File: relationship_api.php

Source Location: /core/relationship_api.php

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

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 - 2009 MantisBT Team - mantisbt-dev@lists.sourceforge.net
Link:  http://www.mantisbt.org
Classes
Class Description
BugRelationshipData
Includes
require_once ($t_core_dir.'collapse_api.php') [line 73]

requires collapse_api

[ Top ]

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


Functions
relationship_add  [line 157]

BugRelationshipData relationship_add( int $p_src_bug_id, int $p_dest_bug_id, int $p_relationship_type  )

Add a new relationship

Parameters:
int   $p_src_bug_id:  Source Bug Id
int   $p_dest_bug_id:  Destination Bug Id
int   $p_relationship_type:  Relationship type

API Tags:
Return:  Bug Relationship


[ Top ]
relationship_can_resolve_bug  [line 553]

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 261]

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 231]

void relationship_delete( int $p_relationship_id  )

Delete a relationship

Parameters:
int   $p_relationship_id:  Relationship Id to update


[ Top ]
relationship_delete_all  [line 245]

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 425]

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

Parameters:
int   $p_src_bug_id:  Source Bug Id
int   $p_dest_bug_id:  Destination Bug Id

API Tags:
Return:  Relationship ID


[ Top ]
relationship_get  [line 287]

null|BugRelationshipData relationship_get( int $p_relationship_id  )

get a relationship from id

Parameters:
int   $p_relationship_id:  Relationship ID

API Tags:
Return:  BugRelationshipData object


[ Top ]
relationship_get_all  [line 406]

array relationship_get_all( int $p_bug_id, bool &$p_is_different_projects  )

get all relationships associated with the given bug

Parameters:
int   $p_bug_id:  Bug id
bool   &$p_is_different_projects:  Returned Boolean value indicating if some relationships cross project boundaries

API Tags:
Return:  Array of BugRelationshipData objects


[ Top ]
relationship_get_all_dest  [line 361]

array relationship_get_all_dest( int $p_dest_bug_id  )

get all relationships with the given bug as destination

Parameters:
int   $p_dest_bug_id:  Destination Bug id

API Tags:
Return:  Array of BugRelationshipData objects


[ Top ]
relationship_get_all_src  [line 317]

array relationship_get_all_src( int $p_src_bug_id  )

get all relationships with the given bug as source

Parameters:
int   $p_src_bug_id:  Source Bug id

API Tags:
Return:  Array of BugRelationshipData objects


[ Top ]
relationship_get_complementary_type  [line 142]

int relationship_get_complementary_type( int $p_relationship_type  )

Return the complementary type of the provided relationship

Parameters:
int   $p_relationship_type:  Relationship type

API Tags:
Return:  Complementary type


[ Top ]
relationship_get_description_dest_side  [line 529]

string relationship_get_description_dest_side( int $p_relationship_type  )

get class description of a relationship (destination side)

Parameters:
int   $p_relationship_type:  Relationship type

API Tags:
Return:  Relationship description


[ Top ]
relationship_get_description_for_history  [line 542]

string relationship_get_description_for_history( int $p_relationship_code  )

get class description of a relationship as it's stored in the history

Parameters:
int   $p_relationship_code:  Relationship Type

API Tags:
Return:  Relationship description


[ Top ]
relationship_get_description_src_side  [line 516]

string relationship_get_description_src_side( int $p_relationship_type  )

get class description of a relationship (source side)

Parameters:
int   $p_relationship_type:  Relationship type

API Tags:
Return:  Relationship description


[ Top ]
relationship_get_details  [line 588]

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 496]

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

Parameters:
int   $p_relationship_id:  Relationship id
int   $p_bug_id:  Bug Id

API Tags:
Return:  Complementary bug id


[ Top ]
relationship_get_summary_html  [line 690]

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 717]

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 744]

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 466]

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

Parameters:
int   $p_src_bug_id:  Source Bug Id
int   $p_dest_bug_id:  Destination Bug Id
int   $p_rel_type:  Relationship Type

API Tags:
Return:  0, -1 or id


[ Top ]
relationship_update  [line 195]

BugRelationshipData relationship_update( int $p_relationship_id, int $p_src_bug_id, int $p_dest_bug_id, int $p_relationship_type  )

Update a 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

API Tags:
Return:  Bug Relationship


[ 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, 05 Apr 2009 23:01:31 +0100 by phpDocumentor 1.4.1