dolibarr  7.0.0-beta
Public Member Functions | List of all members
Projects Class Reference
+ Inheritance diagram for Projects:
+ Collaboration diagram for Projects:

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a project object. More...
 
 post ($request_data=NULL)
 Create project object. More...
 
 getLines ($id, $includetimespent=0)
 Get tasks of a project. More...
 
 getRoles ($id, $userid=0)
 Get roles a user is assigned to a project with. More...
 
 put ($id, $request_data=NULL)
 Add a task to given project. More...
 
 delete ($id)
 Delete project. More...
 
 validate ($id, $notrigger=0)
 Validate a project. More...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
 _validate ($data)
 Validate fields before create or update object. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 
 _cleanObjectDatas ($object)
 Executed method when API is called without parameter. More...
 
 _checkFilters ($sqlfilters)
 Return if a $sqlfilters parameter is valid. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DolibarrApi
static _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
 Check user access to a resource. More...
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria. More...
 

Detailed Description

Definition at line 30 of file api_projects.class.php.

Member Function Documentation

Projects::_cleanObjectDatas (   $object)

Clean sensible object datas.

Parameters
object$objectObject to clean
Returns
array Array of cleaned object properties

Definition at line 537 of file api_projects.class.php.

Referenced by get(), getLines(), and getRoles().

Projects::_validate (   $data)

Validate fields before create or update object.

Parameters
array$dataArray with data to verify
Returns
array
Exceptions
RestException

Definition at line 587 of file api_projects.class.php.

Referenced by post().

Projects::delete (   $id)

Delete project.

Parameters
int$idProject ID
Returns
array

Definition at line 455 of file api_projects.class.php.

References DolibarrApi\_checkAccessToResource().

Projects::get (   $id)

Get properties of a project object.

Return an array with project informations

Parameters
int$idID of project
Returns
array|mixed data without useless information
Exceptions
RestException

Definition at line 67 of file api_projects.class.php.

References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().

Projects::getLines (   $id,
  $includetimespent = 0 
)

Get tasks of a project.

Parameters
int$idId of project
int$includetimespent0=Return only list of tasks. 1=Include a summary of time spent, 2=Include details of time spent lines (2 is no implemented yet)
Returns
int

GET {id}/tasks

Definition at line 216 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.

Parameters
int$idId of project
int$useridId of user (0 = connected user)

GET {id}/roles

Returns
int

Definition at line 258 of file api_projects.class.php.

References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().

Projects::post (   $request_data = NULL)

Create project object.

Parameters
array$request_dataRequest data
Returns
int ID of project

Definition at line 182 of file api_projects.class.php.

References _validate().

Projects::put (   $id,
  $request_data = NULL 
)

Add a task to given project.

Parameters
int$idId of project to update
array$request_dataProjectline data

POST {id}/tasks

Returns
int Update a task to given project
Parameters
int$idId of project to update
int$taskidId of task to update
array$request_dataProjectline data

PUT {id}/tasks/{taskid}

Returns
object Update project general fields (won't touch lines of project)
Parameters
int$idId of project to update
array$request_dataDatas
Returns
int

Definition at line 420 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 }

Parameters
int$idProject ID
int$notrigger1=Does not execute triggers, 0= execute triggers

POST {id}/validate

Returns
array FIXME An error 403 is returned if the request has an empty body. Error message: "Forbidden: Content type `text/plain` is not supported." Workaround: send this in the body { "notrigger": 0 }

Definition at line 500 of file api_projects.class.php.

References DolibarrApi\_checkAccessToResource().


The documentation for this class was generated from the following file: