dolibarr 21.0.0-beta
|
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='', $pagination_data=false) | |
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 31 of file api_projects.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 753 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<string,mixed> | $data Array with data to verify |
RestException |
Definition at line 805 of file api_projects.class.php.
References $object.
Referenced by post().
Projects::delete | ( | $id | ) |
Delete project.
int | $id | Project ID |
Definition at line 667 of file api_projects.class.php.
References $id, and 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 73 of file api_projects.class.php.
References $id, 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 166 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 104 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 135 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 398 of file api_projects.class.php.
References $id, 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 438 of file api_projects.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Projects::index | ( | $sortfield = "t.rowid", | |
$sortorder = 'ASC', | |||
$limit = 100, | |||
$page = 0, | |||
$thirdparty_ids = '', | |||
$category = 0, | |||
$sqlfilters = '', | |||
$properties = '', | |||
$pagination_data = false ) |
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 |
bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
Definition at line 203 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 @phan-param array<string,mixed> $request_data @phpstan-param array<string,mixed> $request_data |
Definition at line 311 of file api_projects.class.php.
References $conf, DolibarrApi\_checkValForAPI(), _validate(), dol_buildpath(), dol_include_once(), dol_now(), dol_print_date(), dol_syslog(), getDolGlobalString(), 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 @phan-param array<string,mixed> $request_data @phpstan-param array<string,mixed> $request_data |
@url POST {id}/tasks
int | $id | Id of project to update |
int | $taskid | Id of task to update |
array | $request_data | Projectline data @phan-param array<string,mixed> $request_data @phpstan-param array<string,mixed> $request_data |
@url PUT {id}/tasks/{taskid}
int | $id | Id of project to update |
array | $request_data | Datas @phan-param ?array<string,mixed> $request_data @phpstan-param ?array<string,mixed> $request_data |
Definition at line 618 of file api_projects.class.php.
References $id, 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 @phan-param int<0,1> $notrigger @phpstan-param int<0,1> $notrigger |
@url POST {id}/validate
Definition at line 715 of file api_projects.class.php.
References $id, and DolibarrApi\_checkAccessToResource().