|
dolibarr 23.0.3
|


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. | |
| addContact ($id, $fk_socpeople, $type_contact, $source, $notrigger=0) | |
| Adds a contact to an project. | |
| deleteContact ($id, $contactid, $type) | |
| Delete a contact type of given project. | |
| 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. | |
| listTimespent ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $thirdparty_ids='', $category=0, $sqlfilters='', $properties='', $pagination_data=false) | |
| Get all timespent. | |
| getContacts ($id, $type='') | |
| Get contacts of given project. | |
| addToContact ($id, $fk_socpeople, $type_contact, $source, $notrigger=0, $affect_to_tasks=null) | |
| Adds a contact to a project. | |
| deleteToContact ($id, $contactid, $type) | |
| Delete a contact type of given project. | |
| getTimespent ($id) | |
| Get timespent of a project (from all its tasks) | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas @phpstan-template T. | |
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 34 of file api_projects.class.php.
|
protected |
Clean sensible object datas @phpstan-template T.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 958 of file api_projects.class.php.
References $object.
Referenced by addContact(), addToContact(), deleteContact(), deleteToContact(), get(), getByMsgId(), getByRef(), getByRefExt(), getLines(), getRoles(), index(), and listTimespent().
|
private |
Validate fields before create or update object.
| array<string,mixed> | $data Array with data to verify |
| RestException |
Definition at line 1010 of file api_projects.class.php.
References $object.
Referenced by post().
| Projects::addContact | ( | $id, | |
| $fk_socpeople, | |||
| $type_contact, | |||
| $source, | |||
| $notrigger = 0 ) |
Adds a contact to an project.
| int | $id | project ID |
| int | $fk_socpeople | Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link |
| string | $type_contact | Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING |
| string | $source | external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) |
| int | $notrigger | Disable all triggers |
@url POST {id}/contacts
| RestException | 304 |
| RestException | 401 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 408 of file api_projects.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Projects::addToContact | ( | $id, | |
| $fk_socpeople, | |||
| $type_contact, | |||
| $source, | |||
| $notrigger = 0, | |||
| $affect_to_tasks = null ) |
Adds a contact to a project.
| int | $id | Project ID |
| int | $fk_socpeople | Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link |
| string | $type_contact | Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING |
| string | $source | external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) |
| int | $notrigger | Disable all triggers |
| int[] | $affect_to_tasks | Array of task IDs to also add the contact to (empty array = all tasks, null = no tasks) |
@url POST {id}/contacts
| RestException | 304 |
| RestException | 401 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 1080 of file api_projects.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Projects::delete | ( | $id | ) |
Delete project.
| int | $id | Project ID |
Definition at line 753 of file api_projects.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Projects::deleteContact | ( | $id, | |
| $contactid, | |||
| $type ) |
Delete a contact type of given project.
| int | $id | Id of project to update |
| int | $contactid | Row key of the contact in the array contact_ids. |
| string | $type | Type of the contact (BILLING, SHIPPING, CUSTOMER). |
@url DELETE {id}/contact/{contactid}/{type}
| RestException | 401 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 445 of file api_projects.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Projects::deleteToContact | ( | $id, | |
| $contactid, | |||
| $type ) |
Delete a contact type of given project.
| int | $id | Id of project to update |
| int | $contactid | Row key of the contact in the array contact_ids. |
| string | $type | Type of the contact (BILLING, SHIPPING, CUSTOMER). |
@url DELETE {id}/contact/{contactid}/{type}
| RestException | 401 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 1135 of file api_projects.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Projects::get | ( | $id | ) |
Get properties of a project object.
Return an array with project information
| int | $id | ID of project |
| RestException |
Definition at line 76 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 169 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 107 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 138 of file api_projects.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Projects::getContacts | ( | $id, | |
| $type = '' ) |
Get contacts of given project.
Return an array with contact information
| int | $id | ID of project |
| string | $type | Type of the contact |
@url GET {id}/contacts
| RestException |
Definition at line 1038 of file api_projects.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| 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 486 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 526 of file api_projects.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Projects::getTimespent | ( | $id | ) |
Get timespent of a project (from all its tasks)
| int | $id | ID of project |
@url GET {id}/timespent
| RestException |
Definition at line 1177 of file api_projects.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| 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 206 of file api_projects.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), dol_syslog(), forgeSQLFromUniversalSearchCriteria(), and getEntity().
| Projects::listTimespent | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $thirdparty_ids = '', | |||
| $category = 0, | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
Get all timespent.
| 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 848 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 315 of file api_projects.class.php.
References 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 704 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 801 of file api_projects.class.php.
References $id, and DolibarrApi\_checkAccessToResource().