[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/ -> category_api.php (summary)

Category API

Copyright: Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
Copyright: Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
File Size: 633 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 18 functions

  category_exists()
  category_ensure_exists()
  category_is_unique()
  category_ensure_unique()
  category_add()
  category_update()
  category_remove()
  category_remove_all()
  category_get_row()
  category_sort_rows_by_project()
  category_cache_array_rows_by_project()
  category_get_filter_list()
  category_get_all_rows()
  category_cache_array_rows()
  category_get_field()
  category_get_name()
  category_get_id_by_name()
  category_full_name()

Functions
Functions that are not part of a class:

category_exists( $p_category_id )   X-Ref
Check whether the category exists in the project

param: int $p_category_id category id
return: bool Return true if the category exists, false otherwise

category_ensure_exists( $p_category_id )   X-Ref
Check whether the category exists in the project
Trigger an error if it does not

param: int $p_category_id category id

category_is_unique( $p_project_id, $p_name )   X-Ref
Check whether the category is unique within a project

param: int $p_project_id project id
param: string $p_name project name
return: bool Returns true if the category is unique, false otherwise

category_ensure_unique( $p_project_id, $p_name )   X-Ref
Check whether the category is unique within a project
Trigger an error if it is not

param: int $p_project_id Project id
param: string $p_name Category Name
return: null

category_add( $p_project_id, $p_name )   X-Ref
Add a new category to the project

param: int $p_project_id Project id
param: string $p_name Category Name
return: int Category ID

category_update( $p_category_id, $p_name, $p_assigned_to )   X-Ref
Update the name and user associated with the category

param: int $p_category_id Category id
param: string $p_name Category Name
param: int $p_assigned_to User ID that category is assigned to
return: bool

category_remove( $p_category_id, $p_new_category_id = 0 )   X-Ref
Remove a category from the project

param: int $p_category_id Category id
param: int $p_new_category_id new category id (to replace existing category)
return: bool

category_remove_all( $p_project_id, $p_new_category_id = 0 )   X-Ref
Remove all categories associated with a project

param: int $p_project_id Project ID
param: int $p_new_category_id new category id (to replace existing category)
return: bool

category_get_row( $p_category_id )   X-Ref
Return the definition row for the category

param: int $p_category_id Category id
return: array array containing category details

category_sort_rows_by_project( $p_category1, $p_category2 = null )   X-Ref
Sort categories based on what project they're in.
Call beforehand with a single parameter to set a 'preferred' project.

param: array $p_category1 array containing category details
param: array $p_category2 array containing category details
return: int integer representing sort order

category_cache_array_rows_by_project( $p_project_id_array )   X-Ref
No description

category_get_filter_list( $p_project_id = null )   X-Ref
Get a distinct array of categories accessible to the current user for
the specified projects.  If no project is specified, use the current project.
If the current project is ALL_PROJECTS get all categories for all accessible projects.
For all cases, get global categories and subproject categories according to configured inheritance settings.

param: mixed $p_project_id A specific project or null
return: array A unique array of category names

category_get_all_rows( $p_project_id, $p_inherit = null, $p_sort_by_project = false )   X-Ref
Return all categories for the specified project id.
Obeys project hierarchies and such.

param: int $p_project_id Project id
param: bool $p_inherit indicates whether to inherit categories from parent projects, or null to use configuration default.
param: bool $p_sort_by_project
return: array array of categories

category_cache_array_rows( $p_cat_id_array )   X-Ref

param: array $p_cat_id_array array of category id's
return: null

category_get_field( $p_category_id, $p_field_name )   X-Ref
Given a category id and a field name, this function returns the field value.
An error will be triggered for a non-existent category id or category id = 0.

param: int $p_category_id category id
param: string $p_name field name
return: string field value

category_get_name( $p_category_id )   X-Ref
Given a category id, this function returns the category name.
An error will be triggered for a non-existent category id or category id = 0.

param: int $p_category_id category id
return: string category name

category_get_id_by_name( $p_category_name, $p_project_id, $p_trigger_errors = true )   X-Ref
Given a category name and project, this function returns the category id.
An error will be triggered if the specified project does not have a
category with that name.

param: string $p_category_name category name
param: int $p_project_id project id
param: bool $p_trigger_errors trigger error on failure
return: bool

category_full_name( $p_category_id, $p_show_project = true, $p_current_project = null )   X-Ref
Retrieves category name (including project name if required)

param: string $p_category_id category id
param: bool $p_show_project show project details
param: int $p_project_id current project id override
return: string category full name



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7