Class: I2CE CustomReport Template

From IHRIS Wiki
Revision as of 12:08, 19 October 2009 by Litlfred (talk | contribs)

This article describes the class I2CE_CustomReport_Template.

I2CE_CustomReport_Relationship_Template

Variables

$templates

An array of requested relationships templates I2CE_CustomReport_Template indexed by the type and then by name @protected static array $templates

  • Type: static protected $templates

$types

An array index by configTypes. the values are arrays whose keys are fields with values the config types the fields are supposed to have array $types

  • Type: static protected static $types

$blanket

An array with keys config types such that all sub-nodes of a node with this configType will have the configType specified by the value associated to the key array $blanket

  • Type: static protected static $blanket

$required

an array with keys configTypes with values the required fields for that config type. will cause a failure if not present $var protecected static $required

  • Type: static protected $required

$ensure

  • Type: static protected $ensure

$permissions

  • Type: static protected $permissions

Methods

compareByDisplayName()

Compares to arrays with keys 'display_name' to see which is "bigger"

  • Signature: static public function compareByDisplayName($m,$n)
  • Parameters:
  • Returns: boolean

createExport()

Create an export node by appending on to the given configurationGroup node the values stored in the magic data.

  • Signature: public function createExport($configNode,$config,$pipe,$configType,$status)
  • Parameters:
    • DOMNode $configNode
      A configurationGroup node.
    • I2CE_MagicDataNode $config
      The data we wish to store at this node
    • mixed $pipe
      A path component or an array of path components relative to the $config. If the pipe is a non-empty array, we export only the keys specifed by the lowest member of $pipe, if it exists. Otherwise, if the pipe is empty or null, we export all keys. Defaults to empty array
      • Default Value: null
    • string $configType
      Defaults to the empty string. The configuration type to give the configuration node.
      • Default Value:
    • array $status
      An array of status options we should set for this configuration node. Defaults to the empty array
      • Default Value: array()

createExportNodeConfigurationGroup()

Create an configurationGroup node by appending on to the given configurationGroup node the values stored in the magic data at the specified $key.

  • Signature: public function createExportNodeConfigurationGroup($configNode,$config,$pipe,$key,$configType,$status)
  • Parameters:
    • DOMNode $configNode
      A configurationGroup node.
    • I2CE_MagicDataNode $config
      The data we wish to store at this node
    • array $pipe
      An array of path components relative to the $config. If the pipe is a non-empty array, we export only the keys specifed by the lowest member of $pipe, if it exists. Otherwise, if the pipe is empty, we export all keys
    • string $key
      The key. (Warning. It assumes it exists in the magic data!)
    • string $configType
      Defaults to the empty string. The configuration type to give the configuration node.
    • array $status
      An array of status options we should set for this configuration node. Defaults to the empty array

getFormFromReportForm()

Looks up the form associated to a reportform in the specified relationship

  • Signature: static public function getFormFromReportForm($relationship,$reportform)
  • Parameters:
    • string $relationship
    • string $reportform
      If $reportform == 'primary_form' or $relationship then we are looking up the primary form
  • Returns: string.
    The false on failure

getRelationshipFromReport()

Get the relationship associated to a report

  • Signature: static public function getRelationshipFromReport($report)
  • Parameters:
  • Returns: strng.
    The empty string on failure

getReportFields()

Get the reported fields for a report

  • Signature: static public function getReportFields($report,$get_disabled)
  • Parameters:
    • string $report
    • boolean $get_disabled
      Defaults to false
      • Default Value: false
  • Returns: array
    with keys the field name of the form "$form+$field" and values the header for the field

getReportNames()

Get a list of the existing reports

  • Signature: static public function getReportNames($cheat)
  • Parameters:
    • $cheat
      • Default Value: false
  • Returns: array
    with keys report shortnames and values an array with indices 'display_name' and 'description' and 'category' and 'config_node'. the last is template config node for the report reports are sorted aplhpabeticaly by 'display_name'

getReportViews()

Get a list of the existing report views

  • Signature: static public function getReportViews()
  • Returns: array
    with keys report view names/index and values an array with indices 'display_name' and 'description' and 'report' and 'config_node', the last is the template confignode which contains the view reports are sorted alhpabeticaly by 'display_name'

getReportViewsByReport()

Get the report view sorted by report

  • Signature: static public function getReportViewsByReport()
  • Returns: array.
    a multi-dimensional array. the first index is the short name of the report. the second index is the name/index of the report view. This in turn refers to an array with keys 'display_name' and 'description' and 'config_node', the last is the template confignode which contains the view

getReportsByCategory()

Get the reports available by category

  • Signature: static public function getReportsByCategory($cheat)
  • Parameters:
    • $cheat
      • Default Value: false
  • Returns: array
    a multi-dimensional array. the first set of indices is the category sorted alphabetically the second set of indices are the reports for that category. for each of these we have an array indexed by 'display_name' and 'description' and 'config_node'. the last is template config node for the report the second set of indices is sorted alphabetically by 'display_name'

getTemplate()

Gets a template. Also caches the results

  • Signature: static public function getTemplate($type,$name)
  • Parameters:
    • string $type
      one of report, relationship or reportView. Defaults to null meaning we get everything under /modules/CustomReports
      • Default Value: null
    • string $name
      Defaults to null meaning we get all the <$type>s of the specified name
      • Default Value: null
  • Returns: I2CE_CustomReportTemplate
    on sucess