dolibarr 20.0.0
|
Public Member Functions | |
__construct () | |
Constructor. | |
get ($id) | |
Get properties of a project object. | |
getByRef ($ref) | |
Get properties of a project object. | |
getByRefExt ($ref_ext) | |
Get properties of a project object. | |
getByMsgId ($email_msgid) | |
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 665 of file api_projects.class.php.
References $object.
Referenced by get(), getByMsgId(), getByRef(), getByRefExt(), getLines(), getRoles(), and index().
|
private |
Validate fields before create or update object.
array | $data | Array with data to verify |
RestException |
Definition at line 717 of file api_projects.class.php.
References $object.
Referenced by post().
Projects::delete | ( | $id | ) |
Delete project.
int | $id | Project ID |
Definition at line 583 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource().
Projects::get | ( | $id | ) |
Get properties of a project object.
Return an array with project information
int | $id | ID of project |
RestException |
Definition at line 72 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::getByMsgId | ( | $email_msgid | ) |
Get properties of a project object.
Return an array with project information
string | $email_msgid | Email msgid of project |
@url GET email_msgid/{email_msgid}
RestException |
Definition at line 165 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::getByRef | ( | $ref | ) |
Get properties of a project object.
Return an array with project information
string | $ref | Ref of project |
@url GET ref/{ref}
RestException |
Definition at line 103 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::getByRefExt | ( | $ref_ext | ) |
Get properties of a project object.
Return an array with project information
string | $ref_ext | Ref_Ext of project |
@url GET ref_ext/{ref_ext}
RestException |
Definition at line 134 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 326 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 364 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 these properties. Ignored if empty. Comma separated list of properties names |
Definition at line 199 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 285 of file api_projects.class.php.
References DolibarrApi\_checkValForAPI(), _validate(), and sanitizeVal().
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 536 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), and sanitizeVal().
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 627 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource().