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

Procedural File: bug_api.php

Source Location: /core/bug_api.php



Classes:

BugData
Bug Data Structure Definition


Page Details:

Bug API



Tags:

copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
link:  http://www.mantisbt.org
usedby:  access_api.php


Includes:

require_once('string_api.php') [line 45]
requires string_api

require_once('history_api.php') [line 29]
requires history_api

require_once('sponsorship_api.php') [line 49]
requires sponsorship_api

require_once('file_api.php') [line 41]
requires file_api

require_once('tag_api.php') [line 57]
requires tag_api

require_once('relationship_api.php') [line 61]
requires relationship_api

require_once('email_api.php') [line 33]
requires email_api

require_once('bugnote_api.php') [line 37]
requires bugnote_api

require_once('twitter_api.php') [line 53]
requires twitter_api

require_once('bug_revision_api.php') [line 65]
requires bug_revision_api







bug_assign [line 1501]

null bug_assign( array $p_bug_id, $p_user_id, [ $p_bugnote_text = ''], [ $p_bugnote_private = false])

assign the bug to the given user



Tags:

access:  public
uses:  database_api.php


Parameters

array   $p_bug_id   p_bug_id_array integer array representing bug ids to cache
   $p_user_id  
   $p_bugnote_text  
   $p_bugnote_private  
[ Top ]



bug_cache_array_rows [line 621]

null bug_cache_array_rows( array $p_bug_id_array)

Cache a set of bugs



Tags:

access:  public
uses:  database_api.php


Parameters

array   $p_bug_id_array   p_bug_id_array integer array representing bug ids to cache
[ Top ]



bug_cache_database_result [line 565]

array bug_cache_database_result( array $p_bug_database_result, [array $p_stats = null])

Cache a database result-set containing full contents of bug_table row.



Tags:

return:  returns an array representing the bug row if bug exists
access:  public


Parameters

array   $p_bug_database_result   p_bug_database_result database row containing all columns from mantis_bug_table
array   $p_stats   p_stats (optional) array representing bugnote stats
[ Top ]



bug_cache_row [line 583]

bool|array bug_cache_row( array $p_bug_id, [array $p_trigger_errors = true])

Cache a bug row if necessary and return the cached copy



Tags:

return:  returns an array representing the bug row if bug exists or false if bug does not exist
access:  public
uses:  database_api.php


Parameters

array   $p_bug_id   p_bug_id id of bug to cache from mantis_bug_table
array   $p_trigger_errors   p_trigger_errors set to true to trigger an error if the bug does not exist.
[ Top ]



bug_check_workflow [line 867]

bool bug_check_workflow( int $p_bug_status, int $p_wanted_status)

Validate workflow state to see if bug can be moved to requested state



Tags:

access:  public
uses:  utility_api.php
uses:  config_api.php


Parameters

int   $p_bug_status   p_bug_status current bug status
int   $p_wanted_status   p_wanted_status new bug status
[ Top ]



bug_clear_cache [line 673]

null bug_clear_cache( [int $p_bug_id = null])

Clear a bug from the cache or all bugs if no bug id specified.



Tags:

access:  public


Parameters

int   $p_bug_id   bug id to clear (optional)
[ Top ]



bug_close [line 1557]

bool bug_close( int $p_bug_id, [string $p_bugnote_text = ''], [bool $p_bugnote_private = false], [string $p_time_tracking = '0:00'])

close the given bug



Tags:

return:  (always true)
access:  public


Parameters

int   $p_bug_id   p_bug_id
string   $p_bugnote_text   p_bugnote_text
bool   $p_bugnote_private   p_bugnote_private
string   $p_time_tracking   p_time_tracking
[ Top ]



bug_copy [line 898]

int bug_copy( array $p_bug_id, [int $p_target_project_id = null], [bool $p_copy_custom_fields = false], [bool $p_copy_relationships = false], [ $p_copy_history = false], [ $p_copy_attachments = false], [ $p_copy_bugnotes = false], [ $p_copy_monitoring_users = false])

Copy a bug from one project to another. Also make copies of issue notes, attachments, history, email notifications etc.



Tags:

return:  representing the new bugid
todo:  Not managed FTP file upload
access:  public


Parameters

array   $p_bug_id   p_bug_id integer representing bug id
int   $p_target_project_id   p_target_project_id
bool   $p_copy_custom_fields   p_copy_custom_fields
bool   $p_copy_relationships   p_copy_relationships
   $p_copy_history  
   $p_copy_attachments  
   $p_copy_bugnotes  
   $p_copy_monitoring_users  
[ Top ]



bug_delete [line 1082]

bool bug_delete( array $p_bug_id)

allows bug deletion :

delete the bug, bugtext, bugnote, and bugtexts selected




Tags:

return:  (always true)
access:  public


Parameters

array   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_delete_all [line 1155]

bool bug_delete_all( array $p_project_id)

Delete all bugs associated with a project



Tags:

return:  always true
access:  public
uses:  database_api.php


Parameters

array   $p_project_id   p_project_id integer representing a projectid
[ Top ]



bug_ensure_exists [line 766]

null bug_ensure_exists( int $p_bug_id)

Check if a bug exists. If it doesn't then trigger an error



Tags:

access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_exists [line 752]

bool bug_exists( int $p_bug_id)

Check if a bug exists



Tags:

return:  true if bug exists, false otherwise
access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_format_id [line 1816]

string bug_format_id( int $p_bug_id)

Pads the bug id with the appropriate number of zeros.



Tags:

access:  public
uses:  config_api.php


Parameters

int   $p_bug_id   p_bug_id
[ Top ]



bug_format_summary [line 1282]

string bug_format_summary( int $p_bug_id, int $p_context)

return the bug summary

this is a wrapper for the custom function




Tags:

access:  public
uses:  helper_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
int   $p_context   p_context representing SUMMARY_CAPTION, SUMMARY_FIELD
[ Top ]



bug_get [line 1215]

object BugData bug_get( int $p_bug_id, [bool $p_get_extended = false])

Returns an object representing the specified bug



Tags:

return:  Object
access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
bool   $p_get_extended   p_get_extended included extended information (including bug_text)
[ Top ]



bug_get_attachments [line 1363]

array bug_get_attachments( int $p_bug_id)

Get array of attachments associated with the specified bug id. The array will be sorted in terms of date added (ASC). The array will include the following fields: id, title, diskfile, filename, filesize, file_type, date_added.



Tags:

return:  array of results or null
access:  public
uses:  file_api.php
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_get_bugnote_stats [line 1321]

object consisting bug_get_bugnote_stats( int $p_bug_id)

return the timestamp for the most recent time at which a bugnote

associated with the bug was modified and the total bugnote count in one db query




Tags:

return:  of bugnote stats
access:  public
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_get_extended_row [line 1190]

array bug_get_extended_row( int $p_bug_id)

Returns the extended record of the specified bug, this includes

the bug text fields




Tags:

todo:  include reporter name and handler name, the problem is that handler can be 0, in this case no corresponding name will be found. Use equivalent of (+) in Oracle.
access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_get_field [line 1241]

string bug_get_field( int $p_bug_id, string $p_field_name)

return the specified field of the given bug

if the field does not exist, display a warning and return ''




Tags:

access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
string   $p_field_name   p_fieldname field name
[ Top ]



bug_get_newest_bugnote_timestamp [line 1294]

bool|int bug_get_newest_bugnote_timestamp( int $p_bug_id)

return the timestamp for the most recent time at which a bugnote

associated with the bug was modified




Tags:

return:  false or timestamp in integer format representing newest bugnote timestamp
access:  public
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_get_row [line 1204]

array bug_get_row( int $p_bug_id)

Returns the record of the specified bug



Tags:

access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_get_text_field [line 1261]

string bug_get_text_field( int $p_bug_id, string $p_field_name)

return the specified text field of the given bug

if the field does not exist, display a warning and return ''




Tags:

access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
string   $p_field_name   p_fieldname field name
[ Top ]



bug_is_overdue [line 845]

bool bug_is_overdue( int $p_bug_id)

Check if a given bug is overdue



Tags:

return:  true if bug is overdue, false otherwise
access:  public
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_is_readonly [line 813]

bool bug_is_readonly( int $p_bug_id)

Check if the bug is readonly and shouldn't be modified For a bug to be readonly the status has to be >= bug_readonly_status_threshold and current user access level < update_readonly_bug_threshold.



Tags:

access:  public
uses:  config_api.php
uses:  access_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_is_resolved [line 833]

bool bug_is_resolved( int $p_bug_id)

Check if a given bug is resolved



Tags:

return:  true if bug is resolved, false otherwise
access:  public
uses:  config_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
[ Top ]



bug_is_user_handler [line 795]

bool bug_is_user_handler( int $p_bug_id, int $p_user_id)

check if the given user is the handler of the bug



Tags:

return:  return true if the user is the handler, false otherwise
access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
int   $p_user_id   p_user_id integer reprenting a user id
[ Top ]



bug_is_user_reporter [line 780]

bool bug_is_user_reporter( int $p_bug_id, int $p_user_id)

check if the given user is the reporter of the bug



Tags:

return:  return true if the user is the reporter, false otherwise
access:  public


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
int   $p_user_id   p_user_id integer reprenting a user id
[ Top ]



bug_monitor [line 1709]

true bug_monitor( int $p_bug_id, int $p_user_id)

enable monitoring of this bug for the user



Tags:

return:  if successful, false if unsuccessful
access:  public
uses:  user_api.php
uses:  database_api.php
uses:  history_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug ids
int   $p_user_id   p_user_id integer representing user ids
[ Top ]



bug_monitor_copy [line 1750]

bool bug_monitor_copy( int $p_source_bug_id, int $p_dest_bug_id)

Copy list of users monitoring a bug to the monitor list of a second bug



Tags:

return:  (always true)
access:  public
uses:  user_api.php
uses:  database_api.php
uses:  history_api.php


Parameters

int   $p_source_bug_id   p_source_bug_id integer representing the bug ID of the source bug
int   $p_dest_bug_id   p_dest_bug_id integer representing the bug ID of the destination bug
[ Top ]



bug_reopen [line 1661]

bool bug_reopen( int $p_bug_id, [string $p_bugnote_text = ''], [string $p_time_tracking = '0:00'], [bool $p_bugnote_private = false])

reopen the given bug



Tags:

return:  (always true)
access:  public
uses:  email_api.php
uses:  database_api.php
uses:  config_api.php
uses:  bugnote_api.php


Parameters

int   $p_bug_id   p_bug_id
string   $p_bugnote_text   p_bugnote_text
string   $p_time_tracking   p_time_tracking
bool   $p_bugnote_private   p_bugnote_private
[ Top ]



bug_resolve [line 1578]

bool bug_resolve( $p_bug_id, $p_resolution, [ $p_fixed_in_version = ''], [ $p_bugnote_text = ''], [ $p_duplicate_id = null], [ $p_handler_id = null], [ $p_bugnote_private = false], [ $p_time_tracking = '0:00'])

resolve the given bug



Tags:

return:  (alawys true)
access:  public


Parameters

   $p_bug_id  
   $p_resolution  
   $p_fixed_in_version  
   $p_bugnote_text  
   $p_duplicate_id  
   $p_handler_id  
   $p_bugnote_private  
   $p_time_tracking  
[ Top ]



bug_row_to_object [line 1227]

void bug_row_to_object( $p_row)



Parameters

   $p_row  
[ Top ]



bug_set_field [line 1401]

bool bug_set_field( int $p_bug_id, string $p_field_name, any $p_value)

Set the value of a bug field



Tags:

return:  (always true)
access:  public
uses:  history_api.php
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug id
string   $p_field_name   p_field_name pre-defined field name
any   $p_value   p_value value to set
[ Top ]



bug_text_cache_row [line 693]

bool|array bug_text_cache_row( int $p_bug_id, [bool $p_trigger_errors = true])

Cache a bug text row if necessary and return the cached copy



Tags:

return:  returns false if not bug text found or array of bug text
access:  public
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer bug id to retrieve text for
bool   $p_trigger_errors   p_trigger_errors If the second parameter is true (default), trigger an error if bug text not found.
[ Top ]



bug_text_clear_cache [line 734]

null bug_text_clear_cache( [int $p_bug_id = null])

Clear a bug's bug text from the cache or all bug text if no bug id specified.



Tags:

access:  public


Parameters

int   $p_bug_id   bug id to clear (optional)
[ Top ]



bug_unmonitor [line 1783]

bool bug_unmonitor( int $p_bug_id, int $p_user_id)

disable monitoring of this bug for the user if $p_user_id = null, then bug is unmonitored for all users.



Tags:

return:  (always true)
access:  public
uses:  history_api.php
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug ids
int   $p_user_id   p_user_id integer representing user ids
[ Top ]



bug_update_date [line 1684]

bool bug_update_date( int $p_bug_id)

updates the last_updated field



Tags:

return:  (always true)
access:  public
uses:  database_api.php


Parameters

int   $p_bug_id   p_bug_id integer representing bug ids
[ Top ]



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