22use Luracast\Restler\RestException;
24require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
25require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
40 public static $FIELDS = array(
48 public static $FIELDS_MESSAGES = array(
65 $this->ticket =
new Ticket($this->db);
81 public function get(
$id, $contact_list = 1)
103 return $this->
getCommon(0, $track_id,
'', $contact_list);
123 return $this->
getCommon(0,
'', $ref, $contact_list);
136 private function getCommon(
$id = 0, $track_id =
'', $ref =
'', $contact_list = 1)
140 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'read')) {
141 throw new RestException(403);
145 if ((
$id < 0) && !$track_id && !$ref) {
146 throw new RestException(400,
'Wrong parameters');
148 if (empty(
$id) && empty($ref) && empty($track_id)) {
149 $result = $this->ticket->initAsSpecimen();
151 $result = $this->ticket->fetch(
$id, $ref, $track_id);
154 throw new RestException(404,
'Ticket not found');
160 $this->ticket->loadCacheMsgsTicket();
162 if (is_array($this->ticket->cache_msgs_ticket) && count($this->ticket->cache_msgs_ticket) > 0) {
163 $num = count($this->ticket->cache_msgs_ticket);
166 $iduseraction = $this->ticket->cache_msgs_ticket[$i][
'fk_user_action'];
167 if ($iduseraction > 0) {
168 if (empty(
$conf->cache[
'user'][$iduseraction])) {
169 $user_action =
new User($this->db);
170 $user_action->fetch($iduseraction);
172 $conf->cache[
'user'][$iduseraction] = $user_action;
174 $user_action =
$conf->cache[
'user'][$iduseraction];
182 'id' => $this->ticket->cache_msgs_ticket[$i][
'id'],
183 'fk_user_action' => $this->ticket->cache_msgs_ticket[$i][
'fk_user_action'],
184 'fk_user_action_socid' => $user_action ===
null ?
'' : $user_action->socid,
185 'fk_user_action_string' => $user_action ===
null ?
'' :
dolGetFirstLastname($user_action->firstname, $user_action->lastname),
186 'datec' => $this->ticket->cache_msgs_ticket[$i][
'datec'],
187 'datep' => $this->ticket->cache_msgs_ticket[$i][
'datep'],
188 'subject' => $this->ticket->cache_msgs_ticket[$i][
'subject'],
189 'message' => $this->ticket->cache_msgs_ticket[$i][
'message'],
190 'private' => $this->ticket->cache_msgs_ticket[$i][
'private']
194 $this->ticket->messages = $messages;
198 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
201 if ($contact_list > -1) {
203 $tmparray = $this->ticket->liste_contact(-1,
'external', $contact_list);
204 if (is_array($tmparray)) {
205 $this->ticket->contacts_ids = $tmparray;
207 $tmparray = $this->ticket->liste_contact(-1,
'internal', $contact_list);
208 if (is_array($tmparray)) {
209 $this->ticket->contacts_ids_internal = $tmparray;
235 public function index($socid = 0, $sortfield =
"t.rowid", $sortorder =
"ASC", $limit = 100, $page = 0, $sqlfilters =
'', $properties =
'', $loadcontacts = 0, $pagination_data =
false)
237 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'read')) {
238 throw new RestException(403);
243 $socid = DolibarrApiAccess::$user->socid ?: $socid;
248 if (!DolibarrApiAccess::$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
249 $search_sale = DolibarrApiAccess::$user->id;
252 $sql =
"SELECT t.rowid";
253 $sql .=
" FROM ".MAIN_DB_PREFIX.
"ticket AS t";
254 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe AS s ON (s.rowid = t.fk_soc)";
255 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"ticket_extrafields AS ef ON (ef.fk_object = t.rowid)";
256 $sql .=
' WHERE t.entity IN ('.getEntity(
'ticket', 1).
')';
258 $sql .=
" AND t.fk_soc = ".((int) $socid);
261 if ($search_sale && $search_sale !=
'-1') {
262 if ($search_sale == -2) {
263 $sql .=
" AND ".getSalesRepresentativeSqlFilter(
't.fk_soc', 0, 1);
264 } elseif ($search_sale > 0) {
265 $sql .=
" AND ".getSalesRepresentativeSqlFilter(
't.fk_soc', (
int) $search_sale);
273 throw new RestException(400,
'Error when validating parameter sqlfilters -> '.$errormessage);
278 $sqlTotals = str_replace(
'SELECT t.rowid',
'SELECT count(t.rowid) as total', $sql);
280 $sql .= $this->db->order($sortfield, $sortorder);
286 $offset = $limit * $page;
288 $sql .= $this->db->plimit($limit, $offset);
291 $result = $this->db->query($sql);
294 $num = $this->db->num_rows($result);
295 $min = min($num, ($limit <= 0 ? $num : $limit));
297 $obj = $this->db->fetch_object($result);
298 $ticket_static =
new Ticket($this->db);
299 if ($ticket_static->fetch($obj->rowid)) {
300 if ($ticket_static->fk_user_assign > 0) {
301 $userStatic =
new User($this->db);
302 $userStatic->fetch($ticket_static->fk_user_assign);
308 $tmparray = $ticket_static->liste_contact(-1,
'external', 1);
309 if (is_array($tmparray)) {
310 $ticket_static->contacts_ids = $tmparray;
312 $tmparray = $ticket_static->liste_contact(-1,
'internal', 1);
313 if (is_array($tmparray)) {
314 $ticket_static->contacts_ids_internal = $tmparray;
323 throw new RestException(503,
'Error when retrieve ticket list');
327 if ($pagination_data) {
328 $totalsResult = $this->db->query($sqlTotals);
329 $total = $this->db->fetch_object($totalsResult)->total;
334 $obj_ret[
'data'] = $tmp;
335 $obj_ret[
'pagination'] = [
336 'total' => (int) $total,
338 'page_count' => ceil((
int) $total / $limit),
354 public function post($request_data =
null)
356 $ticketstatic =
new Ticket($this->db);
357 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'write')) {
358 throw new RestException(403);
365 $socid = (int) ($request_data[
'socid'] ?? 0);
367 $thirdpartytmp =
new Societe($this->db);
368 $thirdparty_result = $thirdpartytmp->fetch($socid);
369 if ($thirdparty_result < 1) {
370 throw new RestException(404,
'Thirdparty with id='.$socid.
' not found or not allowed');
373 throw new RestException(404,
'Thirdparty with id='.$thirdpartytmp->id.
' not found or not allowed');
377 foreach ($request_data as $field => $value) {
378 if ($field ===
'caller') {
380 $this->ticket->context[
'caller'] =
sanitizeVal($request_data[
'caller'],
'aZ09');
384 $this->ticket->$field = $this->
_checkValForAPI($field, $value, $this->ticket);
386 if (empty($this->ticket->ref)) {
387 $this->ticket->ref = $ticketstatic->getDefaultRef();
389 if (empty($this->ticket->track_id)) {
393 if ($this->ticket->create(DolibarrApiAccess::$user) < 0) {
394 throw new RestException(500,
"Error creating ticket", array_merge(array($this->ticket->error), $this->ticket->errors));
397 return $this->ticket->id;
412 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'write')) {
413 throw new RestException(403);
419 $return_action_id =
false;
420 if (isset($request_data[
'return_action_id'])) {
421 $return_action_id = !empty($request_data[
'return_action_id']);
422 unset($request_data[
'return_action_id']);
425 $attachments = array();
426 if (isset($request_data[
'attachments']) && is_array($request_data[
'attachments'])) {
427 $attachments = $request_data[
'attachments'];
428 unset($request_data[
'attachments']);
431 foreach ($request_data as $field => $value) {
432 if ($field ===
'caller') {
434 $this->ticket->context[
'caller'] =
sanitizeVal($request_data[
'caller'],
'aZ09');
438 $this->ticket->$field = $this->
_checkValForAPI($field, $value, $this->ticket);
440 $ticketMessageText = $this->ticket->message;
442 if (!empty($this->ticket->id)) {
443 $result = $this->ticket->fetch($this->ticket->id);
444 } elseif (!empty($this->ticket->ref)) {
445 $result = $this->ticket->fetch(0, $this->ticket->ref);
447 $result = $this->ticket->fetch(0,
'', $this->ticket->track_id);
450 throw new RestException(404,
'Ticket not found');
454 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
457 $this->ticket->message = $ticketMessageText;
459 $filename_list = array();
460 $mimetype_list = array();
461 $mimefilename_list = array();
462 if (!empty($attachments)) {
464 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
466 $destdir =
$conf->ticket->dir_output.
'/'.$this->ticket->ref;
468 throw new RestException(500,
'Error while trying to create directory '.$destdir);
471 foreach ($attachments as $attachment) {
472 if (!is_array($attachment) || empty($attachment[
'filename'])) {
477 if (empty($filename)) {
481 $filecontent = isset($attachment[
'filecontent']) ? $attachment[
'filecontent'] :
'';
482 $fileencoding = isset($attachment[
'fileencoding']) ? $attachment[
'fileencoding'] :
'';
483 $content = ($fileencoding ===
'base64') ? base64_decode($filecontent) : $filecontent;
484 if ($content ===
false) {
485 throw new RestException(400,
'Failed to decode attachment '.$filename);
488 $destfile = $destdir.
'/'.$filename;
489 if (is_file($destfile)) {
490 $pathinfo = pathinfo($filename);
491 $suffix =
' - '.dol_print_date(
dol_now(),
'dayhourlog');
492 $extension = !empty($pathinfo[
'extension']) ?
'.'.$pathinfo[
'extension'] :
'';
493 $basename = !empty($pathinfo[
'filename']) ? $pathinfo[
'filename'] : preg_replace(
'/\.[^.]+$/',
'', $filename);
494 $destfile = $destdir.
'/'.$basename.$suffix.$extension;
497 $destfiletmp = DOL_DATA_ROOT.
'/admin/temp/'.basename($destfile);
502 $fhandle = @fopen($destfiletmp,
'w');
504 throw new RestException(500,
"Failed to open file '".$destfiletmp.
"' for write");
506 $nbofbyteswrote = fwrite($fhandle, $content);
508 if ($nbofbyteswrote ===
false) {
509 throw new RestException(500,
"Failed to write file '".$destfiletmp.
"'");
513 'description' =>
'File uploaded using ticket API',
514 'src_object_type' => $this->ticket->element,
515 'src_object_id' => $this->ticket->id,
516 'gen_or_uploaded' =>
'uploaded'
518 $resultmove =
dol_move($destfiletmp, $destfile,
'0', 1, 0, 1, $moreinfo);
520 throw new RestException(500,
"Failed to move file into '".$destfile.
"'");
523 $filename_list[] = $destfile;
524 $mimefilename_list[] = basename($destfile);
525 $mimetype_list[] = !empty($attachment[
'mimetype']) ? $attachment[
'mimetype'] :
'';
529 $actionid = $this->ticket->createTicketMessage(DolibarrApiAccess::$user, 0, $filename_list, $mimetype_list, $mimefilename_list);
530 if ($actionid <= 0) {
531 throw new RestException(500,
'Error when creating ticket');
533 if ($return_action_id) {
534 return array(
'ticket_id' => $this->ticket->id,
'action_id' => $actionid);
536 return $this->ticket->id;
548 public function put(
$id, $request_data =
null)
550 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'write')) {
551 throw new RestException(403);
554 $result = $this->ticket->fetch(
$id);
556 throw new RestException(404,
'Ticket not found');
560 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
564 $socid = (int) ($request_data[
'socid'] ?? 0);
566 $thirdpartytmp =
new Societe($this->db);
567 $thirdparty_result = $thirdpartytmp->fetch($socid);
568 if ($thirdparty_result < 1) {
569 throw new RestException(404,
'Thirdparty with id='.$socid.
' not found or not allowed');
572 throw new RestException(404,
'Thirdparty with id='.$thirdpartytmp->id.
' not found or not allowed');
576 foreach ($request_data as $field => $value) {
577 if ($field ===
'caller') {
579 $this->ticket->context[
'caller'] =
sanitizeVal($request_data[
'caller'],
'aZ09');
583 if ($field ==
'id') {
586 if ($field ==
'array_options' && is_array($value)) {
587 foreach ($value as $index => $val) {
593 $this->ticket->$field = $this->
_checkValForAPI($field, $value, $this->ticket);
596 if ($this->ticket->update(DolibarrApiAccess::$user) > 0) {
597 return $this->
get(
$id);
599 throw new RestException(500, $this->ticket->errorsToString());
624 throw new RestException(403);
626 if ($this->ticket->fetch((
int)
$id) <= 0) {
627 throw new RestException(404,
'Ticket not found');
630 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
632 if (in_array((
int) $this->ticket->status, array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED),
true)) {
633 throw new RestException(409,
'Ticket is already closed or canceled');
635 if ($this->ticket->close(DolibarrApiAccess::$user, $cancel ? 1 : 0) <= 0) {
636 throw new RestException(500,
'Error when closing the ticket: '.$this->ticket->errorsToString());
639 return $this->
get((int)
$id);
663 throw new RestException(403);
665 if ($this->ticket->fetch((
int)
$id) <= 0) {
666 throw new RestException(404,
'Ticket not found');
669 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
671 $fk_user_assign = (int) $fk_user_assign;
672 if ($fk_user_assign > 0) {
673 $assignee =
new User($this->db);
674 if ($assignee->fetch($fk_user_assign) <= 0 || (
int) $assignee->status !== 1) {
675 throw new RestException(400,
'User '.$fk_user_assign.
' not found or not active');
679 $previous = (int) $this->ticket->fk_user_assign;
682 if ($this->ticket->assignUser(DolibarrApiAccess::$user, $fk_user_assign) < 0) {
686 if (!$error && $previous > 0) {
687 foreach ($this->ticket->listeContact(-1,
'internal', 0,
'SUPPORTTEC') as $contact) {
688 if ((
int) $contact[
'id'] !== $fk_user_assign && $this->ticket->delete_contact($contact[
'rowid']) < 0) {
693 if (!$error && $fk_user_assign > 0 && $fk_user_assign !== $previous && $this->ticket->add_contact($fk_user_assign,
'SUPPORTTEC',
'internal') < 0) {
697 $this->db->rollback();
698 throw new RestException(500,
'Error when assigning the ticket: '.$this->ticket->errorsToString());
702 return $this->
get((int)
$id);
713 return (
bool) DolibarrApiAccess::$user->hasRight(
'ticket',
'manage_advance');
716 return (
bool) DolibarrApiAccess::$user->hasRight(
'ticket',
'write');
727 public function delete(
$id)
729 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'delete')) {
730 throw new RestException(403);
732 $result = $this->ticket->fetch(
$id);
734 throw new RestException(404,
'Ticket not found');
738 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
741 if (!$this->ticket->delete(DolibarrApiAccess::$user)) {
742 throw new RestException(500,
'Error when deleting ticket');
748 'message' =>
'Ticket deleted'
763 if ($data ===
null) {
767 foreach (Tickets::$FIELDS as $field) {
768 if (!isset($data[$field])) {
769 throw new RestException(400,
"$field field missing");
771 $ticket[$field] = $data[$field];
786 if ($data ===
null) {
790 foreach (Tickets::$FIELDS_MESSAGES as $field) {
791 if (!isset($data[$field])) {
792 throw new RestException(400,
"$field field missing");
794 $ticket[$field] = $data[$field];
823 "table_element_line",
830 "barcode_type_label",
831 "barcode_type_coder",
835 "fk_delivery_address",
836 "shipping_method_id",
849 "location_incoterms",
857 "cache_types_tickets",
861 "multicurrency_code",
863 "multicurrency_total_ht",
864 "multicurrency_total_ttc",
865 "multicurrency_total_tva",
866 "multicurrency_total_localtax1",
867 "multicurrency_total_localtax2"
869 foreach ($attr2clean as $toclean) {
875 $nboflines = count(
$object->lines);
876 for ($i = 0; $i < $nboflines; $i++) {
882 if (isset(
$object->linkedObjects) && count(
$object->linkedObjects) > 0) {
883 foreach (
$object->linkedObjects as $type_object => $linked_object) {
884 foreach ($linked_object as $object2clean) {
912 public function postContact(
int $id,
int $contactid,
string $type,
string $source =
"external",
int $notrigger = 0): array
915 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'write')) {
916 throw new RestException(403);
920 if (empty($source)) {
921 throw new RestException(400,
'Source can not be empty');
925 throw new RestException(400,
'type can not be empty');
929 $sqlCheckTypeSource =
"SELECT tc.rowid";
930 $sqlCheckTypeSource .=
" FROM ".$this->db->prefix().
"c_type_contact as tc";
931 $sqlCheckTypeSource .=
" WHERE tc.element LIKE 'ticket'";
932 $sqlCheckTypeSource .=
" AND tc.source = '".$this->db->escape($source).
"'";
933 $sqlCheckTypeSource .=
" AND tc.code = '".$this->db->escape($type).
"'";
934 $sqlCheckTypeSource .=
" AND tc.active = 1";
935 $result = $this->db->query($sqlCheckTypeSource);
937 if ($result && $this->db->num_rows($result) == 0) {
938 throw new RestException(400,
'Contact type not found');
942 if ($source ==
"external") {
944 $sqlCheckExternalContact =
"SELECT 1 as exist";
945 $sqlCheckExternalContact .=
" FROM ".MAIN_DB_PREFIX.
"socpeople";
946 $sqlCheckExternalContact .=
" WHERE rowid = " . intval($contactid);
947 $result = $this->db->query($sqlCheckExternalContact);
949 if ($result && $this->db->num_rows($result) == 0) {
950 throw new RestException(404,
'External contact not found');
954 $sqlCheckInternalContact =
"SELECT 1 as exist";
955 $sqlCheckInternalContact .=
" FROM ".MAIN_DB_PREFIX.
"user";
956 $sqlCheckInternalContact .=
" WHERE rowid = " . intval($contactid);
957 $result = $this->db->query($sqlCheckInternalContact);
959 if ($result && $this->db->num_rows($result) == 0) {
960 throw new RestException(404,
'Internal contact not found');
965 $result = $this->ticket->fetch(
$id);
967 throw new RestException(404,
'Ticket not found');
970 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
973 $result = $this->ticket->add_contact($contactid, $type, $source, $notrigger);
976 throw new RestException(400,
'Already exists: Contact='.$contactid.
' is already linked to the ticket='.
$id.
' as source='.$source.
' and type='.$type);
977 } elseif ($result == -1) {
978 throw new RestException(400,
'Wrong contact='.$contactid);
979 } elseif ($result == -2) {
980 throw new RestException(400,
'Wrong type='.$type);
981 } elseif ($result == -3) {
982 throw new RestException(400,
'Not allowed contacts');
983 } elseif ($result == -4) {
984 throw new RestException(400,
'ErrorCommercialNotAllowedForThirdparty');
985 } elseif ($result == -5) {
986 throw new RestException(400,
'Trigger failed');
987 } elseif ($result == -6) {
988 throw new RestException(400,
'DB_ERROR_RECORD_ALREADY_EXISTS');
989 } elseif ($result == -7) {
990 throw new RestException(400,
'Some other error');
991 } elseif ($result <= -8) {
992 throw new RestException(400,
'Unknown error occurred');
998 'message' =>
'Contact='.$contactid.
' linked to the ticket='.
$id.
' as '.$source.
' '.$type
1022 public function deleteContact(
int $id,
int $contactid,
string $type,
string $source =
"external"): array
1025 if (!DolibarrApiAccess::$user->hasRight(
'ticket',
'write')) {
1026 throw new RestException(403);
1030 if (empty($source)) {
1031 throw new RestException(400,
'Source can not be empty');
1035 throw new RestException(400,
'type can not be empty');
1038 $result = $this->ticket->fetch(
$id);
1040 throw new RestException(404,
'Ticket not found');
1044 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
1047 $contacts = $this->ticket->liste_contact(-1, $source);
1048 foreach ($contacts as $contact) {
1049 if ($contact[
'id'] == $contactid && $contact[
'code'] == $type) {
1050 $result = $this->ticket->delete_contact($contact[
'rowid']);
1053 throw new RestException(500,
'Error when deleting the contact '.$contact[
'rowid']);
1061 'message' =>
'Contact unlinked from ticket'
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
_checkValExtrafieldsForAPI($field, $value, $object)
Check and convert a string depending on its type/name.
_filterObjectProperties($object, $properties)
Filter properties that will be returned on object.
_checkValForAPI($field, $value, $object)
Check and convert a string depending on its type/name.
static _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $parenttableforentity='')
Check access by user to a given resource.
Class to manage third parties objects (customers, suppliers, prospects...)
canManage()
Whether the API user may close and assign tickets, as on the ticket card.
getByTrackId($track_id, $contact_list=1)
Get properties of a Ticket object from track id.
deleteContact(int $id, int $contactid, string $type, string $source="external")
Unlink a contact type of given ticket.
getCommon($id=0, $track_id='', $ref='', $contact_list=1)
Get properties of a Ticket object Return an array with ticket information.
__construct()
Constructor.
index($socid=0, $sortfield="t.rowid", $sortorder="ASC", $limit=100, $page=0, $sqlfilters='', $properties='', $loadcontacts=0, $pagination_data=false)
List tickets.
_cleanObjectDatas($object)
Clean sensible object datas @phpstan-template T.
postNewMessage($request_data=null)
Add a new message to an existing ticket identified by property ->track_id into request.
post($request_data=null)
Create ticket object.
assign($id, $fk_user_assign=0)
Assign a ticket to a user, or unassign it.
put($id, $request_data=null)
Update ticket.
_validateMessage($data)
Validate fields before create or update object message.
postContact(int $id, int $contactid, string $type, string $source="external", int $notrigger=0)
Add a contact type of given ticket.
getByRef($ref, $contact_list=1)
Get properties of a Ticket object from ref.
close($id, $cancel=0)
Close a ticket, or cancel it.
_validate($data)
Validate fields before create or update object.
Class to manage Dolibarr users.
dol_move($srcfile, $destfile, $newmask='0', $overwriteifexists=1, $testvirus=0, $indexdatabase=1, $moreinfo=array(), $entity=null)
Move a file into another name.
dol_is_dir($folder)
Test if filename is a directory.
dol_now($mode='gmt')
Return date for now.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0, $forbiddenfields=array())
forgeSQLFromUniversalSearchCriteria
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
sanitizeVal($out='', $check='alphanohtml', $filter=null, $options=null)
Return a sanitized or empty value after checking value against a rule.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
Class to generate the form for creating a new ticket.
generate_random_id($car=16)
Generate a random id.