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::$$isConfigPanelClearShowntrueDetails- Type
- bool
- Inherited_from
- \Dashlet::$$isConfigPanelClearShown

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

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

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

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

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

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

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

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

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

getConfigureSmartyInstance(
)
:
voidGets 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(
)
:
objectReturns 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(
)
:
boolOverride 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(
)
:
boolReturns 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(
)
:
arrayGeneric way to retrieve options array from UserPreferences
Inherited from: \Dashlet::loadOptions()| Type | Description |
|---|---|
| array | options array stored in UserPreferences |

process(
)
:
voidOverride if you need to do pre-processing before display is called
Inherited from: \Dashlet::process()
processAutoRefresh(
int $dashletOffset
=
0
)
:
stringProcesses and displays the auto refresh code for the dashlet
| Name | Type | Description |
|---|---|---|
| $dashletOffset | int |
| Type | Description |
|---|---|
| string | HTML code |

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

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

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