dolibarr 18.0.6
|
Public Member Functions | |
__construct () | |
Constructor. | |
get ($id, $includetimespent=0) | |
Get properties of a task object. | |
index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='') | |
List tasks. | |
post ($request_data=null) | |
Create task object. | |
getRoles ($id, $userid=0) | |
Get time spent of a task. | |
put ($id, $request_data=null) | |
Add a task to given project. | |
delete ($id) | |
Delete task. | |
addTimeSpent ($id, $date, $duration, $user_id=0, $note='') | |
Add time spent to a task of a project. | |
putTimeSpent ($id, $timespent_id, $date, $duration, $user_id=0, $note='') | |
Update time spent for a task of a project. | |
deleteTimeSpent ($id, $timespent_id) | |
Delete time spent for a task of a project. | |
Public Member Functions inherited from DolibarrApi | |
__construct ($db, $cachedir='', $refreshCache=false) | |
Constructor. | |
Protected Member Functions | |
timespentRecordChecks ($id, $timespent_id) | |
Validate task & timespent IDs for timespent API methods. | |
_cleanObjectDatas ($object) | |
Clean sensible object datas. | |
Protected Member Functions inherited from DolibarrApi | |
_checkValForAPI ($field, $value, $object) | |
Check and convert a string depending on its type/name. | |
_checkFilters ($sqlfilters, &$error='') | |
Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
_validate ($data) | |
Validate fields before create or update object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
Check access by user to a given resource. | |
static | _forge_criteria_callback ($matches) |
Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 31 of file api_tasks.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 679 of file api_tasks.class.php.
Referenced by get(), getRoles(), and index().
|
private |
Validate fields before create or update object.
array | $data | Array with data to verify |
RestException |
Definition at line 729 of file api_tasks.class.php.
Referenced by post().
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" }
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 NOTE: Should be "POST {id}/timespent", since POST already implies "add"
Definition at line 524 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource(), and dol_stringtotime().
Tasks::delete | ( | $id | ) |
Delete task.
int | $id | Task ID |
Definition at line 481 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource().
Tasks::deleteTimeSpent | ( | $id, | |
$timespent_id ) |
Delete time spent for a task of a project.
int | $id | Task ID |
int | $timespent_id | Time spent ID (llx_element_time.rowid) |
@url DELETE {id}/timespent/{timespent_id}
Definition at line 628 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource(), and timespentRecordChecks().
Tasks::get | ( | $id, | |
$includetimespent = 0 ) |
Get properties of a task object.
Return an array with task informations
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 |
RestException |
Definition at line 68 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Tasks::getRoles | ( | $id, | |
$userid = 0 ) |
Get time spent of a task.
int | $id | Id of task |
@url GET {id}/tasks Get roles a user is assigned to a task with
int | $id | Id of task |
int | $userid | Id of user (0 = connected user) |
@url GET {id}/roles
Definition at line 276 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Tasks::index | ( | $sortfield = "t.rowid", | |
$sortorder = 'ASC', | |||
$limit = 100, | |||
$page = 0, | |||
$sqlfilters = '' ) |
List tasks.
Get a list of tasks
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')" |
Definition at line 107 of file api_tasks.class.php.
References _cleanObjectDatas(), dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
Tasks::post | ( | $request_data = null | ) |
Create task object.
array | $request_data | Request data |
Definition at line 199 of file api_tasks.class.php.
References _validate().
Tasks::put | ( | $id, | |
$request_data = null ) |
Add a task to given project.
int | $id | Id of project to update |
array | $request_data | Projectline data |
@url POST {id}/tasks
int | $id | Id of project to update |
int | $taskid | Id of task to update |
array | $request_data | Projectline data |
@url PUT {id}/tasks/{taskid}
int | $id | Id of task to update |
array | $request_data | Datas |
Definition at line 446 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource().
Tasks::putTimeSpent | ( | $id, | |
$timespent_id, | |||
$date, | |||
$duration, | |||
$user_id = 0, | |||
$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" }
int | $id | Task ID |
int | $timespent_id | Time spent ID (llx_element_time.rowid) |
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 PUT {id}/timespent/{timespent_id}
Definition at line 583 of file api_tasks.class.php.
References DolibarrApi\_checkAccessToResource(), dol_stringtotime(), and timespentRecordChecks().
|
protected |
Validate task & timespent IDs for timespent API methods.
Loads the selected task & timespent records.
int | $id | Task ID |
int | $timespent_id | Time spent ID (llx_element_time.rowid) |
Definition at line 660 of file api_tasks.class.php.
Referenced by deleteTimeSpent(), and putTimeSpent().