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;
142 global $conf, $langs;
144 require_once DOL_DOCUMENT_ROOT.
'/workstation/class/workstationusergroup.class.php';
145 require_once DOL_DOCUMENT_ROOT.
'/workstation/class/workstationresource.class.php';
151 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
152 $this->fields[
'rowid'][
'visible'] = 0;
154 if (empty($conf->multicompany->enabled) && isset($this->fields[
'entity'])) {
155 $this->fields[
'entity'][
'enabled'] = 0;
165 foreach ($this->fields as $key => $val) {
166 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
167 unset($this->fields[$key]);
172 if (is_object($langs)) {
173 foreach ($this->fields as $key => $val) {
174 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
175 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
176 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
197 $groups =
GETPOST(
'groups',
'array:int');
198 if (empty($groups)) {
199 $groups = $this->usergroups;
201 if (!empty($groups)) {
202 foreach ($groups as $id_group) {
204 $ws_usergroup->fk_workstation = $id;
205 $ws_usergroup->fk_usergroup = $id_group;
206 $ws_usergroup->createCommon($user);
207 $this->usergroups[] = $id_group;
212 $resources =
GETPOST(
'resources',
'array:int');
213 if (empty($resources)) {
214 $resources = $this->resources;
216 if (!empty($resources)) {
217 foreach ($resources as $id_resource) {
219 $ws_resource->fk_workstation = $id;
220 $ws_resource->fk_resource = $id_resource;
221 $ws_resource->createCommon($user);
222 $this->resources[] = $id_resource;
238 global $langs, $extrafields;
243 $object =
new self($this->db);
248 $result = $object->fetch($fromid);
249 if ($result > 0 && !empty($object->table_element_line)) {
250 $object->fetchLines();
259 unset($object->fk_user_creat);
260 unset($object->import_key);
263 if (property_exists($object,
'ref')) {
264 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
266 if (property_exists($object,
'label')) {
267 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
269 if (property_exists($object,
'status')) {
270 $object->status = self::STATUS_DISABLED;
272 if (property_exists($object,
'date_creation')) {
273 $object->date_creation =
dol_now();
275 if (property_exists($object,
'date_modification')) {
276 $object->date_modification =
null;
280 if (is_array($object->array_options) && count($object->array_options) > 0) {
281 $extrafields->fetch_name_optionals_label($this->table_element);
282 foreach ($object->array_options as $key => $option) {
283 $shortkey = preg_replace(
'/options_/',
'', $key);
284 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
287 unset($object->array_options[$key]);
293 $object->context[
'createfromclone'] =
'createfromclone';
294 $result = $object->create($user);
297 $this->error = $object->error;
298 $this->errors = $object->errors;
310 if (property_exists($this,
'socid') && $this->socid == $object->socid) {
317 unset($object->context[
'createfromclone']);
324 $this->
db->rollback();
336 public function fetch($id, $ref =
null)
343 if ($result > 0 && !empty($this->table_element_line)) {
356 $this->lines = array();
374 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
384 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
385 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
386 $sql .=
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
388 $sql .=
' WHERE 1 = 1';
392 if (count($filter) > 0) {
393 foreach ($filter as $key => $value) {
394 if ($key ==
't.rowid') {
395 $sqlwhere[] = $key.
" = ".((int) $value);
396 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
397 $sqlwhere[] = $key.
" = '".$this->
db->idate($value).
"'";
398 } elseif ($key ==
'customsql') {
399 $sqlwhere[] = $value;
400 } elseif (strpos($value,
'%') ===
false) {
401 $sqlwhere[] = $key.
" IN (".$this->
db->sanitize($this->
db->escape($value)).
")";
403 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
407 if (count($sqlwhere) > 0) {
408 $sql .=
' AND ('.implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere).
')';
411 if (!empty($sortfield)) {
412 $sql .= $this->
db->order($sortfield, $sortorder);
414 if (!empty($limit)) {
415 $sql .= $this->
db->plimit($limit, $offset);
422 while ($i < ($limit ? min($limit, $num) : $num)) {
423 $obj = $this->
db->fetch_object(
$resql);
425 $record =
new self($this->db);
426 $record->setVarsFromFetchObj($obj);
428 $records[$record->id] = $record;
436 $this->errors[] =
'Error '.$this->db->lasterror();
437 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
454 $groups =
GETPOST(
'groups',
'array:int');
456 $this->usergroups=array();
458 foreach ($groups as $id_group) {
460 $ws_usergroup->fk_workstation = $this->id;
461 $ws_usergroup->fk_usergroup = $id_group;
462 $ws_usergroup->createCommon($user);
463 $this->usergroups[] = $id_group;
467 $resources =
GETPOST(
'resources',
'array:int');
469 $this->resources=array();
470 if (!empty($resources)) {
471 foreach ($resources as $id_resource) {
473 $ws_resource->fk_workstation = $this->id;
474 $ws_resource->fk_resource = $id_resource;
475 $ws_resource->createCommon($user);
476 $this->resources[] = $id_resource;
490 public function delete(
User $user, $notrigger =
false)
506 if ($this->status < 0) {
507 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
524 global $conf, $langs;
526 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
531 if ($this->status == self::STATUS_VALIDATED) {
532 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
549 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
554 $this->newref = $num;
558 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
559 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
560 $sql .=
" status = ".self::STATUS_VALIDATED;
561 if (!empty($this->fields[
'date_validation'])) {
562 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
564 if (!empty($this->fields[
'fk_user_valid'])) {
565 $sql .=
", fk_user_valid = ".$user->id;
567 $sql .=
" WHERE rowid = ".((int) $this->
id);
569 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
573 $this->error = $this->
db->lasterror();
577 if (!$error && !$notrigger) {
579 $result = $this->
call_trigger(
'WORKSTATION_VALIDATE', $user);
588 $this->oldref = $this->ref;
591 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
593 $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).
"'";
594 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'workstation/".$this->
db->escape($this->
ref).
"' and entity = ".$conf->entity;
597 $error++; $this->error = $this->
db->lasterror();
603 $dirsource = $conf->workstation->dir_output.
'/workstation/'.$oldref;
604 $dirdest = $conf->workstation->dir_output.
'/workstation/'.$newref;
605 if (!$error && file_exists($dirsource)) {
606 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
608 if (@rename($dirsource, $dirdest)) {
611 $listoffiles =
dol_dir_list($conf->workstation->dir_output.
'/workstation/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
612 foreach ($listoffiles as $fileentry) {
613 $dirsource = $fileentry[
'name'];
614 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
615 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
616 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
617 @rename($dirsource, $dirdest);
627 $this->status = self::STATUS_VALIDATED;
634 $this->
db->rollback();
651 $this->status = $status;
653 if (empty($status)) {
670 return $this->
setStatusCommon($user, self::STATUS_ENABLED, $notrigger,
'WORKSTATION_ENABLED');
683 return $this->
setStatusCommon($user, self::STATUS_DISABLED, $notrigger,
'WORKSTATION_DISABLED');
696 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
698 global $conf, $langs, $hookmanager;
700 if (!empty($conf->dol_no_mouse_hover)) {
706 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Workstation").
'</u>';
708 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
709 if (isset($this->status)) {
710 $label .=
'<br><b>'.$langs->trans(
"Status").
":</b> ".$this->
getLibStatut(5);
713 $url =
dol_buildpath(
'/workstation/workstation_card.php', 1).
'?id='.$this->id;
715 if ($option !=
'nolink') {
717 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
718 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
719 $add_save_lastsearch_values = 1;
721 if ($add_save_lastsearch_values) {
722 $url .=
'&save_lastsearch_values=1';
727 if (empty($notooltip)) {
728 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
729 $label = $langs->trans(
"ShowWorkstation");
730 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
732 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
733 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
735 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
738 $linkstart =
'<a href="'.$url.
'"';
739 $linkstart .= $linkclose.
'>';
742 $result .= $linkstart;
744 if (empty($this->showphoto_on_popup)) {
746 $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);
750 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
752 list($class, $module) = explode(
'@', $this->picto);
755 $filename = $filearray[0][
'name'];
756 if (!empty($filename)) {
757 $pospoint = strpos($filearray[0][
'name'],
'.');
759 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
760 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
761 $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>';
763 $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>';
768 $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);
773 if ($withpicto != 2) {
774 $result .= $this->ref;
780 global $action, $hookmanager;
781 $hookmanager->initHooks(array(
'workstationdao'));
782 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
783 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
785 $result = $hookmanager->resPrint;
787 $result .= $hookmanager->resPrint;
801 return $this->LibStatut($this->status, $mode);
815 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
818 $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv(
'Disabled');
819 $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv(
'Enabled');
820 $this->labelStatusShort[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv(
'Disabled');
821 $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv(
'Enabled');
824 $statusType =
'status'.$status;
826 if ($status == self::STATUS_ENABLED) $statusType =
'status4';
828 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
839 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
840 $sql .=
' fk_user_creat, fk_user_modif';
841 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
842 $sql .=
' WHERE t.rowid = '.((int) $id);
843 $result = $this->
db->query($sql);
845 if ($this->
db->num_rows($result)) {
846 $obj = $this->
db->fetch_object($result);
847 $this->
id = $obj->rowid;
849 $this->user_creation_id = $obj->fk_user_creat;
850 $this->user_modification_id = $obj->fk_user_modif;
851 $this->date_creation = $this->
db->jdate($obj->datec);
852 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
855 $this->
db->free($result);
869 $this->initAsSpecimenCommon();
879 $this->lines = array();
904 global $langs, $conf;
905 $langs->load(
"workstation");
907 if (empty($conf->global->WORKSTATION_WORKSTATION_ADDON)) {
908 $conf->global->WORKSTATION_WORKSTATION_ADDON =
'mod_workstation_standard';
911 if (!empty($conf->global->WORKSTATION_WORKSTATION_ADDON)) {
914 $file = $conf->global->WORKSTATION_WORKSTATION_ADDON.
".php";
915 $classname = $conf->global->WORKSTATION_WORKSTATION_ADDON;
918 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
919 foreach ($dirmodels as $reldir) {
923 $mybool |= @include_once $dir.$file;
926 if ($mybool ===
false) {
931 if (class_exists($classname)) {
932 $obj =
new $classname();
933 $numref = $obj->getNextValue($this);
935 if ($numref !=
'' && $numref !=
'-1') {
938 $this->error = $obj->error;
943 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
947 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
963 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
965 global $conf, $langs;
968 $includedocgeneration = 0;
970 $langs->load(
"workstation");
973 $modele =
'standard_workstation';
975 if ($this->model_pdf) {
976 $modele = $this->model_pdf;
977 } elseif (!empty($conf->global->WORKSTATION_ADDON_PDF)) {
978 $modele = $conf->global->WORKSTATION_ADDON_PDF;
982 $modelpath =
"core/modules/workstation/doc/";
984 if ($includedocgeneration) {
985 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1000 global $conf, $langs;
1016 $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.