CSProjectmanager
extends CSItemApi
in package
This class is the central access point to any PHP Apis regarding the CONTENTSERV CSProjectmanager module.
As it is inherited from the CSItemApi all methods can be used
Tags
Table of Contents
- $ENUM_SORTALGOS_FORMATTED : mixed
- $ENUM_SORTTYPES_DESC : mixed
- $HOURS_AFTER_MIDNIGHT : mixed
- Defines the hour after midnight belonging to "today" If it should be different in a project this static variable may be changed by setting to another value in the project
- $HOURS_NORMAL_END : mixed
- Defines the hour after midnight belonging to "today" If it should be different in a project this static variable may be changed by setting to another value in the project
- $tableApiClass : string
- $tableRowApiClass : string
- __construct() : mixed
- createProject() : CSProject
- Creates a new CSProject at the targeted position.
- createProjectField() : CSItemApiField
- Creates a new CSItemApiField for Projects at the targeted position
- createTask() : CSTask
- Creates a new CSTask
- createTaskField() : CSItemApiField
- Creates a new CSItemApiField for Tasks at the targeted position
- getApiFieldForExternalKey() : CSItemApiField
- Returns a specific field of an item or an empty Api Field when the key is null, empty or invalid
- getComparator() : CSItemComparator
- Creates a comparator object that can be used with the CSGuiItemComparatorTable
- getField() : CSItemApiField
- Loads an existing Task field for a given ID
- getInboxConfigurationID() : int
- Returns the configurationID pointing to the Inbox Reference which can be used to detect all inboxes defined for an user
- getInstance() : mixed
- getItemRecord() : mixed
- getMyInboxes() : array<string|int, mixed>
- Returns all records which are defined as inbox for the current user
- getMyManagedUsers() : array<string|int, mixed>
- Returns all the users the given user manages
- getMyMangedUserConfigurationID() : int
- Returns the ID of the user reference field which defines all users which are managed by one other user
- getMyTasks() : array<string|int, mixed>
- Returns all tasks for the current user
- getMyTeams() : array<string|int, mixed>
- Collects the IDs of all teams for a given user
- getMyTemplateTasks() : array<string|int, mixed>
- Returns an array of TaskID => Task for all tasks beeing defined in a template folder for the current user
- getOwnerEditorTypeForTeam() : array<string|int, mixed>|string
- Returns the editor type for owners for a given record If a Team is set, the user can select one within this team using a selection.
- getPriorities() : array<string|int, mixed>
- Returns the available priorities
- getProject() : CSProject
- Loads an existing CSProject for a given ID
- getProjectField() : CSItemApiField
- Loads an existing Project field for a given ID
- getProjectRootfolderConfigurationID() : int
- Returns the ID of the reference field which defines all root folders in the projects
- getProjects() : mixed
- Returns an array with CSProjects matching the SQL filter condition in the given sort order and limit.
- getSearchableApiFields() : mixed
- Returns an array with CSItemApiField matching the searchable condition in the given sort order and limit If $returnSimpleSearchables and $returnExtendedSearchables are set to false all fields are returned which are not searchable Otherwise the fields are returned matching at least one of the set criterias.
- getTask() : CSTask
- Loads an existing CSTask.
- getTaskField() : CSItemApiField
- Loads an existing Task field for a given ID
- getTaskIDs() : array<string|int, mixed>
- Returns all defined tasks for a given record The following $additionalOptions are supported at the moment: - 'recursive' : boolean whether the given $record should searched recursivly - 'rootIDs' : array of optional rootIDs of $record for the task to filter. If it is not set the ID of the $record is used.
- getTasks() : array<string|int, mixed>
- Returns all defined tasks for a given record The following $additionalOptions are supported at the moment: - 'recursive' : boolean whether the given $record should searched recursivly - 'rootIDs' : array of optional rootIDs of $record for the task to filter. If it is not set the ID of the $record is used.
- getTaskSetting() : mixed
- Returns a task setting for a given Record. The setting is searched in the Tasksetting table, for that record. If it is not found, the Records parents are also searched
- getTasksForRecordFilter() : string
- Returns a sql statement to pass to queries or filters which filters all tasks for a given Record
- getTaskTemplateConfigurationID() : int
- Returns the ID of the reference field which defines all template folders which contain task templates for adding task in lists
- getTeamValueRangeID() : int
- Returns the ID of the value range pointing to the Team Reference which can be used to detect all teams of an user
- getToday() : string
- Returns the date of "today" As a working day may exceed midnight, e.g. 1am belongs to the last day Therefore the result is the date in Y-m-d of the real today
- getUsersInTeam() : array<string|int, mixed>
- Collects the IDs of all users in given teams
- getValueGetter() : CSItemValueGetter
- Returns a new CSItemValueGetter object
- getValueSetter() : CSItemValueSetter
- Returns a new CSItemValueSetter object
- getValuesGetter() : CSItemValuesGetter
- Returns a new CSItemValuesGetter object
- getValuesSetter() : CSItemValuesSetter
- Returns a new CSItemValuesSetter object
- getWorkload() : mixed
- getWorkloads() : mixed
- limitAllowedHtmlTags() : mixed
- Limits all tags which are allowed in the formatted value result of any item This can e.g. be used for media neutral exports where not all html tags are supported
Properties
$ENUM_SORTALGOS_FORMATTED
public
static mixed
$ENUM_SORTALGOS_FORMATTED
= array(\CS_SORT_FORMATTED_ASC => 'GUI_EDIT_SORT_FORMATTED_ASC', \CS_SORT_FORMATTED_DESC => 'GUI_EDIT_SORT_FORMATTED_DESC')
Tags
$ENUM_SORTTYPES_DESC
public
static mixed
$ENUM_SORTTYPES_DESC
= array(\CS_SORT_NUMERICAL_DESC => 'GUI_EDIT_SORT_NUMERICAL_DESC', \CS_SORT_CASE_STRING_DESC => 'GUI_EDIT_SORT_CASE_STRING_DES', \CS_SORT_FORMATTED_DESC => 'GUI_EDIT_SORT_FORMATTED_DESC', \CS_SORT_STRING_DESC => 'GUI_EDIT_SORT_STRING_DESC', \CS_SORT_DATE_DESC => 'GUI_EDIT_SORT_DATE_DESC', \CS_SORT_DEFAULT_DESC => 'GUI_EDIT_SORT_DEFAULT_DESC')
Tags
$HOURS_AFTER_MIDNIGHT
Defines the hour after midnight belonging to "today" If it should be different in a project this static variable may be changed by setting to another value in the project
public
static mixed
$HOURS_AFTER_MIDNIGHT
= 5
Tags
$HOURS_NORMAL_END
Defines the hour after midnight belonging to "today" If it should be different in a project this static variable may be changed by setting to another value in the project
public
static mixed
$HOURS_NORMAL_END
= 18
Tags
$tableApiClass
public
string
$tableApiClass
Tags
$tableRowApiClass
public
string
$tableRowApiClass
Tags
Methods
__construct()
public
__construct([mixed $itemClass = null ]) : mixed
Parameters
- $itemClass : mixed = null
Tags
Return values
mixed —createProject()
Creates a new CSProject at the targeted position.
public
static createProject(string $label[, int $targetID = null ][, int $position = CSITEM_POSITION_CHILD ], int $baseFieldID) : CSProject
This is a synonym for the createItem method.
Parameters
- $label : string
-
the label of the new project
- $targetID : int = null
-
ID of the targeted project
- $position : int = CSITEM_POSITION_CHILD
-
position relative to the target project
- $baseFieldID : int
-
the id of the root field of the project
Tags
Return values
CSProject —createProjectField()
Creates a new CSItemApiField for Projects at the targeted position
public
static createProjectField(string $label[, int $targetID = null ][, int $position = CSITEM_POSITION_CHILD ][, string $type = 'caption' ][, string $typemodule = 'core' ][, bool $loadTypeFromProject = false ][, bool $isConfiguration = false ]) : CSItemApiField
Parameters
- $label : string
-
the label of the new field
- $targetID : int = null
-
ID of the targeted field
- $position : int = CSITEM_POSITION_CHILD
-
position relative to the target field
- $type : string = 'caption'
-
the type of the field
- $typemodule : string = 'core'
-
name of the module the type is defined in
- $loadTypeFromProject : bool = false
-
set this flag if the type is defined in the project
- $isConfiguration : bool = false
-
set this flag to create a configuration
Tags
Return values
CSItemApiField —createTask()
Creates a new CSTask
public
static createTask(string $label, mixed $attachRecord, int $baseFieldID) : CSTask
Parameters
- $label : string
-
the label of the CSTask
- $attachRecord : mixed
-
the record the CSTask should be attached to as Record, ItemApiItem or null. It might either be a Record with a CS_RECORD_INTERFACE_TASK or a Task Record. If a Task is passed the task is added to its Record and the new Task is added as ChildTask.
- $baseFieldID : int
-
the id of the root configuration of the task
Tags
Return values
CSTask —the new task object
createTaskField()
Creates a new CSItemApiField for Tasks at the targeted position
public
static createTaskField(string $label[, int $targetID = null ][, int $position = CSITEM_POSITION_CHILD ][, string $type = 'caption' ][, string $typemodule = 'core' ][, bool $loadTypeFromProject = false ][, bool $isConfiguration = false ]) : CSItemApiField
Parameters
- $label : string
-
the label of the new field
- $targetID : int = null
-
ID of the targeted field
- $position : int = CSITEM_POSITION_CHILD
-
position relative to the target field
- $type : string = 'caption'
-
the type of the field
- $typemodule : string = 'core'
-
name of the module the type is defined in
- $loadTypeFromProject : bool = false
-
set this flag if the type is defined in the project
- $isConfiguration : bool = false
-
set this flag to create a configuration
Tags
Return values
CSItemApiField —getApiFieldForExternalKey()
Returns a specific field of an item or an empty Api Field when the key is null, empty or invalid
public
getApiFieldForExternalKey(string $sExternalKey) : CSItemApiField
If you pass the ExternalKey of the field as identifier be aware that labels are not unique and the first field with that label will be returned.
Parameters
- $sExternalKey : string
-
External key of the Item (or Field)
Tags
Return values
CSItemApiField —Returns an instance of the CSItemApiField object
getComparator()
Creates a comparator object that can be used with the CSGuiItemComparatorTable
public
getComparator(CSItemComparatorData $oComparatorData) : CSItemComparator
Parameters
- $oComparatorData : CSItemComparatorData
-
CSItemComparatorData object with already setted data.
Tags
Return values
CSItemComparator —the newly created CSItemComparator-object that can be used for further configuration.
getField()
Loads an existing Task field for a given ID
public
static getField([int $ID = null ]) : CSItemApiField
Parameters
- $ID : int = null
-
of the field
Tags
Return values
CSItemApiField —a CSItemApiField object for the given ID
getInboxConfigurationID()
Returns the configurationID pointing to the Inbox Reference which can be used to detect all inboxes defined for an user
public
static getInboxConfigurationID() : int
Tags
Return values
int —the inbox reference field
getInstance()
public
static getInstance(mixed $apiName[, mixed $itemClass = null ]) : mixed
Parameters
- $apiName : mixed
- $itemClass : mixed = null
Tags
Return values
mixed —getItemRecord()
public
getItemRecord() : mixed
Tags
Return values
mixed —getMyInboxes()
Returns all records which are defined as inbox for the current user
public
static getMyInboxes([bool $returnRecords = FALSE ][, bool $addEmpty = FALSE ]) : array<string|int, mixed>
Parameters
- $returnRecords : bool = FALSE
-
whether the complete records (true) or only their label (false: DEFAULT) should be returned
- $addEmpty : bool = FALSE
-
whether an empty inbox label should be returned
Tags
Return values
array<string|int, mixed> —of REFERENCEID=>REFERENCE elements
getMyManagedUsers()
Returns all the users the given user manages
public
static getMyManagedUsers([int $userID = null ]) : array<string|int, mixed>
Parameters
- $userID : int = null
-
the optional userID or null for the current user
Tags
Return values
array<string|int, mixed> —of UserID => UserName elements
getMyMangedUserConfigurationID()
Returns the ID of the user reference field which defines all users which are managed by one other user
public
static getMyMangedUserConfigurationID() : int
Tags
Return values
int —the UserconfigurationFieldID of the managedUsers
getMyTasks()
Returns all tasks for the current user
public
static getMyTasks([string $taskFilter = '' ][, string $sortOrder = '' ][, mixed $record = null ][, array<string|int, mixed> $additionalOptions = array() ][, mixed $limit = '' ]) : array<string|int, mixed>
Parameters
- $taskFilter : string = ''
-
a sql condition to filter tasks
- $sortOrder : string = ''
-
the sort order for the tasks
- $record : mixed = null
-
the optional Record or a CSItemApiItem to limit the tasks for
- $additionalOptions : array<string|int, mixed> = array()
-
an array containing additional settings in the form [SETTING] => [VALUE]. The setting 'UserID' can define an other user than the current user. See the getTask() method for further settings.
- $limit : mixed = ''
Tags
Return values
array<string|int, mixed> —of CSTaskItems representing tasks
getMyTeams()
Collects the IDs of all teams for a given user
public
static getMyTeams([int $userID = null ]) : array<string|int, mixed>
Parameters
- $userID : int = null
-
the optional userID or null for the current user
Tags
Return values
array<string|int, mixed> —of TeamID => TeamName elements
getMyTemplateTasks()
Returns an array of TaskID => Task for all tasks beeing defined in a template folder for the current user
public
static getMyTemplateTasks([mixed $targetRecord = null ][, mixed $returnOnlyUserTemplates = true ][, mixed $checkOnlyClass = false ]) : array<string|int, mixed>
Parameters
- $targetRecord : mixed = null
-
Record the record to check the available tasks for or true, if all tasks should be returned
- $returnOnlyUserTemplates : mixed = true
-
whether only templates defined for the current user should be returned
- $checkOnlyClass : mixed = false
-
whether it should just checked, whether templates exist for the given class in general (false) or for a specific record
Tags
Return values
array<string|int, mixed> —of [ID => Task] for all templates
getOwnerEditorTypeForTeam()
Returns the editor type for owners for a given record If a Team is set, the user can select one within this team using a selection.
public
static getOwnerEditorTypeForTeam(Record $record) : array<string|int, mixed>|string
Parameters
- $record : Record
-
the object for which the type should be defined
Tags
Return values
array<string|int, mixed>|string —either an array or 'user' as string which can be passed to the CSGuiEditors addField methods as type
getPriorities()
Returns the available priorities
public
static getPriorities([CSGuiEditor $csGuiEditor = null ]) : array<string|int, mixed>
Parameters
- $csGuiEditor : CSGuiEditor = null
-
if requested for an editor the editor is given to be able to react on the editors content
Tags
Return values
array<string|int, mixed> —the priorities in the form priority (as integer) => label
getProject()
Loads an existing CSProject for a given ID
public
static getProject([int $ID = null ]) : CSProject
Parameters
- $ID : int = null
-
of the item
Tags
Return values
CSProject —getProjectField()
Loads an existing Project field for a given ID
public
static getProjectField([int $ID = null ]) : CSItemApiField
Parameters
- $ID : int = null
-
of the field
Tags
Return values
CSItemApiField —a CSItemApiField object for the given ID
getProjectRootfolderConfigurationID()
Returns the ID of the reference field which defines all root folders in the projects
public
static getProjectRootfolderConfigurationID() : int
Tags
Return values
int —the UserconfigurationFieldID of the users project root folders
getProjects()
Returns an array with CSProjects matching the SQL filter condition in the given sort order and limit.
public
static getProjects([string $filter = '1=1' ][, string $sortorder = '' ][, mixed $limit = '' ][, bool $ignoreRights = false ]) : mixed
This is a synonym for the getItems method and therefore all special syntax described there can be used.
Parameters
- $filter : string = '1=1'
-
SQL Filter condition
- $sortorder : string = ''
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSProjects should be returned
- $ignoreRights : bool = false
-
whether the user rights should be ignored. If not only those views are returned the user may view.
Tags
Return values
mixed —either an array with the CSProjects or the first CSProjects, if limit is set to 1
getSearchableApiFields()
Returns an array with CSItemApiField matching the searchable condition in the given sort order and limit If $returnSimpleSearchables and $returnExtendedSearchables are set to false all fields are returned which are not searchable Otherwise the fields are returned matching at least one of the set criterias.
public
getSearchableApiFields([bool $returnSimpleSearchables = true ][, bool $returnExtendedSearchables = true ][, string $sortorder = '' ][, mixed $limit = '' ]) : mixed
Parameters
- $returnSimpleSearchables : bool = true
-
whether simple searchable fields are returned
- $returnExtendedSearchables : bool = true
-
whether extended searchable fields are returned
- $sortorder : string = ''
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSItemApiField should be returned
Tags
Return values
mixed —either an array with the CSItemApiFields or the first CSItemApiField, if limit is set to 1
getTask()
Loads an existing CSTask.
public
static getTask([int $ID = null ]) : CSTask
This is a synonym for the getItem method.
Parameters
- $ID : int = null
-
of the item
Tags
Return values
CSTask —getTaskField()
Loads an existing Task field for a given ID
public
static getTaskField([int $ID = null ]) : CSItemApiField
Parameters
- $ID : int = null
-
of the field
Tags
Return values
CSItemApiField —a CSItemApiField object for the given ID
getTaskIDs()
Returns all defined tasks for a given record The following $additionalOptions are supported at the moment: - 'recursive' : boolean whether the given $record should searched recursivly - 'rootIDs' : array of optional rootIDs of $record for the task to filter. If it is not set the ID of the $record is used.
public
static getTaskIDs([string $taskFilter = '' ][, object $record = null ][, array<string|int, mixed> $additionalOptions = array() ][, string $groupBy = '' ][, array<string|int, mixed> $sortFields = array() ]) : array<string|int, mixed>
Parameters
- $taskFilter : string = ''
-
a sql condition to filter tasks
- $record : object = null
-
the optional Record or a CSItemApiItem to limit the tasks for
- $additionalOptions : array<string|int, mixed> = array()
-
an array containing additional settings in the form [SETTING] => [VALUE].
- $groupBy : string = ''
-
an optional field the results are grouped
- $sortFields : array<string|int, mixed> = array()
-
the fields the result should be sorted by, as an array with the field name as key and a CS_SORT constant as value (e.g. CS_SORT_STRING_ASC or CS_SORT_NUMERICAL_DESC)
Tags
Return values
array<string|int, mixed> —of TaskIDs either in a simple array or in an array for the groups containing an array of IDs
getTasks()
Returns all defined tasks for a given record The following $additionalOptions are supported at the moment: - 'recursive' : boolean whether the given $record should searched recursivly - 'rootIDs' : array of optional rootIDs of $record for the task to filter. If it is not set the ID of the $record is used.
public
static getTasks([string $taskFilter = '' ][, string $sortOrder = '' ][, mixed $record = null ][, array<string|int, mixed> $additionalOptions = array() ][, string $limit = '' ]) : array<string|int, mixed>
Parameters
- $taskFilter : string = ''
-
a sql condition to filter tasks
- $sortOrder : string = ''
-
the sort order for the tasks
- $record : mixed = null
-
the optional Record or a CSItemApiItem to limit the tasks for
- $additionalOptions : array<string|int, mixed> = array()
-
an array containing additional settings in the form [SETTING] => [VALUE].
- $limit : string = ''
-
a sql limit statement
Tags
Return values
array<string|int, mixed> —of CSTaskItems representing tasks
getTaskSetting()
Returns a task setting for a given Record. The setting is searched in the Tasksetting table, for that record. If it is not found, the Records parents are also searched
public
static getTaskSetting(Record $record, string $key) : mixed
Parameters
- $record : Record
-
the Record to get the task setting for
- $key : string
-
the key of the requested task setting
Tags
Return values
mixed —getTasksForRecordFilter()
Returns a sql statement to pass to queries or filters which filters all tasks for a given Record
public
static getTasksForRecordFilter(Record $record[, bool $recursive = true ][, array<string|int, mixed> $rootIDs = array() ][, string $tablePrefix = '' ]) : string
Parameters
- $record : Record
-
the Record to get the tasks for
- $recursive : bool = true
-
whether the tasks should received recursively for the record
- $rootIDs : array<string|int, mixed> = array()
-
optional rootIDs for the task to filter. If it is not set the ID of the $record is used.
- $tablePrefix : string = ''
-
the sql table prefix of the Task table
Tags
Return values
string —a sql query to filter for tasks
getTaskTemplateConfigurationID()
Returns the ID of the reference field which defines all template folders which contain task templates for adding task in lists
public
static getTaskTemplateConfigurationID() : int
Tags
Return values
int —the UserconfigurationFieldID of the users template folders
getTeamValueRangeID()
Returns the ID of the value range pointing to the Team Reference which can be used to detect all teams of an user
public
static getTeamValueRangeID() : int
Tags
Return values
int —the ValueRangeID of the team field
getToday()
Returns the date of "today" As a working day may exceed midnight, e.g. 1am belongs to the last day Therefore the result is the date in Y-m-d of the real today
public
static getToday([string $format = 'Y-m-d' ][, string $date = null ]) : string
Parameters
- $format : string = 'Y-m-d'
-
the format of the returned date
- $date : string = null
-
the optional date for which the day should be returned either as date or as timestamp
Tags
Return values
string —the date of Today
getUsersInTeam()
Collects the IDs of all users in given teams
public
static getUsersInTeam(mixed $teamID) : array<string|int, mixed>
Parameters
- $teamID : mixed
-
either a teamid or an array of IDs
Tags
Return values
array<string|int, mixed> —of UserIDs
getValueGetter()
Returns a new CSItemValueGetter object
public
static getValueGetter(mixed $mName) : CSItemValueGetter
Parameters
- $mName : mixed
-
The name of the attribute to retrieve
Tags
Return values
CSItemValueGetter —getValueSetter()
Returns a new CSItemValueSetter object
public
static getValueSetter(mixed $mName, mixed $mValue) : CSItemValueSetter
Parameters
- $mName : mixed
-
The name of the attribute to retrieve
- $mValue : mixed
Tags
Return values
CSItemValueSetter —getValuesGetter()
Returns a new CSItemValuesGetter object
public
static getValuesGetter(array<string|int, mixed> $aNames) : CSItemValuesGetter
Parameters
- $aNames : array<string|int, mixed>
-
List of attributes to be retrieved.
Tags
Return values
CSItemValuesGetter —getValuesSetter()
Returns a new CSItemValuesSetter object
public
static getValuesSetter() : CSItemValuesSetter
Tags
Return values
CSItemValuesSetter —getWorkload()
public
static getWorkload([mixed $ID = '' ]) : mixed
Parameters
- $ID : mixed = ''
Tags
Return values
mixed —getWorkloads()
public
static getWorkloads([mixed $workloadFilter = '' ][, mixed $sortOrder = '' ]) : mixed
Parameters
- $workloadFilter : mixed = ''
- $sortOrder : mixed = ''
Tags
Return values
mixed —limitAllowedHtmlTags()
Limits all tags which are allowed in the formatted value result of any item This can e.g. be used for media neutral exports where not all html tags are supported
public
static limitAllowedHtmlTags([array<string|int, mixed> $htmlTags = array() ]) : mixed
Parameters
- $htmlTags : array<string|int, mixed> = array()
-
an array containing all allowed HTML Tags. If it is an empty array, no html tags are allowed
