Projects
class Projects extends DolibarrApi (View source)
API class for projects
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| Project | $project | ||
| Task | $task |
Methods
Constructor
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensible object datas
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Get properties of a project object
Get properties of a project object
Get properties of a project object
Get properties of a project object
List projects
Create project object
Adds a contact to an project
Delete a contact type of given project
Get tasks of a project.
Get roles a user is assigned to a project with
Update project general fields (won't touch lines of project)
Delete project
Validate a project.
Get all timespent
Get contacts of given project
Adds a contact to a project
Delete a contact type of given project
Get timespent of a project (from all its tasks)
Details
__construct()
Constructor
protected string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)
Check and convert a string depending on its type/name.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensible object datas
static protected bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')
Check access by user to a given resource
protected bool|string
_checkFilters(string $sqlfilters, string $error = '')
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
static protected string
_forge_criteria_callback(string[] $matches)
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
object
get(int $id)
Get properties of a project object
Return an array with project information
object
getByRef(string $ref)
Get properties of a project object
Return an array with project information
object
getByRefExt(string $ref_ext)
Get properties of a project object
Return an array with project information
object
getByMsgId(string $email_msgid)
Get properties of a project object
Return an array with project information
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $thirdparty_ids = '', int $category = 0, string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List projects
Get a list of projects
int
post(array $request_data = null)
Create project object
object
addContact(int $id, int $fk_socpeople, string $type_contact, string $source, int $notrigger = 0)
Adds a contact to an project
object
deleteContact(int $id, int $contactid, string $type)
Delete a contact type of given project
array
getLines(int $id, int $includetimespent = 0)
Get tasks of a project.
See also API /tasks
array
getRoles(int $id, int $userid = 0)
Get roles a user is assigned to a project with
object
put(int $id, array $request_data = null)
Update project general fields (won't touch lines of project)
array
delete(int $id)
Delete project
array
validate(int $id, int $notrigger = 0)
Validate a project.
You can test this API with the following input message { "notrigger": 0 }
array
listTimespent(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $thirdparty_ids = '', int $category = 0, string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
Get all timespent
array<int, mixed>
getContacts(int $id, string $type = '')
Get contacts of given project
Return an array with contact information
object
addToContact(int $id, int $fk_socpeople, string $type_contact, string $source, int $notrigger = 0, int[] $affect_to_tasks = null)
Adds a contact to a project
object
deleteToContact(int $id, int $contactid, string $type)
Delete a contact type of given project
array<int, mixed>
getTimespent(int $id)
Get timespent of a project (from all its tasks)