|
| __construct () |
| Constructor.
|
|
| get ($id, $includetimespent=0) |
| Get properties of a task object. More...
|
|
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='') |
| List tasks. More...
|
|
| post ($request_data=null) |
| Create task object. More...
|
|
| getRoles ($id, $userid=0) |
| Get roles a user is assigned to a task with. More...
|
|
| put ($id, $request_data=null) |
| Update task general fields (won't touch time spent of task) More...
|
|
| delete ($id) |
| Delete task. More...
|
|
| addTimeSpent ($id, $date, $duration, $user_id=0, $note='') |
| Add time spent to a task of a project. More...
|
|
| __construct ($db, $cachedir='', $refreshCache=false) |
| Constructor. More...
|
|
Definition at line 30 of file api_tasks.class.php.
◆ _cleanObjectDatas()
Tasks::_cleanObjectDatas |
( |
|
$object | ) |
|
|
protected |
Clean sensible object datas.
- Parameters
-
Object | $object | Object to clean |
- Returns
- Object Object with cleaned properties
Reimplemented from DolibarrApi.
Definition at line 574 of file api_tasks.class.php.
◆ _validate()
Tasks::_validate |
( |
|
$data | ) |
|
|
private |
Validate fields before create or update object.
- Parameters
-
array | $data | Array with data to verify |
- Returns
- array
- Exceptions
-
Definition at line 624 of file api_tasks.class.php.
◆ addTimeSpent()
Tasks::addTimeSpent |
( |
|
$id, |
|
|
|
$date, |
|
|
|
$duration, |
|
|
|
$user_id = 0 , |
|
|
|
$note = '' |
|
) |
| |
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" }
- Parameters
-
int | $id | Task ID |
datetime | $date | Date (YYYY-MM-DD HH:MI:SS in GMT) |
int | $duration | Duration in seconds (3600 = 1h) |
int | $user_id | User (Use 0 for connected user) |
string | $note | Note |
@url POST {id}/addtimespent
- Returns
- array
Definition at line 523 of file api_tasks.class.php.
◆ delete()
◆ get()
Tasks::get |
( |
|
$id, |
|
|
|
$includetimespent = 0 |
|
) |
| |
Get properties of a task object.
Return an array with task informations
- Parameters
-
int | $id | ID of task |
int | $includetimespent | 0=Return only task. 1=Include a summary of time spent, 2=Include details of time spent lines |
- Returns
- array|mixed data without useless information
- Exceptions
-
Definition at line 68 of file api_tasks.class.php.
◆ getRoles()
Tasks::getRoles |
( |
|
$id, |
|
|
|
$userid = 0 |
|
) |
| |
Get roles a user is assigned to a task with.
- Parameters
-
int | $id | Id of task |
int | $userid | Id of user (0 = connected user) |
@url GET {id}/roles
- Returns
- int
Definition at line 277 of file api_tasks.class.php.
◆ index()
Tasks::index |
( |
|
$sortfield = "t.rowid" , |
|
|
|
$sortorder = 'ASC' , |
|
|
|
$limit = 100 , |
|
|
|
$page = 0 , |
|
|
|
$sqlfilters = '' |
|
) |
| |
List tasks.
Get a list of tasks
- Parameters
-
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
- Returns
- array Array of project objects
Definition at line 107 of file api_tasks.class.php.
◆ post()
Tasks::post |
( |
|
$request_data = null | ) |
|
Create task object.
- Parameters
-
array | $request_data | Request data |
- Returns
- int ID of project
Definition at line 200 of file api_tasks.class.php.
◆ put()
Tasks::put |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Update task general fields (won't touch time spent of task)
- Parameters
-
int | $id | Id of task to update |
array | $request_data | Datas |
- Returns
- int
Definition at line 446 of file api_tasks.class.php.
The documentation for this class was generated from the following file: