Class: I2CE CustomReport Display
This article describes the abstract class I2CE_CustomReport_Display.
- Extends the class: I2CE_Fuzzy.
- Child Classes:
- Location: Part of the module CustomReports in the package I2CE
- Source: Defined in the file modules/CustomReports/lib/I2CE_CustomReport_Display.php
- Author: Carl Leitner <litlfred@ibiblio.org>
I2CE_CustomReport_Display
Variables
$formObjs
an array indexed by forms
- Type: protected array $formObjs
$mappedFields
- Type: protected $mappedFields
$formMaps
An array where keys are of the "$reportform(+field(+$aggregate))" and the values are the corresponding "$form+$field" (that is the real form for the later) @var protected array $maps
- Type: protected $formMaps
$fieldMaps
An array where keys are of the "$reportform(+field(+$aggregate))" and the values are the corresponding "$form+$field" (that is the real form for the later)
- Type: protected array $fieldMaps
$mappedValues
- Type: protected $mappedValues
$display
The shortname for the display. E.g. 'Default'
- Type: protected string $display
$reportObj
- Type: protected I2CE_CustomReport $reportObj
$defaultOptions
The options for this display
- Type: protected $defaultOptions
$view
the view we are displaying
- Type: protected string $view
$page
The page we are displaying on
- Type: protected I2CE_Page $page
$template
- Type: protected I2CE_TemplateMeister $template
$displayConfig
The magic data node which holds the information about the display that is being used
- Type: protected I2CE_MagicDataNode $displayConfig
$config
The magic data node which holds the information about this view
- Type: protected I2CE_MagicDataNode $config
$reportConfig
The magic data node which holds the information about the report this view referes to
- Type: protected I2CE_MagicDataNode $reportConfig
$relationshipConfig
The magic data node which holds the information about the relationship this view refers to
- Type: protected I2CE_MagicDataNode $relationshipConfig
$numeric
array with keys the 'reportformfields' and values the data associated to it. these fields are those we assume have a numeric representation
- Type: protected array $numeric
$row_start
The starting row (if any) for limiting the results. If not used, it is false mixed $row_start
- Type: protected procted $row_start
$row_amount
The number of rows (if any) for limiting the results. If not used, it is false mixed $row_amount
- Type: protected procted $row_amount
$reportViewsFactory
- Type: protected $reportViewsFactory
$displayedFields
- Type: private $displayedFields
Methods
__construct()
The constuctor
- Signature: public function __construct($page,$view)
- Parameters:
canView()
Abstract method that each display is resposbile for implementing. Checks to see if it can display the given view.
- Signature: abstract protected function canView()
- Returns: boolean
display()
Display the report
- Signature: public function display($contentNode,$processResults,$controls)
- Parameters:
- DOMNode $contentNode
The DOM node we wish to display into. If null, we do not do any of the DOM processing stuff, do not call the report display controls, limits etc. It will however still call processResults with a DOMNode of null - boolean $processResults
Defaults to true meaning we run through the results. If false, we do not process results.- Default Value: true
- mixed $controls
If null (default), we display all the report controsl. If string or an array of string, we only display the indicated controls- Default Value: null
- DOMNode $contentNode
- Returns: boolean.
true on sucess
displayMetaInfo()
- Signature: protected function displayMetaInfo($contentNode)
- Parameters:
- $contentNode
displayReportControl()
Adds any controls for this display to the content node
- Signature: protected function displayReportControl($contentNode)
- Parameters:
- DOMNode $contentNode
displayReportControls()
Adds any report display controls that can be added for this view. @param DOMNode $conentNode
- Signature: protected function displayReportControls($contentNode,$controls)
- Parameters:
- $contentNode
- mixed $controls
If null (default), we display all the report controsl. If string or an array of string, we only display the indicated controls- Default Value: null
- Returns: boolean
$true on success
displayReportLimit()
Adds the report limit node to its content node @param DOMNode $limitnode
- Signature: protected function displayReportLimit($contentNode,$limitNode,$limitConfig)
- Parameters:
- DOMNode $contentNode
- $limitNode
- I2CE_MagicDataNode $limitConfig
displayReportLimits()
Displays any report limits in the content node
- Signature: protected function displayReportLimits($contentNode)
- Parameters:
- DOMNode $contentNode
findNumericFields()
Find the numeric fields. Returns it (and stores in in the variable $this->numeric)
- Signature: protected function findNumericFields($disabled)
- Parameters:
- $disabled
- Default Value: false
- $disabled
- Returns: @array.
Keys are report for fields and values are the data associate defined in getDisplayedFields()
getBasePage()
- Signature: protected function getBasePage()
getDefaultOptions()
returns an array of the default display options. Default options are read and overriddenb in the following order: /modules/CustomReports/displays/$display/display_options /modules/CustomReports/relationships/display_options/$display /modules/CustomReports/reports/display_options/$display /modules/CustomReports/reportViews/$view/display_options/$display Finally any options that have a key in $get are replaced by that value
- Signature: protected function getDefaultOptions($get,$options)
- Parameters:
- Returns: mixed
array or false on failure
getDisplayFieldsData()
Gets the data about the fields we are going to display.
- Signature: protected function getDisplayFieldsData()
getFormFieldObjects()
Get the form and field objects associated to a formfield string.
- Signature: protected function getFormFieldObjects($reportformfield,$isReportForm)
- Parameters:
- string $reportformfield
of the re[prt form "$form" "$form+$field" or "$form+$field+$aggregate" @parmam boolean $isReportForm Defaults to true. If true we a sending a report form field If false, we are working with a form field. - $isReportForm
- Default Value: true
- string $reportformfield
- Returns: array.
Index 0 is an I2CE_Form (on success, false on failure), Index 1 is an I2CE_FormField on succces, false on failure
getMappedValue()
Gets the mapped value for a report form field.
- Signature: protected function getMappedValue($reportformfield,$value,$isReportForm)
- Parameters:
- string $reportformfield
or a report form field or a form field of the form "$reportform+$field" or "$reportform+$field+$aggreate" or "$form+field" @param value @parmam boolean $isReportForm Defaults to true. If true we a sending a report form field If false, we are working with a form field. - $value
- $isReportForm
- Default Value: true
- string $reportformfield
- Returns: string
the origina value of on failure, the mapped value on success
getReportViewDisplayedFields()
Returns an array in (default display order) with keys reportformfields and values an array with indices 'header', 'link' The value of 'header' is the display header for this field The value of 'link' is false if there is no linked page associtated to this field or a string if there is. @param Mixed $all_aggerates Defaults to false. If true we include all information about aggregate and non-agregate versions of the fields. otherwise it can be an array of aggregate information that we want
- Signature: protected function getReportViewDisplayedFields($getDisabled,$all_aggregates)
- Parameters:
- boolean $getDisabled
Defaults to false;- Default Value: false
- $all_aggregates
- Default Value: false
- boolean $getDisabled
- Returns: array;
getReportViewsFactory()
- Signature: protected function getReportViewsFactory()
getResults()
@param array $limits an nested array defining limiting values for particular fields. Defaults to the empty array.
- Signature: protected function getResults()
- Returns: mixed
false on failure on succes an array. at index 'results' and MDB2 buffered result object at index 'num_results' the number of results that would be found without the limit
getSwissReport()
- Signature: protected function getSwissReport()
getSwissReportFunction()
- Signature: protected function getSwissReportFunction($func)
- Parameters:
- $func
getSwissReportView()
- Signature: protected function getSwissReportView()
isMapped()
Checks to see if a form field is mapped
- Signature: protected function isMapped($reportformfield)
- Parameters:
- string $reportformfield
of the form "$reportform+$fiedld(+$aggregate)"
- string $reportformfield
mapReportFormField()
Sets the maps
- Signature: protected function mapReportFormField($reportformfield)
- Parameters:
- string $reportformfield
mapResults()
Maps any mapped fields in a results.
- Signature: protected function mapResults($result)
- Parameters:
- array $result
A an array with inicies of the form "$reportform+$field(+$aggregate)" with unmapped value
- array $result
- Returns: array
the mapped results
processResultRow()
Process a result row.
- Signature: protected function processResultRow($row,$row_num,$contentNode)
- Parameters:
- Returns: boolean.
True on success
processResults()
Process results
- Signature: protected function processResults($results_data,$contentNode)
- Parameters:
processWhere()
Process the fields to make limits based on their limiting values @param array $limits an array defining limiting values for particular fields
- Signature: protected function processWhere($limitValues)
- Parameters:
- $limitValues
- Returns: string
processWhereByField()
- Signature: protected function processWhereByField($form,$field,$formObj,$limitStyles)
- Parameters:
processWhereByFunction()
- Signature: protected function processWhereByFunction($function,$limitStyles)
- Parameters:
saveDefaultView()
- Signature: public function saveDefaultView()
saveDisplayOptions()
- Signature: public function saveDisplayOptions()
setupMappedValues()
Stores the array of mapped value for a formfield in {@var $formfield} @parmam boolean $isReportForm Defaults to true. If true we a sending a report form field If false, we are working with a form field.
- Signature: protected function setupMappedValues($reportformfield,$isReportForm)
- Parameters:
- string $reportformfield
- $isReportForm
- Default Value: true
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()