CSDashboard
in package
This class is part of the Dashboard module.
Tags
Table of Contents
- CONTEXT_TYPE_FOLDER = 'folder'
- Defines the context type "folder".
- CONTEXT_TYPE_MODULE = 'module'
- Defines the context type "module".
- CONTEXT_TYPE_RECORD = 'record'
- Defines the context type "record".
- TYPE_GLOBAL = 'global'
- Defines the global dashboard type.
- TYPE_PORTAL = 'portal'
- Defines the portal dashboard type.
- TYPE_STUDIO = 'studio'
- Defines the studio dashboard type.
- $_iDashboardUserId : mixed
- $_oDashboardRecord : mixed
- copyDashboard() : mixed
- This method is used to copy all tiles from one dashboard into another dashboard
- createDashboard() : CSDashboard
- This method is used to create a new dashboard.
- createTile() : array<string|int, mixed>
- This method is used to create a tile on the current dashboard.
- deleteTiles() : mixed
- This api is used to delete all Tiles and Tile Parameters from database
- getAccessIds() : array<string|int, mixed>
- This method is used to return the access ids (user and group ids of users who have access to the dashboard) of the dashboard as array.
- getAllDashboards() : array<string|int, mixed>
- This method is used to return all dashboards.
- getAllDashboardUsers() : array<string|int, mixed>
- This method is used the get all users of all dashboards.
- getCreatorId() : int
- This method is used to return the user id of the creator of the dashboard.
- getDashboard() : CSDashboard
- This method is used to get an existing dashboard.
- getDashboardConfigurationForModuleName() : mixed
- Returns the DashboardConfiguration record for the current dashboard with a given module
- getDashboardsForUserId() : array<string|int, mixed>
- This method returns all global dashboards to which the user with the specified id has access.
- getDashboardsForUserIdAndTypes() : array<string|int, mixed>
- This method returns all dashboards matching the user id and types filter. Normally dashboard types are defined within module files. A valid example for a dashboard type filter is:
- getDashboardUrlForObject() : string
- Returns a dashboard url by evaluating the provided object and generating the dashboard url including the current object context. In case no matching dashboard was found, this method returns null.
- getDashboardUserId() : int
- This method returns sanitized user id of dashboard.
- getID() : int
- This method is used to return the id of the dashboard.
- getLabel() : string
- This method is used to return the label of the dashboard.
- getModuleBaseDirectory() : string
- This method is used the get the base directory path of the module.
- getProductIcon() : string
- This method returns the path to the dashboard icon.
- getRecordByType() : Record|null
- Returns the record for a given dashboard type.
- getRecordNameByType() : string
- Returns the record name for a given dashboard type.
- getRecordNamesByTypes() : array<string|int, mixed>
- Returns the record names for the given dashboard types
- getRecordsByTypes() : array<string|int, mixed>
- Returns the record names and the correspondent record for the given dashboard types
- getReferenceEditorType() : CSReferenceEditorType
- Builds a standard reference editor type for the record passed as parameter.
- getSupportedClassOperatorLabels() : array<string|int, mixed>
- Returns the supported class operator labels.
- getSupportedDashboardTypes() : array<string|int, mixed>
- Returns all available dashboard types defined in licensed modules.
- getTiles() : array<string|int, CSDashboardTile>
- This method is used to return all tiles of the current dashboard as an array of CSDashboardTile objects.
- getTypes() : array<string|int, mixed>
- This method is used to return the context types for which the dashboard is available.
- getUrl() : mixed
- Returns the URL to the current dashboard.
- getUrlForContextTypeAndRecord() : mixed
- This method is similar to "getUrlForContextTypeAndValue", except it takes a record as ContextValue parameter. This record is then separated into its class and id (by colon) to be passed as context value.
- getUrlForContextTypeAndValue() : mixed
- Returns the URL to the current dashboard including the specified context parameters.
- getUserId() : int
- This method is used to return the user id of the current dashboard context.
- guessDashboardIdForUser() : int
- This method is used to guess the dashboard id for the current user.
Constants
CONTEXT_TYPE_FOLDER
Defines the context type "folder".
public
mixed
CONTEXT_TYPE_FOLDER
= 'folder'
Tags
CONTEXT_TYPE_MODULE
Defines the context type "module".
public
mixed
CONTEXT_TYPE_MODULE
= 'module'
Tags
CONTEXT_TYPE_RECORD
Defines the context type "record".
public
mixed
CONTEXT_TYPE_RECORD
= 'record'
Tags
TYPE_GLOBAL
Defines the global dashboard type.
public
mixed
TYPE_GLOBAL
= 'global'
Tags
TYPE_PORTAL
Defines the portal dashboard type.
public
mixed
TYPE_PORTAL
= 'portal'
Tags
TYPE_STUDIO
Defines the studio dashboard type.
public
mixed
TYPE_STUDIO
= 'studio'
Tags
Properties
$_iDashboardUserId
public
mixed
$_iDashboardUserId
= 0
Tags
$_oDashboardRecord
public
mixed
$_oDashboardRecord
= \null
Tags
Methods
copyDashboard()
This method is used to copy all tiles from one dashboard into another dashboard
public
copyDashboard(int $iNewDashboardID) : mixed
Parameters
- $iNewDashboardID : int
-
ID of the new duplicated dashboard in which tiles should be copied
Tags
Return values
mixed —createDashboard()
This method is used to create a new dashboard.
public
static createDashboard(string $sLabel, string $sAccessIds[, array<string|int, mixed> $aTypes = array() ]) : CSDashboard
Parameters
- $sLabel : string
-
the label for the new dashboard
- $sAccessIds : string
-
the user ids / group ids which should have access to this dashboard
- $aTypes : array<string|int, mixed> = array()
-
the types for which this dashboard is valid
Tags
Return values
CSDashboard —a object of the newly created dashboard
createTile()
This method is used to create a tile on the current dashboard.
public
createTile(string $sLabel, string $sApp, string $sAppScreen, int $iUserId, int $iSortOrder, string $sSize, array<string|int, mixed> $aTileParameter, string $sCategory, bool $bChangeable) : array<string|int, mixed>
Parameters
- $sLabel : string
-
the label for the tile
- $sApp : string
-
the app name of the app which should be shown inside of the tile
- $sAppScreen : string
-
the app screen name of the app which should be shown inside of the tile
- $iUserId : int
-
the user id of the tile creator
- $iSortOrder : int
-
the sort order of the tile
- $sSize : string
-
the size of the tile
- $aTileParameter : array<string|int, mixed>
-
the tile parameters as array, the array key is the parameter name and the value the parameter value
- $sCategory : string
-
optional. the category of the tile
- $bChangeable : bool
-
whether the tile is changeable by any user or not
Tags
Return values
array<string|int, mixed> —Containing the tile configuration and tile parameters. [ 'TileConfiguration' => [], 'TileParameters' => [] ]
deleteTiles()
This api is used to delete all Tiles and Tile Parameters from database
public
deleteTiles() : mixed
Tags
Return values
mixed —getAccessIds()
This method is used to return the access ids (user and group ids of users who have access to the dashboard) of the dashboard as array.
public
getAccessIds() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getAllDashboards()
This method is used to return all dashboards.
public
static getAllDashboards() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Array containing CSDashboard objects
getAllDashboardUsers()
This method is used the get all users of all dashboards.
public
static getAllDashboardUsers([mixed $bReturnOnlyIds = false ]) : array<string|int, mixed>
Parameters
- $bReturnOnlyIds : mixed = false
Tags
Return values
array<string|int, mixed> —Array containing User Objects or Array of User Ids.
getCreatorId()
This method is used to return the user id of the creator of the dashboard.
public
getCreatorId() : int
Tags
Return values
int —getDashboard()
This method is used to get an existing dashboard.
public
static getDashboard(int $iDashboardId[, int $iUserId = NULL ]) : CSDashboard
Parameters
- $iDashboardId : int
-
the id of the dashboard
- $iUserId : int = NULL
-
the id of the user under which context the dashboard should be opened
Tags
Return values
CSDashboard —a object of the requested dashboard
getDashboardConfigurationForModuleName()
Returns the DashboardConfiguration record for the current dashboard with a given module
public
getDashboardConfigurationForModuleName(string $sModuleName) : mixed
Parameters
- $sModuleName : string
-
Module type (e.g. pdm, mam)
Tags
Return values
mixed —getDashboardsForUserId()
This method returns all global dashboards to which the user with the specified id has access.
public
static getDashboardsForUserId(int $iUserId) : array<string|int, mixed>
Parameters
- $iUserId : int
-
The user id for which the dashboards should be returned.
Tags
Return values
array<string|int, mixed> —List of dashboard objects matching the user filter.
getDashboardsForUserIdAndTypes()
This method returns all dashboards matching the user id and types filter. Normally dashboard types are defined within module files. A valid example for a dashboard type filter is:
public
static getDashboardsForUserIdAndTypes(int $iUserId, array<string|int, mixed> $aTypes[, Item $oContext = null ]) : array<string|int, mixed>
array( 'global', 'mam:studio', 'pim:studio' );
Parameters
- $iUserId : int
-
The user id for which the dashboards should be returned.
- $aTypes : array<string|int, mixed>
-
The types for which the dashboards should be filtered.
- $oContext : Item = null
-
The context object
Tags
Return values
array<string|int, mixed> —List of dashboard objects matching the user and types filter.
getDashboardUrlForObject()
Returns a dashboard url by evaluating the provided object and generating the dashboard url including the current object context. In case no matching dashboard was found, this method returns null.
public
static getDashboardUrlForObject(mixed $oObject) : string
Parameters
- $oObject : mixed
-
The context object for which the dashboard url should be generated. Currently only Record and CSModule instances are supported.
Tags
Return values
string —The dashboard url or null if no dashboard was found.
getDashboardUserId()
This method returns sanitized user id of dashboard.
public
static getDashboardUserId(int $iUserId) : int
Parameters
- $iUserId : int
-
the id of the user under which context the dashboard should be opened
Tags
Return values
int —Returns User Id
getID()
This method is used to return the id of the dashboard.
public
getID() : int
Tags
Return values
int —getLabel()
This method is used to return the label of the dashboard.
public
getLabel() : string
Tags
Return values
string —getModuleBaseDirectory()
This method is used the get the base directory path of the module.
public
static getModuleBaseDirectory([mixed $sBaseType = null ]) : string
Parameters
- $sBaseType : mixed = null
Tags
Return values
string —getProductIcon()
This method returns the path to the dashboard icon.
public
static getProductIcon([string $type = false ]) : string
Parameters
- $type : string = false
-
the type of the icon can be empty, black or color.
Tags
Return values
string —getRecordByType()
Returns the record for a given dashboard type.
public
static getRecordByType(string $sDashboardType) : Record|null
Parameters
- $sDashboardType : string
-
The dashboard type.
Tags
Return values
Record|null —The record for the given dashboard type.
getRecordNameByType()
Returns the record name for a given dashboard type.
public
static getRecordNameByType(string $sDashboardType) : string
Parameters
- $sDashboardType : string
-
The dashboard type.
Tags
Return values
string —with the record name for a given dashboard type.
getRecordNamesByTypes()
Returns the record names for the given dashboard types
public
static getRecordNamesByTypes(array<string|int, mixed> $aDashboardTypes) : array<string|int, mixed>
Parameters
- $aDashboardTypes : array<string|int, mixed>
-
Dashboard types
Tags
Return values
array<string|int, mixed> —getRecordsByTypes()
Returns the record names and the correspondent record for the given dashboard types
public
static getRecordsByTypes(array<string|int, mixed> $aDashboardTypes) : array<string|int, mixed>
Parameters
- $aDashboardTypes : array<string|int, mixed>
-
Dashboard types
Tags
Return values
array<string|int, mixed> —$aRecords
getReferenceEditorType()
Builds a standard reference editor type for the record passed as parameter.
public
static getReferenceEditorType(mixed $mRecord) : CSReferenceEditorType
Parameters
- $mRecord : mixed
-
Record The record type to build the editor for
Tags
Return values
CSReferenceEditorType —getSupportedClassOperatorLabels()
Returns the supported class operator labels.
public
static getSupportedClassOperatorLabels([int $iLanguageId = null ]) : array<string|int, mixed>
Parameters
- $iLanguageId : int = null
-
The language id for the translated label.
Tags
Return values
array<string|int, mixed> —with the supported class operator labels
getSupportedDashboardTypes()
Returns all available dashboard types defined in licensed modules.
public
static getSupportedDashboardTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —A list of supported dashboard types.
getTiles()
This method is used to return all tiles of the current dashboard as an array of CSDashboardTile objects.
public
getTiles() : array<string|int, CSDashboardTile>
Tags
Return values
array<string|int, CSDashboardTile> —Array containing CSDashboardTile objects
getTypes()
This method is used to return the context types for which the dashboard is available.
public
getTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The context types for the current dashboard.
getUrl()
Returns the URL to the current dashboard.
public
getUrl() : mixed
Tags
Return values
mixed —getUrlForContextTypeAndRecord()
This method is similar to "getUrlForContextTypeAndValue", except it takes a record as ContextValue parameter. This record is then separated into its class and id (by colon) to be passed as context value.
public
getUrlForContextTypeAndRecord(mixed $sContextType, Record $oRecord) : mixed
Parameters
- $sContextType : mixed
- $oRecord : Record
Tags
Return values
mixed —getUrlForContextTypeAndValue()
Returns the URL to the current dashboard including the specified context parameters.
public
getUrlForContextTypeAndValue(mixed $sContextType, mixed $sContextValue) : mixed
Parameters
- $sContextType : mixed
- $sContextValue : mixed
Tags
Return values
mixed —getUserId()
This method is used to return the user id of the current dashboard context.
public
getUserId() : int
Tags
Return values
int —guessDashboardIdForUser()
This method is used to guess the dashboard id for the current user.
public
static guessDashboardIdForUser() : int
First it checks whether there is a dashboard configured for the user id or the user path and then it checks if the user is creator of a dashboard, if so the first of these dashboard ids is returned.
If no dashboard for the user id is found it checks whether there is a dashboard for all users (AccessIds is empty), if so the first of these dashboard ids is returned.
If still no dashboard for the user is found the method will return 0.
Tags
Return values
int —the Dashboard id
