Documentation

Vtiger_Widget_Model extends Base
in package

Vtiger Widget Model Class.

Table of Contents

DEFAULT_LABELS  = ['Activities' => 'LBL_ACTIVITIES', 'DetailView' => 'LBL_RECORD_DETAILS', 'GeneralInfo' => 'LBL_RECORD_SUMMARY']
$customFields  : array<string|int, mixed>
$editFields  : array<string|int, mixed>
$value  : array<string|int, mixed>
__construct()  : mixed
Constructor.
clearDeviceConf()  : void
Clear configuration of widgets for this device.
delete()  : bool
Remove widget template.
get()  : mixed
Function to get the value for a given key.
getArray()  : array<string|int, mixed>
Function to get the array values for a given key.
getDashboardId()  : int
Get dashboard id.
getData()  : array<string|int, mixed>
Function to get all the values of the Object.
getDataValue()  : mixed
Gets value from data column.
getDeleteUrl()  : string
Function returns URL that will remove a widget for a User.
getEditFields()  : array<string|int, mixed>
Gets fields for edit view.
getFieldInstanceByName()  : Vtiger_Field_Model
Gets field instance by name.
getForHtml()  : mixed
Function to get the html encoded value for a given key.
getForSql()  : mixed
Function to get the value if its safe to use for SQL Query (column).
getHeight()  : mixed
getId()  : int
Get ID.
getInstance()  : mixed
getInstanceFromValues()  : Vtiger_Widget_Model
Function to get the instance of Vtiger Widget Model from the given array of key-value mapping.
getInstanceWithTemplateId()  : mixed
getInstanceWithWidgetId()  : self
Get widget instance by id.
getKeys()  : array<string|int, string>
Function to get keys.
getName()  : mixed
getPosition()  : int
Function to get the position of the widget.
getSettingsLinks()  : array<string|int, mixed>
Function to get the Quick Links in settings view.
getTitle()  : mixed
Function to get the Title of the widget.
getTranslatedTitle()  : string
Function to get the translated title.
getUrl()  : string
Function to get the url of the widget.
getWidth()  : mixed
has()  : bool
Function to check if the key exists.
isCreatable()  : bool
Check if the widget is creatable.
isDefault()  : bool
Function to check the Widget is Default widget or not.
isDeletable()  : bool
Check if the widget is removable.
isEmpty()  : bool
Function to check if the key is empty.
isViewable()  : bool
Check if the widget is viewable.
processWidget()  : mixed
Process the UI Widget requested.
remove()  : mixed
Function to remove the widget from the Users Dashboard.
removeWidgetFromList()  : mixed
Remove widget from list in dashboard. Removing is possible only for widgets from filters.
save()  : bool
Function to save.
set()  : $this
Function to set the value for a given key.
setData()  : $this
Function to set all the values.
setDataFromRequest()  : mixed
Sets data from request.
show()  : mixed
Function to show a widget from the Users Dashboard.
updateWidgetPosition()  : mixed
updateWidgetSize()  : mixed
Update widget size.

Constants

DEFAULT_LABELS

public array<string|int, mixed> DEFAULT_LABELS = ['Activities' => 'LBL_ACTIVITIES', 'DetailView' => 'LBL_RECORD_DETAILS', 'GeneralInfo' => 'LBL_RECORD_SUMMARY']

Default labels

Properties

$customFields

public array<string|int, mixed> $customFields = []

Custom fields for edit

$editFields

public array<string|int, mixed> $editFields = ['isdefault' => ['label' => 'LBL_MANDATORY_WIDGET', 'purifyType' => \App\Purifier::BOOL], 'cache' => ['label' => 'LBL_CACHE_WIDGET', 'purifyType' => \App\Purifier::BOOL], 'width' => ['label' => 'LBL_WIDTH', 'purifyType' => \App\Purifier::INTEGER], 'height' => ['label' => 'LBL_HEIGHT', 'purifyType' => \App\Purifier::INTEGER]]

Fields for edit

$value

protected array<string|int, mixed> $value

Values

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $values = [] ]) : mixed
Parameters
$values : array<string|int, mixed> = []
Return values
mixed

clearDeviceConf()

Clear configuration of widgets for this device.

public static clearDeviceConf(int $dashboardId) : void
Parameters
$dashboardId : int
Return values
void

delete()

Remove widget template.

public delete() : bool
Return values
bool

get()

Function to get the value for a given key.

public get(string $key) : mixed
Parameters
$key : string
Return values
mixed

Value for the given key

getArray()

Function to get the array values for a given key.

public getArray(string $key[, array<string|int, mixed> $value = [] ]) : array<string|int, mixed>
Parameters
$key : string
$value : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getDashboardId()

Get dashboard id.

public static getDashboardId(Request $request) : int
Parameters
$request : Request
Return values
int

getData()

Function to get all the values of the Object.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDataValue()

Gets value from data column.

public getDataValue(string $name) : mixed
Parameters
$name : string
Return values
mixed

getDeleteUrl()

Function returns URL that will remove a widget for a User.

public getDeleteUrl() : string
Return values
string

getEditFields()

Gets fields for edit view.

public getEditFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldInstanceByName()

Gets field instance by name.

public getFieldInstanceByName(string $name) : Vtiger_Field_Model
Parameters
$name : string
Return values
Vtiger_Field_Model

getForHtml()

Function to get the html encoded value for a given key.

public getForHtml(string $key) : mixed
Parameters
$key : string
Return values
mixed

getForSql()

Function to get the value if its safe to use for SQL Query (column).

public getForSql(string $key[, bool $skipEmtpy = true ]) : mixed
Parameters
$key : string
$skipEmtpy : bool = true

Skip the check if string is empty

Return values
mixed

Value for the given key

getHeight()

public getHeight() : mixed
Return values
mixed

getId()

Get ID.

public getId() : int
Return values
int

getInstance()

public static getInstance(mixed $linkId, mixed $userId) : mixed
Parameters
$linkId : mixed
$userId : mixed
Return values
mixed

getInstanceFromValues()

Function to get the instance of Vtiger Widget Model from the given array of key-value mapping.

public static getInstanceFromValues(array<string|int, mixed> $valueMap) : Vtiger_Widget_Model
Parameters
$valueMap : array<string|int, mixed>
Return values
Vtiger_Widget_Model

instance

getInstanceWithTemplateId()

public static getInstanceWithTemplateId(int $widgetId) : mixed
Parameters
$widgetId : int
Return values
mixed

getInstanceWithWidgetId()

Get widget instance by id.

public static getInstanceWithWidgetId(int $widgetId, int $userId) : self
Parameters
$widgetId : int
$userId : int
Return values
self

getKeys()

Function to get keys.

public getKeys() : array<string|int, string>
Return values
array<string|int, string>

getName()

public getName() : mixed
Return values
mixed

getPosition()

Function to get the position of the widget.

public getPosition(int $position, string $coordinate) : int
Parameters
$position : int
$coordinate : string
Tags
throws
AppException
Return values
int

Function to get the Quick Links in settings view.

public getSettingsLinks() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of Vtiger_Link_Model instances

getTitle()

Function to get the Title of the widget.

public getTitle() : mixed
Return values
mixed

getTranslatedTitle()

Function to get the translated title.

public getTranslatedTitle() : string
Return values
string

getUrl()

Function to get the url of the widget.

public getUrl() : string
Return values
string

getWidth()

public getWidth() : mixed
Return values
mixed

has()

Function to check if the key exists.

public has(string $key) : bool
Parameters
$key : string
Return values
bool

isCreatable()

Check if the widget is creatable.

public isCreatable() : bool
Return values
bool

isDefault()

Function to check the Widget is Default widget or not.

public isDefault() : bool
Return values
bool

isDeletable()

Check if the widget is removable.

public isDeletable() : bool
Return values
bool

isEmpty()

Function to check if the key is empty.

public isEmpty(string $key) : bool
Parameters
$key : string
Return values
bool

isViewable()

Check if the widget is viewable.

public isViewable() : bool
Return values
bool

processWidget()

Process the UI Widget requested.

public processWidget(Vtiger_Link_Model $widgetLink, Vtiger_Record_Model $recordModel) : mixed
Parameters
$widgetLink : Vtiger_Link_Model
$recordModel : Vtiger_Record_Model
Return values
mixed

remove()

Function to remove the widget from the Users Dashboard.

public remove([string $action = 'hide' ]) : mixed
Parameters
$action : string = 'hide'
Return values
mixed

removeWidgetFromList()

Remove widget from list in dashboard. Removing is possible only for widgets from filters.

public static removeWidgetFromList(int $id) : mixed
Parameters
$id : int
Return values
mixed

save()

Function to save.

public save() : bool
Return values
bool

set()

Function to set the value for a given key.

public set(string $key, mixed $value) : $this
Parameters
$key : string
$value : mixed
Return values
$this

setData()

Function to set all the values.

public setData(mixed $values) : $this
Parameters
$values : mixed
Return values
$this

setDataFromRequest()

Sets data from request.

public setDataFromRequest(Request $request) : mixed
Parameters
$request : Request
Return values
mixed

show()

Function to show a widget from the Users Dashboard.

public show() : mixed
Return values
mixed

updateWidgetPosition()

public static updateWidgetPosition(mixed $position, mixed $linkId, mixed $widgetId, mixed $userId) : mixed
Parameters
$position : mixed
$linkId : mixed
$widgetId : mixed
$userId : mixed
Return values
mixed

updateWidgetSize()

Update widget size.

public static updateWidgetSize(string $size, int $linkId, int $widgetId, int $userId) : mixed
Parameters
$size : string
$linkId : int
$widgetId : int
$userId : int
Return values
mixed

        

Search results