dolibarr 19.0.3
|
Public Member Functions | |
__construct () | |
Constructor. | |
get ($id) | |
Get properties of a project object. | |
index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $thirdparty_ids='', $category=0, $sqlfilters='', $properties='') | |
List projects. | |
post ($request_data=null) | |
Create project object. | |
getLines ($id, $includetimespent=0) | |
Get tasks of a project. | |
getRoles ($id, $userid=0) | |
Get roles a user is assigned to a project with. | |
put ($id, $request_data=null) | |
Add a task to given project. | |
delete ($id) | |
Delete project. | |
validate ($id, $notrigger=0) | |
Validate a project. | |
Public Member Functions inherited from DolibarrApi | |
__construct ($db, $cachedir='', $refreshCache=false) | |
Constructor. | |
Protected Member Functions | |
_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. | |
_filterObjectProperties ($object, $properties) | |
Filter properties that will be returned on object. | |
_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 30 of file api_projects.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 578 of file api_projects.class.php.
Referenced by get(), getLines(), getRoles(), and index().
|
private |
Validate fields before create or update object.
array | $data | Array with data to verify |
RestException |
Definition at line 630 of file api_projects.class.php.
Referenced by post().
Projects::delete | ( | $id | ) |
Delete project.
int | $id | Project ID |
Definition at line 496 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource().
Projects::get | ( | $id | ) |
Get properties of a project object.
Return an array with project informations
int | $id | ID of project |
RestException |
Definition at line 72 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::getLines | ( | $id, | |
$includetimespent = 0 ) |
Get tasks of a project.
See also API /tasks
int | $id | Id of project |
int | $includetimespent | 0=Return only list of tasks. 1=Include a summary of time spent, 2=Include details of time spent lines |
@url GET {id}/tasks
Definition at line 244 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::getRoles | ( | $id, | |
$userid = 0 ) |
Get roles a user is assigned to a project with.
int | $id | Id of project |
int | $userid | Id of user (0 = connected user) |
@url GET {id}/roles
Definition at line 282 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::index | ( | $sortfield = "t.rowid", | |
$sortorder = 'ASC', | |||
$limit = 100, | |||
$page = 0, | |||
$thirdparty_ids = '', | |||
$category = 0, | |||
$sqlfilters = '', | |||
$properties = '' ) |
List projects.
Get a list of projects
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
string | $thirdparty_ids | Thirdparty ids to filter projects of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} |
int | $category | Use this param to filter list by category |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
string | $properties | Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names |
Definition at line 108 of file api_projects.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
Projects::post | ( | $request_data = null | ) |
Create project object.
array | $request_data | Request data |
Definition at line 203 of file api_projects.class.php.
References _validate().
Projects::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 project to update |
array | $request_data | Datas |
Definition at line 455 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource().
Projects::validate | ( | $id, | |
$notrigger = 0 ) |
Validate a project.
You can test this API with the following input message { "notrigger": 0 }
int | $id | Project ID |
int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/validate
Definition at line 540 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource().