Holidays
class Holidays extends DolibarrApi (View source)
API class for Leaves
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| Holiday | $holiday |
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 a leave
List leaves
Create a leave
Update expense report general fields
Delete holiday
Validate a holiday
Approve a leave
Cancel a holiday
Refuse a holiday
Reopen a canceled holiday
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 a leave
Return an array with leave information
array<string, mixed>
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $user_ids = '', string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List leaves
Get a list of Leaves
int
post(array $request_data = null)
Create a leave
object
put(int $id, array $request_data = null)
Update expense report general fields
Does not touch lines of the expense report
array
delete(int $id)
Delete holiday
object
validate(int $id, int $notrigger = 0)
Validate a holiday
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
approve(int $id, int $notrigger = 0)
Approve a leave
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
cancel(int $id, int $notrigger = 0)
Cancel a holiday
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
refuse(int $id, string $detail_refuse, int $notrigger = 0)
Refuse a holiday
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
reopen(int $id, int $notrigger = 0)
Reopen a canceled holiday
This method allows to reopen a holiday that was previously canceled and set its status back to VALIDATED
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }