26 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
38 public $module =
'workstation';
43 public $element =
'workstation';
48 public $table_element =
'workstation_workstation';
54 public $ismultientitymanaged = 0;
59 public $isextrafieldmanaged = 0;
64 public $picto =
'workstation';
67 const STATUS_DISABLED = 0;
68 const STATUS_ENABLED = 1;
101 public $fields=array(
102 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
103 'ref' => array(
'type'=>
'varchar(128)',
'label'=>
'Ref',
'enabled'=>
'1',
'position'=>10,
'notnull'=>1,
'visible'=>1,
'noteditable'=>
'0',
'default'=>
'',
'index'=>1,
'searchall'=>1,
'showoncombobox'=>
'1',
'comment'=>
"Reference of object"),
104 'label' => array(
'type'=>
'varchar(255)',
'label'=>
'Label',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'searchall'=>1,
'css'=>
'minwidth300',
'csslist'=>
'tdoverflowmax125',
'showoncombobox'=>
'2',),
105 'type' => array(
'type'=>
'varchar(8)',
'label'=>
'Type',
'enabled'=>
'1',
'position'=>32,
'default'=>1,
'notnull'=>1,
'visible'=>1,
'arrayofkeyval'=>array(
'HUMAN'=>
'Human',
'MACHINE'=>
'Machine',
'BOTH'=>
'HumanMachine'),),
106 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>61,
'notnull'=>0,
'visible'=>0,),
107 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>0,),
108 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,
'csslist'=>
'nowraponall'),
109 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,
'csslist'=>
'nowraponall'),
110 'fk_user_creat' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserAuthor',
'enabled'=>
'1',
'position'=>510,
'notnull'=>1,
'visible'=>-2,
'foreignkey'=>
'user.rowid',),
111 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
112 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>512,
'notnull'=>-1,
'visible'=>-2,),
113 'nb_operators_required' => array(
'type'=>
'integer',
'label'=>
'NbOperatorsRequired',
'enabled'=>
'1',
'position'=>50,
'notnull'=>0,
'visible'=>1,),
114 'thm_operator_estimated' => array(
'type'=>
'double',
'help'=>
'THMOperatorEstimatedHelp',
'label'=>
'THMOperatorEstimated',
'enabled'=>
'1',
'position'=>50,
'notnull'=>0,
'visible'=>1,
'css'=>
'right'),
115 'thm_machine_estimated' => array(
'type'=>
'double',
'help'=>
'THMMachineEstimatedHelp',
'label'=>
'THMMachineEstimated',
'enabled'=>
'1',
'position'=>50,
'notnull'=>0,
'visible'=>1,
'css'=>
'right'),
116 'status' => array(
'type'=>
'smallint',
'label'=>
'Status',
'enabled'=>
'1',
'position'=>1000,
'default'=>1,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'arrayofkeyval'=>array(
'0'=>
'Disabled',
'1'=>
'Enabled'),),
122 public $note_private;
123 public $date_creation;
125 public $fk_user_creat;
126 public $fk_user_modif;
129 public $nb_operators_required;
130 public $thm_operator_estimated;
131 public $thm_machine_estimated;
178 global $conf, $langs;
180 require_once DOL_DOCUMENT_ROOT.
'/workstation/class/workstationusergroup.class.php';
181 require_once DOL_DOCUMENT_ROOT.
'/workstation/class/workstationresource.class.php';
185 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
186 $this->fields[
'rowid'][
'visible'] = 0;
188 if (empty($conf->multicompany->enabled) && isset($this->fields[
'entity'])) {
189 $this->fields[
'entity'][
'enabled'] = 0;
199 foreach ($this->fields as $key => $val) {
200 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
201 unset($this->fields[$key]);
206 if (is_object($langs)) {
207 foreach ($this->fields as $key => $val) {
208 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
209 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
210 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
231 $groups =
GETPOST(
'groups',
'array:int');
232 if (empty($groups)) {
233 $groups = $this->usergroups;
235 if (!empty($groups)) {
236 foreach ($groups as $id_group) {
238 $ws_usergroup->fk_workstation = $id;
239 $ws_usergroup->fk_usergroup = $id_group;
240 $ws_usergroup->createCommon($user);
241 $this->usergroups[] = $id_group;
246 $resources =
GETPOST(
'resources',
'array:int');
247 if (empty($resources)) {
248 $resources = $this->resources;
250 if (!empty($resources)) {
251 foreach ($resources as $id_resource) {
253 $ws_resource->fk_workstation = $id;
254 $ws_resource->fk_resource = $id_resource;
255 $ws_resource->createCommon($user);
256 $this->resources[] = $id_resource;
272 global $langs, $extrafields;
277 $object =
new self($this->db);
282 $result = $object->fetch($fromid);
283 if ($result > 0 && !empty($object->table_element_line)) {
284 $object->fetchLines();
293 unset($object->fk_user_creat);
294 unset($object->import_key);
297 if (property_exists($object,
'ref')) {
298 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
300 if (property_exists($object,
'label')) {
301 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
303 if (property_exists($object,
'status')) {
304 $object->status = self::STATUS_DISABLED;
306 if (property_exists($object,
'date_creation')) {
307 $object->date_creation =
dol_now();
309 if (property_exists($object,
'date_modification')) {
310 $object->date_modification =
null;
314 if (is_array($object->array_options) && count($object->array_options) > 0) {
315 $extrafields->fetch_name_optionals_label($this->table_element);
316 foreach ($object->array_options as $key => $option) {
317 $shortkey = preg_replace(
'/options_/',
'', $key);
318 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
321 unset($object->array_options[$key]);
327 $object->context[
'createfromclone'] =
'createfromclone';
328 $result = $object->create($user);
331 $this->error = $object->error;
332 $this->errors = $object->errors;
344 if (property_exists($this,
'socid') && $this->socid == $object->socid) {
351 unset($object->context[
'createfromclone']);
358 $this->
db->rollback();
370 public function fetch($id, $ref =
null)
377 if ($result > 0 && !empty($this->table_element_line)) {
390 $this->lines = array();
408 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
418 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
419 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
420 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
422 $sql .=
' WHERE 1 = 1';
426 if (count($filter) > 0) {
427 foreach ($filter as $key => $value) {
428 if ($key ==
't.rowid') {
429 $sqlwhere[] = $key.
" = ".((int) $value);
430 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
431 $sqlwhere[] = $key.
" = '".$this->
db->idate($value).
"'";
432 } elseif ($key ==
'customsql') {
433 $sqlwhere[] = $value;
434 } elseif (strpos($value,
'%') ===
false) {
435 $sqlwhere[] = $key.
" IN (".$this->
db->sanitize($this->
db->escape($value)).
")";
437 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
441 if (count($sqlwhere) > 0) {
442 $sql .=
' AND ('.implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere).
')';
445 if (!empty($sortfield)) {
446 $sql .= $this->
db->order($sortfield, $sortorder);
448 if (!empty($limit)) {
449 $sql .= $this->
db->plimit($limit, $offset);
456 while ($i < ($limit ? min($limit, $num) : $num)) {
457 $obj = $this->
db->fetch_object(
$resql);
459 $record =
new self($this->db);
460 $record->setVarsFromFetchObj($obj);
462 $records[$record->id] = $record;
470 $this->errors[] =
'Error '.$this->db->lasterror();
471 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
488 $groups =
GETPOST(
'groups',
'array:int');
490 $this->usergroups=array();
492 foreach ($groups as $id_group) {
494 $ws_usergroup->fk_workstation = $this->id;
495 $ws_usergroup->fk_usergroup = $id_group;
496 $ws_usergroup->createCommon($user);
497 $this->usergroups[] = $id_group;
501 $resources =
GETPOST(
'resources',
'array:int');
503 $this->resources=array();
504 if (!empty($resources)) {
505 foreach ($resources as $id_resource) {
507 $ws_resource->fk_workstation = $this->id;
508 $ws_resource->fk_resource = $id_resource;
509 $ws_resource->createCommon($user);
510 $this->resources[] = $id_resource;
524 public function delete(
User $user, $notrigger =
false)
540 if ($this->status < 0) {
541 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
558 global $conf, $langs;
560 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
565 if ($this->status == self::STATUS_VALIDATED) {
566 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
583 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
588 $this->newref = $num;
592 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
593 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
594 $sql .=
" status = ".self::STATUS_VALIDATED;
595 if (!empty($this->fields[
'date_validation'])) {
596 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
598 if (!empty($this->fields[
'fk_user_valid'])) {
599 $sql .=
", fk_user_valid = ".$user->id;
601 $sql .=
" WHERE rowid = ".((int) $this->
id);
603 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
607 $this->error = $this->
db->lasterror();
611 if (!$error && !$notrigger) {
613 $result = $this->
call_trigger(
'WORKSTATION_VALIDATE', $user);
622 $this->oldref = $this->ref;
625 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
627 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->
db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'workstation/".$this->
db->escape($this->newref).
"'";
628 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'workstation/".$this->
db->escape($this->
ref).
"' and entity = ".$conf->entity;
631 $error++; $this->error = $this->
db->lasterror();
637 $dirsource = $conf->workstation->dir_output.
'/workstation/'.$oldref;
638 $dirdest = $conf->workstation->dir_output.
'/workstation/'.$newref;
639 if (!$error && file_exists($dirsource)) {
640 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
642 if (@rename($dirsource, $dirdest)) {
645 $listoffiles =
dol_dir_list($conf->workstation->dir_output.
'/workstation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
646 foreach ($listoffiles as $fileentry) {
647 $dirsource = $fileentry[
'name'];
648 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
649 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
650 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
651 @rename($dirsource, $dirdest);
661 $this->status = self::STATUS_VALIDATED;
668 $this->
db->rollback();
685 $this->status = $status;
687 if (empty($status)) {
704 return $this->
setStatusCommon($user, self::STATUS_ENABLED, $notrigger,
'WORKSTATION_ENABLED');
717 return $this->
setStatusCommon($user, self::STATUS_DISABLED, $notrigger,
'WORKSTATION_DISABLED');
730 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
732 global $conf, $langs, $hookmanager;
734 if (!empty($conf->dol_no_mouse_hover)) {
740 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Workstation").
'</u>';
742 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
743 if (isset($this->status)) {
744 $label .=
'<br><b>'.$langs->trans(
"Status").
":</b> ".$this->
getLibStatut(5);
747 $url =
dol_buildpath(
'/workstation/workstation_card.php', 1).
'?id='.$this->id;
749 if ($option !=
'nolink') {
751 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
752 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
753 $add_save_lastsearch_values = 1;
755 if ($add_save_lastsearch_values) {
756 $url .=
'&save_lastsearch_values=1';
761 if (empty($notooltip)) {
762 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
763 $label = $langs->trans(
"ShowWorkstation");
764 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
766 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
767 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
769 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
772 $linkstart =
'<a href="'.$url.
'"';
773 $linkstart .= $linkclose.
'>';
776 $result .= $linkstart;
778 if (empty($this->showphoto_on_popup)) {
780 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'mrp'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
784 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
786 list($class, $module) = explode(
'@', $this->picto);
789 $filename = $filearray[0][
'name'];
790 if (!empty($filename)) {
791 $pospoint = strpos($filearray[0][
'name'],
'.');
793 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
794 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
795 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.
'" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div></div>';
797 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div>';
802 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'mrp'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
807 if ($withpicto != 2) {
808 $result .= $this->ref;
814 global $action, $hookmanager;
815 $hookmanager->initHooks(array(
'workstationdao'));
816 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
817 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
819 $result = $hookmanager->resPrint;
821 $result .= $hookmanager->resPrint;
835 return $this->LibStatut($this->status, $mode);
849 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
852 $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv(
'Disabled');
853 $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv(
'Enabled');
854 $this->labelStatusShort[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv(
'Disabled');
855 $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv(
'Enabled');
858 $statusType =
'status'.$status;
860 if ($status == self::STATUS_ENABLED) $statusType =
'status4';
862 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
873 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
874 $sql .=
' fk_user_creat, fk_user_modif';
875 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
876 $sql .=
' WHERE t.rowid = '.((int) $id);
877 $result = $this->
db->query($sql);
879 if ($this->
db->num_rows($result)) {
880 $obj = $this->
db->fetch_object($result);
881 $this->
id = $obj->rowid;
883 $this->user_creation_id = $obj->fk_user_creat;
884 $this->user_modification_id = $obj->fk_user_modif;
885 $this->date_creation = $this->
db->jdate($obj->datec);
886 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
889 $this->
db->free($result);
903 $this->initAsSpecimenCommon();
913 $this->lines = array();
938 global $langs, $conf;
939 $langs->load(
"workstation");
941 if (empty($conf->global->WORKSTATION_WORKSTATION_ADDON)) {
942 $conf->global->WORKSTATION_WORKSTATION_ADDON =
'mod_workstation_standard';
945 if (!empty($conf->global->WORKSTATION_WORKSTATION_ADDON)) {
948 $file = $conf->global->WORKSTATION_WORKSTATION_ADDON.
".php";
949 $classname = $conf->global->WORKSTATION_WORKSTATION_ADDON;
952 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
953 foreach ($dirmodels as $reldir) {
957 $mybool |= @include_once $dir.$file;
960 if ($mybool ===
false) {
965 if (class_exists($classname)) {
966 $obj =
new $classname();
967 $numref = $obj->getNextValue($this);
969 if ($numref !=
'' && $numref !=
'-1') {
972 $this->error = $obj->error;
977 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
981 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
997 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
999 global $conf, $langs;
1002 $includedocgeneration = 0;
1004 $langs->load(
"workstation");
1007 $modele =
'standard_workstation';
1009 if ($this->model_pdf) {
1010 $modele = $this->model_pdf;
1011 } elseif (!empty($conf->global->WORKSTATION_ADDON_PDF)) {
1012 $modele = $conf->global->WORKSTATION_ADDON_PDF;
1016 $modelpath =
"core/modules/workstation/doc/";
1018 if ($includedocgeneration) {
1019 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1034 global $conf, $langs;
1050 $this->
db->commit();
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
getFieldList($alias='')
Function to concat keys of fields.
fetchCommon($id, $ref=null, $morewhere='')
Load object in memory from the database.
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchLinesCommon($morewhere='')
Load object in memory from the database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
Class to manage Dolibarr users.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
fetch($id, $ref=null)
Load object in memory from the database.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
createFromClone(User $user, $fromid)
Clone an object into another one.
fetchLines()
Load object lines in memory from the database.
create(User $user, $notrigger=false)
Create object into database.
setEnabled($user, $notrigger=0)
Set draft status.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
validate($user, $notrigger=0)
Validate object.
update(User $user, $notrigger=false)
Update object into database.
setDisabled($user, $notrigger=0)
Set draft status.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
info($id)
Load the info information in the object.
getLibStatut($mode=0)
Return the label of the status.
__construct(DoliDB $db)
Constructor.
getLinesArray()
Create an array of lines.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
LibStatut($status, $mode=0)
Return the status.
setStatus($status, $notrigger=0)
Set draft status.
Class to link resource with Workstations.
static getAllResourcesOfWorkstation($fk_workstation)
Function used to get an array with all resources linked to a workstation.
static deleteAllResourcesOfWorkstation($fk_workstation)
Function used to remove all resources linked to a workstation.
Class to link User groups and Workstations.
static deleteAllGroupsOfWorkstation($fk_workstation)
Function used to remove all usergroups linked to a workstation.
static getAllGroupsOfWorkstation($fk_workstation)
Function used to get an array with all usergroups linked to a workstation.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db
API class for accounts.