Procedural File: tag_api.php
Source Location: /core/tag_api.php
Page Details:
Tag API
Tags:
Includes:
tag_bug_attach [line 545]
void tag_bug_attach(
integer $p_tag_id, integer $p_bug_id, [integer $p_user_id = null])
|
|
Attach a tag to a bug.
Parameters
integer |
$p_tag_id |
Tag ID |
integer |
$p_bug_id |
Bug ID |
integer |
$p_user_id |
User ID |
tag_bug_detach [line 596]
void tag_bug_detach(
integer $p_tag_id, integer $p_bug_id, [boolean $p_add_history = true], [integer $p_user_id = null])
|
|
Detach a tag from a bug.
Parameters
integer |
$p_tag_id |
Tag ID |
integer |
$p_bug_id |
Bug ID |
boolean |
$p_add_history |
Add history entries to bug |
integer |
$p_user_id |
User Id (or null for current logged in user) |
tag_bug_detach_all [line 642]
void tag_bug_detach_all(
integer $p_bug_id, [boolean $p_add_history = true], [integer $p_user_id = null])
|
|
Detach all tags from a given bug.
Parameters
integer |
$p_bug_id |
Bug ID |
boolean |
$p_add_history |
Add history entries to bug |
integer |
$p_user_id |
User Id (or null for current logged in user) |
tag_bug_get_attached [line 495]
array tag_bug_get_attached(
Bug $p_bug_id)
|
|
Return an array of tags attached to a given bug sorted by tag name.
Tags:
Parameters
tag_bug_get_row [line 474]
array tag_bug_get_row(
integer $p_tag_id, integer $p_bug_id)
|
|
Return the tag attachment row.
Tags:
Parameters
integer |
$p_tag_id |
Tag ID |
integer |
$p_bug_id |
Bug ID |
tag_bug_is_attached [line 456]
boolean tag_bug_is_attached(
integer $p_tag_id, integer $p_bug_id)
|
|
Determine if a tag is attached to a bug.
Tags:
Parameters
integer |
$p_tag_id |
Tag ID |
integer |
$p_bug_id |
Bug ID |
tag_cmp_name [line 127]
integer tag_cmp_name(
array $p_tag1, array $p_tag2)
|
|
Compare two tag rows based on tag name.
Tags:
Parameters
array |
$p_tag1 |
Tag row 1 |
array |
$p_tag2 |
Tag row 2 |
tag_create [line 284]
integer tag_create(
string $p_name, [integer $p_user_id = null], [string $p_description = ''])
|
|
Create a tag with the given name, creator, and description. Defaults to the currently logged in user, and a blank description.
Tags:
Parameters
string |
$p_name |
Tag name |
integer |
$p_user_id |
User ID |
string |
$p_description |
Description |
tag_delete [line 376]
void tag_delete(
integer $p_tag_id)
|
|
Delete a tag with the given ID.
Parameters
tag_display_attached [line 686]
void tag_display_attached(
Bug $p_bug_id)
|
|
Display a list of attached tag hyperlinks separated by the configured hyperlinks.
Parameters
tag_display_link [line 657]
void tag_display_link(
array $p_tag_row, [integer $p_bug_id = 0])
|
|
Display a tag hyperlink. If a bug ID is passed, the tag link will include a detach link if the user has appropriate privileges.
Parameters
array |
$p_tag_row |
Tag row |
integer |
$p_bug_id |
Bug ID |
tag_ensure_exists [line 57]
void tag_ensure_exists(
integer $p_tag_id)
|
|
Ensure a tag exists with the given ID.
Parameters
tag_ensure_name_is_valid [line 114]
void tag_ensure_name_is_valid(
string $p_name)
|
|
Ensure a tag name is valid.
Parameters
tag_ensure_unique [line 84]
void tag_ensure_unique(
string $p_name)
|
|
Ensure that a name is unique.
Parameters
tag_exists [line 43]
boolean tag_exists(
integer $p_tag_id)
|
|
Determine if a tag exists with the given ID.
Tags:
Parameters
tag_get [line 219]
array tag_get(
integer $p_tag_id)
|
|
Return a tag row for the given ID.
Tags:
Parameters
tag_get_bugs_attached [line 522]
array tag_get_bugs_attached(
integer $p_tag_id)
|
|
Return an array of bugs that a tag is attached to.
Tags:
Parameters
tag_get_by_name [line 243]
Tag tag_get_by_name(
string $p_name)
|
|
Return a tag row for the given name.
Tags:
Parameters
tag_get_candidates_for_bug [line 405]
The tag_get_candidates_for_bug(
int $p_bug_id)
|
|
Gets the candidates for the specified bug. These are existing tags that are not associated with the bug already.
Tags:
Parameters
int |
$p_bug_id |
The bug id, if 0 returns all tags. |
tag_get_field [line 264]
mixed tag_get_field(
integer $p_tag_id, string $p_field_name)
|
|
Return a single field from a tag row for the given ID.
Tags:
Parameters
integer |
$p_tag_id |
Tag ID |
string |
$p_field_name |
Field name |
tag_is_unique [line 70]
boolean tag_is_unique(
string $p_name)
|
|
Determine if a given name is unique (not already used). Uses a case-insensitive search of the database for existing tags with the same name.
Tags:
Parameters
tag_name_is_valid [line 104]
boolean tag_name_is_valid(
string $p_name, array &$p_matches, [string $p_prefix = ''])
|
|
Determine if a given name is valid. Name must not begin with '+' and '-' characters (they are used for filters) and must not contain the configured tag separator. The matches parameter allows to also receive an array of regex matches, which by default only includes the valid tag name itself. The prefix parameter is optional, but allows you to prefix the regex check, which is useful for filters, etc.
Tags:
Parameters
string |
$p_name |
Tag name |
array |
&$p_matches |
Array reference for regex matches |
string |
$p_prefix |
Prefix regex pattern |
tag_parse_filters [line 181]
array tag_parse_filters(
string $p_string)
|
|
Parse a filter string to extract existing and new tags. When given a string, parses for tag names separated by configured separator, then returns an array of tag rows for each tag. Existing tags get the full row of information returned. If the tag does not exist, a row is returned with id = -1 and the tag name, and if the name is invalid, a row is returned with id = -2 and the tag name. The resulting array is then sorted by tag name.
Tags:
Parameters
string |
$p_string |
Filter string to parse |
tag_parse_string [line 141]
array tag_parse_string(
string $p_string)
|
|
Parse a form input string to extract existing and new tags. When given a string, parses for tag names separated by configured separator, then returns an array of tag rows for each tag. Existing tags get the full row of information returned. If the tag does not exist, a row is returned with id = -1 and the tag name, and if the name is invalid, a row is returned with id = -2 and the tag name. The resulting array is then sorted by tag name.
Tags:
Parameters
string |
$p_string |
Input string to parse |
tag_stats_attached [line 709]
integer tag_stats_attached(
integer $p_tag_id)
|
|
Get the number of bugs a given tag is attached to.
Tags:
Parameters
tag_stats_related [line 729]
array tag_stats_related(
integer $p_tag_id, [integer $p_limit = 5])
|
|
Get a list of related tags. Returns a list of tags that are the most related to the given tag, based on the number of times they have been attached to the same bugs. Defaults to a list of five tags.
Tags:
Parameters
integer |
$p_tag_id |
Tag ID |
integer |
$p_limit |
List size |
tag_update [line 327]
void tag_update(
integer $p_tag_id, string $p_name, integer $p_user_id, string $p_description)
|
|
Update a tag with given name, creator, and description.
Parameters
integer |
$p_tag_id |
Tag ID |
string |
$p_name |
Tag name |
integer |
$p_user_id |
User ID |
string |
$p_description |
Description |
|