include/Dashlets/DashletGeneric.php
\DashletGeneric
Generic Dashlet class
- Parent(s)
- \Dashlet
- Children
- \SugarFavoritesDashlet
- \MyCallsDashlet
- \MyReportsDashlet
- \MyProjectTaskDashlet
- \MyDocumentsDashlet
- \MyAccountsDashlet
- \MyOpportunitiesDashlet
- \MyMeetingsDashlet
- \MyNotesDashlet
- \SugarFeedDashlet
- \MyTasksDashlet
- \MyLeadsDashlet
- \MyContactsDashlet
- \MyQuotesDashlet
- \MyCasesDashlet
- \MyBugsDashlet
- \MyEmailsDashlet
- \<module_name>Dashlet
- Api
Properties

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

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

array
$currentSearchFields= ''
search inputs to be populated in configure template.
modify this after processDisplayOptions, but before displayOptions to modify search inputs
- Type
- array

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

array
$displayColumns= 'null'
Actual columns to display, will be a subset of $columns
nullDetails- Type
- array

string
$displayTpl= ''include/Dashlets/DashletGenericDisplay.tpl''
location of Smarty template file for display
'include/Dashlets/DashletGenericDisplay.tpl'Details- Type
- string

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= 'false'
falseDetails- Type
- bool
- Inherited_from
- \Dashlet::$$isConfigurable

bool
$isRefreshable= 'true'
true if the Dashlet is refreshable (ie charts that provide their own refresh)
Inherited from: \Dashlet::$$isRefreshabletrueDetails- Type
- bool
- Inherited_from
- \Dashlet::$$isRefreshable

bool
$myItemsOnly= 'true'
Flag to display only the current users's items.
trueDetails- Type
- bool

bool
$showMyItemsOnly= 'true'
Flag to display "myItemsOnly" checkbox in the DashletGenericConfigure.
trueDetails- Type
- bool

string
$title= ''Generic Dashlet''
'Generic Dashlet'Details- Type
- string
- Inherited_from
- \Dashlet::$$title
Methods

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

displayOptions(
)
:
stringDisplays the options for this Dashlet
| Type | Description |
|---|---|
| string | HTML that shows options |

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

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

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(
$lvsParams
=
array()
)
:
voidDoes all dashlet processing, here's your chance to modify the rows being displayed!
| Name | Type | Description |
|---|---|---|
| $lvsParams |

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

processDisplayOptions(
)
:
stringSets up the display options template
| Type | Description |
|---|---|
| string | HTML that shows options |

saveOptions(
array $req
)
:
arrayFilter the $_REQUEST and only save only the needed options
| Name | Type | Description |
|---|---|---|
| $req | array | the array to pull options from |
| Type | Description |
|---|---|
| array | options array |

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 |