[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/include/ -> class.custom_field.php (summary)

(no description)

File Size: 1780 lines (71 kb)
Included or required: 12 times
Referenced: 0 times
Includes or requires: 6 files
 include/class.misc.php
 include/class.auth.php
 include/class.history.php
 include/class.user.php
 include/class.error_handler.php
 include/class.issue.php

Defines 1 class

Custom_Field:: (39 methods):
  removeOptions()
  addOptions()
  updateOption()
  updateValues()
  associateIssue()
  getListByProject()
  getOptionValue()
  getOptionKey()
  getListByIssue()
  getValuesByIssue()
  remove()
  insert()
  associateProject()
  getList()
  getAssociatedProjects()
  getDetails()
  getOptions()
  parseParameters()
  update()
  getFieldsByProject()
  removeIssueAssociation()
  removeOptionsByFields()
  removeByIssues()
  removeByProjects()
  getFieldsToBeListed()
  getIDByTitle()
  getDisplayValue()
  getMaxRank()
  changeRank()
  setRank()
  getBackendList()
  getBackendName()
  getBackend()
  getIssuesByString()
  formatValue()
  populateAllFields()
  getDBValueFieldNameByType()
  getDBValueFieldSQL()
  updateValuesForNewType()


Class: Custom_Field  - X-Ref

Class to handle the business logic related to the administration
of custom fields in the system.

removeOptions($fld_id, $cfo_id)   X-Ref
Method used to remove a group of custom field options.

param: array $fld_id The list of custom field IDs
param: array $fld_id The list of custom field option IDs
return: boolean

addOptions($fld_id, $options)   X-Ref
Method used to add possible options into a given custom field.

param: integer $fld_id The custom field ID
param: array $options The list of options that need to be added
return: integer 1 if the insert worked, -1 otherwise

updateOption($cfo_id, $cfo_value)   X-Ref
Method used to update an existing custom field option value.

param: integer $cfo_id The custom field option ID
param: string $cfo_value The custom field option value
return: boolean

updateValues()   X-Ref
Method used to update the values stored in the database.

return: integer 1 if the update worked properly, any other value otherwise

associateIssue($iss_id, $fld_id, $value)   X-Ref
Method used to associate a custom field value to a given
issue ID.

param: integer $iss_id The issue ID
param: integer $fld_id The custom field ID
param: string  $value The custom field value
return: boolean Whether the association worked or not

getListByProject($prj_id, $form_type, $fld_type = false)   X-Ref
Method used to get the list of custom fields associated with
a given project.

param: integer $prj_id The project ID
param: string $form_type The type of the form
param: string $fld_type The type of field (optional)
return: array The list of custom fields

getOptionValue($fld_id, $value)   X-Ref
Method used to get the custom field option value.

param: integer $fld_id The custom field ID
param: integer $value The custom field option ID
return: string The custom field option value

getOptionKey($fld_id, $value)   X-Ref
Method used to get the custom field key based on the value.

param: integer $fld_id The custom field ID
param: integer $value The custom field option ID
return: string The custom field option value

getListByIssue($prj_id, $iss_id, $usr_id = false, $form_type = false)   X-Ref
Method used to get the list of custom fields and custom field
values associated with a given issue ID. If usr_id is false method
defaults to current user.

param: integer $prj_id The project ID
param: integer $iss_id The issue ID
param: integer $usr_id The ID of the user who is going to be viewing this list.
return: array The list of custom fields

getValuesByIssue($prj_id, $iss_id)   X-Ref
Returns an array of fields and values for a specific issue

param: integer $prj_id The ID of the project
param: integer $iss_id The ID of the issue to return values for
return: array An array containging fld_id => value

remove()   X-Ref
Method used to remove a given list of custom fields.

return: boolean

insert()   X-Ref
Method used to add a new custom field to the system.

return: integer 1 if the insert worked, -1 otherwise

associateProject($prj_id, $fld_id)   X-Ref
Method used to associate a custom field to a project.

param: integer $prj_id The project ID
param: integer $fld_id The custom field ID
return: boolean

getList()   X-Ref
Method used to get the list of custom fields available in the
system.

return: array The list of custom fields

getAssociatedProjects($fld_id)   X-Ref
Method used to get the list of associated projects with a given
custom field ID.

param: integer $fld_id The project ID
return: array The list of associated projects

getDetails($fld_id, $force_refresh = false)   X-Ref
Method used to get the details of a specific custom field.

param: integer $fld_id The custom field ID
param: boolean $force_refresh If the details must be loaded again from the database
return: array The custom field details

getOptions($fld_id, $ids = false)   X-Ref
Method used to get the list of custom field options associated
with a given custom field ID.

param: integer $fld_id The custom field ID
param: array $ids An array of ids to return values for.
return: array The list of custom field options

parseParameters($value)   X-Ref
Method used to parse the special format used in the combo boxes
in the administration section of the system, in order to be
used as a way to flag the system for whether the custom field
option is a new one or one that should be updated.

param: string $value The custom field option format string
return: array Parameters used by the update/insert methods

update()   X-Ref
Method used to update the details for a specific custom field.

return: integer 1 if the update worked, -1 otherwise

getFieldsByProject($prj_id)   X-Ref
Method used to get the list of custom fields associated with a
given project.

param: integer $prj_id The project ID
return: array The list of custom fields

removeIssueAssociation($fld_id, $issue_id = FALSE, $prj_id = false)   X-Ref
Method used to remove the issue associations related to a given
custom field ID.

param: integer $fld_id The custom field ID
param: integer $issue_id The issue ID (not required)
param: integer $prj_id The project ID (not required)
return: boolean

removeOptionsByFields($ids)   X-Ref
Method used to remove the custom field options associated with
a given list of custom field IDs.

param: array $ids The list of custom field IDs
return: boolean

removeByIssues($ids)   X-Ref
Method used to remove all custom field entries associated with
a given set of issues.

param: array $ids The array of issue IDs
return: boolean

removeByProjects($ids)   X-Ref
Method used to remove all custom fields associated with
a given set of projects.

param: array $ids The array of project IDs
return: boolean

getFieldsToBeListed($prj_id)   X-Ref
Method to return the names of the fields which should be displayed on the list issues page.

param: integer $prj_id The ID of the project.
return: array An array of custom field names.

getIDByTitle($title)   X-Ref
Returns the fld_id of the field with the specified title

param: string $title The title of the field
return: integer The fld_id

getDisplayValue($iss_id, $fld_id, $raw = false)   X-Ref
Returns the value for the specified field

param: integer $iss_id The ID of the issue
param: integer $fld_id The ID of the field
param: boolean $raw If the raw value should be displayed
param: mixed an array or string containing the value

getMaxRank()   X-Ref
Returns the current maximum rank of any custom fields.

return: integer The highest rank

changeRank()   X-Ref
Changes the rank of a custom field


setRank($fld_id, $rank)   X-Ref
Sets the rank of a custom field

param: integer $fld_id The ID of the field
param: integer $rank The new rank for this field
return: integer 1 if successful, -1 otherwise

getBackendList()   X-Ref
Returns the list of available custom field backends by listing the class
files in the backend directory.

return: array Associative array of filename => name

getBackendName($backend)   X-Ref
Returns the 'pretty' name of the backend

param: string $backend The full backend file name
return: string The pretty name of the backend.

getBackend($fld_id)   X-Ref
Returns an instance of custom field backend class if it exists for the
specified field.

param: integer $fld_id The ID of the field
return: mixed false if there is no backend or an instance of the backend class

getIssuesByString($fld_id, $search)   X-Ref
Searches a specified custom field for a string and returns any issues that match

param: integer $fld_id The ID of the custom field
param: string  $search The string to search for
return: array An array of issue IDs

formatValue($value, $fld_id, $issue_id)   X-Ref
Formats the return value

param: mixed   $value The value to format
param: integer $fld_id The ID of the field
param: integer $issue_id The ID of the issue
return: mixed   the formatted value.

populateAllFields($issue_id)   X-Ref
This method inserts a blank value for all custom fields that do not already have a record.
It currently is not called by the main code, but is included to be called from workflow classes.

param: integer $issue_id The Issue ID

getDBValueFieldNameByType($type)   X-Ref
Returns the name of the db field this custom field uses based on the type.

param: string $type
return: string

getDBValueFieldSQL()   X-Ref
No description

updateValuesForNewType($fld_id)   X-Ref
Analyzes the contents of the issue_custom_field and updates
contents based on the fld_type.

param: integer $fld_id



Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7