Tasks
class Tasks extends DolibarrApi (View source)
API class for projects
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| Task | $task |
Methods
Constructor
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensitive object data
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Get properties of a task object
List tasks
Create task object
Get time spent of a task
Get roles a user is assigned to a task with
Update task general fields (won't touch time spent of task)
Delete task
Get time spent of a task
Add time spent to a task of a project.
Update time spent for a task of a project.
Delete time spent for a task of a project.
Clean sensitive object data
Get contacts of given task
Adds a contact to a task
Delete a contact type of given task
Details
__construct()
Constructor
protected string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)
Check and convert a string depending on its type/name.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensitive object data
static protected bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')
Check access by user to a given resource
protected bool|string
_checkFilters(string $sqlfilters, string $error = '')
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
static protected string
_forge_criteria_callback(string[] $matches)
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
array|mixed
get(int $id, int $includetimespent = 0)
Get properties of a task object
Return an array with task information
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $sqlfilters = '', string $properties = '')
List tasks
Get a list of tasks
int
post(array $request_data = null)
Create task object
array<int, mixed>
getTimespent(int $id)
Get time spent of a task
array
getRoles(int $id, int $userid = 0)
Get roles a user is assigned to a task with
object
put(int $id, array $request_data = null)
Update task general fields (won't touch time spent of task)
array
delete(int $id)
Delete task
object
getTimeSpentByID(int $id, int $timespent_id)
Get time spent of a task
array
addTimeSpent(int $id, datetime|string $date, int $duration, int $product_id = null, int $user_id = 0, string $note = '', int|null $progress = -1)
Add time spent to a task of a project.
You can test this API with the following input message { "date": "2016-12-31 23:15:00", "duration": 1800, "user_id": 1, "note": "My time test" }
array
putTimeSpent(int $id, int $timespent_id, datetime $date, int $duration, int $product_id = null, int $user_id = 0, string $note = '')
Update time spent for a task of a project.
You can test this API with the following input message { "date": "2016-12-31 23:15:00", "duration": 1800, "user_id": 1, "note": "My time test" }
array
deleteTimeSpent(int $id, int $timespent_id)
Delete time spent for a task of a project.
protected object
_cleanTimeSpentObjectDatas(object $object)
Clean sensitive object data
array<int, mixed>
getContacts(int $id, string $type = '')
Get contacts of given task
Return an array with contact information
object
addContact(int $id, int $fk_socpeople, string $type_contact, string $source, int $notrigger = 0)
Adds a contact to a task
object
deleteContact(int $id, int $contactid, string $type)
Delete a contact type of given task