Xataface Summary Module 0.1
Summary Reports for Xataface Apps
Public Member Functions
actions_summary_page Class Reference

This HTML action displays the summary list for a particular table. It respects all normal Xataface URL query parameters in addition to 2 custom parameters: More...

Public Member Functions

 handle ($params)
 Entry point for the action.
 supports ($fieldname, $funcname)
 Utility function to check if a particular aggregate function is supported on a particular column/field.
 getSummaryLabel ($col)
 Utility method to get the label for a particular summary column on the current table.
 getFieldLabel ($col)
 Utility function to retrieve the label of a regular table column.
 isSelectedGroupField ($fieldname)
 Checks whether a particular field is one of the currently selected group-by fields.
 isSelectedSummaryField ($fieldname, $func=null)
 Checks whether a paricular field (and optionally function) are currently selected to be included as a column in the summary stats list.
 get ($array, $key)
 Convenience method to fetch a value from an associative array.
 getSelectedSummaryColumns ()
 Returns an array of the currently selected summary columns.
 getCellValue ($fieldname, $value)
 explainQueryParam ($label, $value)
 getCurrentFilters ()

Detailed Description

This HTML action displays the summary list for a particular table. It respects all normal Xataface URL query parameters in addition to 2 custom parameters:

Parameters:
string-group-by A comma-delimited list of fields on which to group the summaries by.
string-summary-cols A comma-delimited list of summary columns to display.

Templates

This action uses the xataface/modules/summary/main.html template which extends Dataface_Main_Template.html

It is located in the templates directory of this module and can be overridden in the application templates directory just like any other template.

Javascript

This action uses the Dataface_JavascriptTool to manage its javascript dependencies. Its main javascript file (which registers its own dependencies) is located at js/xataface/modules/summary/summary-page.js.

CSS

This action uses the Dataface_CSSTool class to manage its CSS dependencies. Its main CSS file is located at css/xataface/modules/summary/main_summary_page.css

Permissions

This action requires the "summary" permission in order to access it. The module assigns this permission only to the ADMIN, and MANAGER roles by default. You must manually add this permission to any role that you wish to have access.

Attention:
Users must also be granted the "summary view" and "summary group" permissions on each field that you want them to be able to see in the summary section. You should assign this at the table level.

Definition at line 61 of file summary_page.php.


Member Function Documentation

explainQueryParam ( label,
value 
)

Definition at line 465 of file summary_page.php.

get ( array,
key 
)

Convenience method to fetch a value from an associative array.

This is used from within the xataface/modules/summary/main.html template to show which of the grouped-by fields are selected in the select list.

Parameters:
array$arrayThe associative array from which to retrieve the value.
string$keyThe key of the array to retrieve.
Returns:
mixed The value (same as $array[$key])

Definition at line 444 of file summary_page.php.

getCellValue ( fieldname,
value 
)

Definition at line 456 of file summary_page.php.

getCurrentFilters ( )

Definition at line 498 of file summary_page.php.

getFieldLabel ( col)

Utility function to retrieve the label of a regular table column.

This is used from within the xataface/modules/summary/main.html template to display the column headings.

Parameters:
string$colThe name of the field/column whose label we wish to retrieve.
Returns:
string The field label.

Definition at line 391 of file summary_page.php.

getSelectedSummaryColumns ( )

Returns an array of the currently selected summary columns.

Returns:
array(string)

Definition at line 450 of file summary_page.php.

getSummaryLabel ( col)

Utility method to get the label for a particular summary column on the current table.

This is used from within the xataface/modules/summary/main.html template to display the column headings.

For the sake of this action, summary columns generated with a wrapping function (e.g. max(colname)) are given a calculated column name in the form: colname__funcname

E.g. max(amount) would have the name amount__max for the purpose of this method's $col parameter.

Parameters:
string$colThe name of the column for which to retrieve the label.
Returns:
string The column label.

Definition at line 373 of file summary_page.php.

handle ( params)

Entry point for the action.

Definition at line 97 of file summary_page.php.

isSelectedGroupField ( fieldname)

Checks whether a particular field is one of the currently selected group-by fields.

This is used from within the xataface/modules/summary/main.html template to show which of the grouped-by fields are selected in the select list.

Parameters:
string$fieldnameThe name of the field to check.
Returns:
boolean True if the field is one of the currently selected group-by fields.

Definition at line 410 of file summary_page.php.

isSelectedSummaryField ( fieldname,
func = null 
)

Checks whether a paricular field (and optionally function) are currently selected to be included as a column in the summary stats list.

This is used from within the xataface/modules/summary/main.html template to decide which of the possible summary fields should be selected in the select list.

Parameters:
string$fieldnameThe name of the field to check.
string$funcThe name of the function to apply to the field.
Returns:
boolean True if the field/function is selected in the select list (or should be).

Definition at line 426 of file summary_page.php.

supports ( fieldname,
funcname 
)

Utility function to check if a particular aggregate function is supported on a particular column/field.

This is used from within the xataface/modules/summary/main.html template to decide which options to provide in the summary fields select list.

Parameters:
string$fieldnameThe name of the field to check.
string$funcnameThe name of the function we are checking for eligibility.
Returns:
boolean True if the given field can have the given function applied to it.

Definition at line 336 of file summary_page.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions