include/Dashlets/DashletGenericChart.php
\DashletGenericChart
Basic Dashlet
- Parent(s)
- \Dashlet
- Children
- \OpportunitiesByLeadSourceByOutcomeDashlet
- \MyPipelineBySalesStageDashlet
- \OutcomeByMonthDashlet
- \OpportunitiesByLeadSourceDashlet
- \PipelineBySalesStageDashlet
- \CampaignROIChartDashlet
Properties


string
$_configureTpl= ''include/Dashlets/DashletGenericChartConfigure.tpl''
location of smarty template file for configuring
'include/Dashlets/DashletGenericChartConfigure.tpl'
Details- Type
- string


array
$_searchFields= ''
Array of fields and thier defintions that we are searching on
- Type
- array


int
$autoRefresh= '"0"'
Time period in minutes to refresh the dashlet (0 for never) Do not refresh if $isRefreshable is set to false
Inherited from: \Dashlet::$$autoRefreshTo support auto refresh all refreshable dashlets that override process() must call processAutoRefresh()
"0"
Details- Type
- int
- Inherited_from
- \Dashlet::$$autoRefresh


array
$dashletStrings= ''
Language strings, must be loaded at the Dashlet level w/ loadLanguage
Inherited from: \Dashlet::$$dashletStrings- Type
- array
- Inherited_from
- \Dashlet::$$dashletStrings


bool
$isConfigPanelClearShown= 'true'
true if the Dashlet configuration options panel has the clear button
Inherited from: \Dashlet::$$isConfigPanelClearShowntrue
Details- Type
- bool
- Inherited_from
- \Dashlet::$$isConfigPanelClearShown


bool
$isConfigurable= 'true'
true if the Dashlet has configuration options.
true
Details- Type
- bool
- See
- \Dashlet::$isConfigurable


bool
$isRefreshable= 'true'
true if the Dashlet is refreshable (ie charts that provide their own refresh)
true
Details- Type
- bool
- See
- \Dashlet::$isRefreshable
Methods


__construct(
int $id, array $options
=
null
)
:
void
Constructor
Name | Type | Description |
---|---|---|
$id | int | |
$options | array |


constructGroupBy(
)
:
string
Returns the array of group by parameters for SugarChart::$group_by
Type | Description |
---|---|
string | SQL query |


constructQuery(
)
:
string
Returns the built query read to feed into SugarChart::getData()
Type | Description |
---|---|
string | SQL query |


display(
)
:
string
Displays the Dashlet, must call process() prior to calling this
Type | Description |
---|---|
string | HTML that displays Dashlet |


displayOptions(
)
:
string
Handles displaying the chart dashlet configuration popup window
Type | Description |
---|---|
string | HTML to return to the browser |


displayScript(
)
:
string
Displays the javascript for the dashlet
Type | Description |
---|---|
string | javascript to use with this dashlet |


getAutoRefreshOptions(
)
:
array
Returns the available auto refresh settings you can set a dashlet to
Inherited from: \Dashlet::getAutoRefreshOptions()Type | Description |
---|---|
array | options available |


getConfigureSmartyInstance(
)
:
void
Gets the smarty object for the config window. Designed to allow lazy loading the object when it's needed.


getHeader(
string $text
=
''
)
:
string
Name | Type | Description |
---|---|---|
$text | string | text after the title |
Type | Description |
---|---|
string | Header html |


getSeedBean(
)
:
object
Returns the DashletGenericChart::_seedBean object. Designed to allow lazy loading the object when it's needed.
Type | Description |
---|---|
object |


getTitle(
string $text
=
''
)
:
string
Name | Type | Description |
---|---|---|
$text | string |
Type | Description |
---|---|
string | HTML |


hasAccess(
)
:
bool
Override this in the subclass. It is used to determine whether the dashlet can be displayed.
Inherited from: \Dashlet::hasAccess()Type | Description |
---|---|
bool | indicating whether or not the current user has access to display this Dashlet. |


isAutoRefreshable(
)
:
bool
Returns true if the dashlet is auto refreshable
Inherited from: \Dashlet::isAutoRefreshable()Type | Description |
---|---|
bool |


loadLanguage(
string $dashletClassname, string $dashletDirectory
=
'modules/Home/Dashlets/'
)
:
void
Name | Type | Description |
---|---|---|
$dashletClassname | string | classname of the dashlet |
$dashletDirectory | string | directory path of the dashlet |


loadOptions(
)
:
array
Generic way to retrieve options array from UserPreferences
Inherited from: \Dashlet::loadOptions()Type | Description |
---|---|
array | options array stored in UserPreferences |


process(
)
:
void
Override if you need to do pre-processing before display is called
Inherited from: \Dashlet::process()

processAutoRefresh(
int $dashletOffset
=
0
)
:
string
Processes and displays the auto refresh code for the dashlet
Name | Type | Description |
---|---|---|
$dashletOffset | int |
Type | Description |
---|---|
string | HTML code |


saveOptions(
array $req
)
:
array
Saves the chart config options Filter the $_REQUEST and only save only the needed options
Name | Type | Description |
---|---|---|
$req | array |
Type | Description |
---|---|
array |


setRefreshIcon(
)
:
string
Returns the HTML for the refresh icon
Type | Description |
---|---|
string | HTML |


storeOptions(
array $optionsArray
)
:
void
Generic way to store an options array into UserPreferences
Inherited from: \Dashlet::storeOptions()Name | Type | Description |
---|---|---|
$optionsArray | array | the array to save |