29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
 
   30 require_once DOL_DOCUMENT_ROOT . 
'/hrm/lib/hrm_skillrank.lib.php';
 
   40   public $module = 
'hrm';
 
   45   public $element = 
'skillrank';
 
   50   public $table_element = 
'hrm_skillrank';
 
   56   public $ismultientitymanaged = 0;
 
   61   public $isextrafieldmanaged = 0;
 
   66   public $picto = 
'skillrank@hrm';
 
   69   const STATUS_DRAFT = 0;
 
   70   const STATUS_VALIDATED = 1;
 
   71   const STATUS_CANCELED = 9;
 
   73   const SKILLRANK_TYPE_JOB = 
"job";
 
   74   const SKILLRANK_TYPE_USER = 
"user";
 
   75   const SKILLRANK_TYPE_EVALDET = 
"evaluationdet";
 
  107   public $fields=array(
 
  108     'rowid' => array(
'type'=>
'integer', 
'label'=>
'TechnicalID', 
'enabled'=>
'1', 
'position'=>1, 
'notnull'=>1, 
'visible'=>0, 
'noteditable'=>
'1', 
'index'=>1, 
'css'=>
'left', 
'comment'=>
"Id"),
 
  109     'fk_skill' => array(
'type'=>
'integer:Skill:hrm/class/skill.class.php:1', 
'label'=>
'Skill', 
'enabled'=>
'1', 
'position'=>3, 
'notnull'=>1, 
'visible'=>1, 
'index'=>1,),
 
  110     'rankorder' => array(
'type'=>
'integer', 
'label'=>
'Rank', 
'enabled'=>
'1', 
'position'=>4, 
'notnull'=>1, 
'visible'=>1, 
'default' => 0),
 
  111     'fk_object' => array(
'type'=>
'integer', 
'label'=>
'object', 
'enabled'=>
'1', 
'position'=>5, 
'notnull'=>1, 
'visible'=>0,),
 
  112     'date_creation' => array(
'type'=>
'datetime', 
'label'=>
'DateCreation', 
'enabled'=>
'1', 
'position'=>500, 
'notnull'=>1, 
'visible'=>-2,),
 
  113     'tms' => array(
'type'=>
'timestamp', 
'label'=>
'DateModification', 
'enabled'=>
'1', 
'position'=>501, 
'notnull'=>0, 
'visible'=>-2,),
 
  114     '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',),
 
  115     'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php', 
'label'=>
'UserModif', 
'enabled'=>
'1', 
'position'=>511, 
'notnull'=>-1, 
'visible'=>-2,),
 
  116     'objecttype' => array(
'type'=>
'varchar(128)', 
'label'=>
'objecttype', 
'enabled'=>
'1', 
'position'=>6, 
'notnull'=>1, 
'visible'=>0,),
 
  122   public $date_creation;
 
  124   public $fk_user_creat;
 
  125   public $fk_user_modif;
 
  173     global $conf, $langs;
 
  177     if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
 
  178       $this->fields[
'rowid'][
'visible'] = 0;
 
  180     if (!
isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
 
  181       $this->fields[
'entity'][
'enabled'] = 0;
 
  191     foreach ($this->fields as $key => $val) {
 
  192       if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
 
  193         unset($this->fields[$key]);
 
  198     if (is_object($langs)) {
 
  199       foreach ($this->fields as $key => $val) {
 
  200         if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
 
  201           foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
 
  202             $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
 
  220     $sqlfilter = 
'fk_object='.((int) $this->fk_object).
" AND objecttype='".$this->
db->escape($this->objecttype).
"' AND fk_skill = ".((int) $this->fk_skill);
 
  221     $alreadyLinked = $this->
fetchAll(
'ASC', 
'rowid', 0, 0, array(
'customsql' => $sqlfilter));
 
  222     if (!empty($alreadyLinked)) {
 
  223       $this->error = $langs->trans(
'ErrSkillAlreadyAdded');
 
  229     return $resultcreate;
 
  241     global $langs, $extrafields;
 
  246     $object = 
new self($this->db);
 
  251     $result = $object->fetchCommon($fromid);
 
  252     if ($result > 0 && !empty($object->table_element_line)) {
 
  253       $object->fetchLines();
 
  262     unset($object->fk_user_creat);
 
  263     unset($object->import_key);
 
  266     if (property_exists($object, 
'ref')) {
 
  267       $object->ref = empty($this->fields[
'ref'][
'default']) ? 
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
 
  269     if (property_exists($object, 
'label')) {
 
  270       $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
 
  272     if (property_exists($object, 
'status')) {
 
  273       $object->status = self::STATUS_DRAFT;
 
  275     if (property_exists($object, 
'date_creation')) {
 
  276       $object->date_creation = 
dol_now();
 
  278     if (property_exists($object, 
'date_modification')) {
 
  279       $object->date_modification = 
null;
 
  283     if (is_array($object->array_options) && count($object->array_options) > 0) {
 
  284       $extrafields->fetch_name_optionals_label($this->table_element);
 
  285       foreach ($object->array_options as $key => $option) {
 
  286         $shortkey = preg_replace(
'/options_/', 
'', $key);
 
  287         if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
 
  289           unset($object->array_options[$key]);
 
  295     $object->context[
'createfromclone'] = 
'createfromclone';
 
  296     $result = $object->createCommon($user);
 
  299       $this->error = $object->error;
 
  300       $this->errors = $object->errors;
 
  312       if (property_exists($this, 
'fk_soc') && $this->fk_soc == $object->socid) {
 
  319     unset($object->context[
'createfromclone']);
 
  326       $this->
db->rollback();
 
  338   public function fetch($id, $ref = 
null)
 
  341     if ($result > 0 && !empty($this->table_element_line)) {
 
  354     $this->lines = array();
 
  373     $this->fk_skill     = $currentSkill->fk_skill;
 
  374     $this->rankorder      = $currentSkill->rankorder;
 
  375     $this->fk_object    = $fk_user;
 
  376     $this->date_creation  = 
dol_now();
 
  377     $this->fk_user_creat  = $user->id;
 
  378     $this->fk_user_modif  = $user->id;
 
  379     $this->objecttype   = self::SKILLRANK_TYPE_USER;
 
  380     $result =  $this->
create($user);
 
  396   public function fetchAll($sortorder = 
'', $sortfield = 
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 
'AND')
 
  406     $sql .= 
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
 
  407     if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
 
  408       $sql .= 
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
 
  410       $sql .= 
' WHERE 1 = 1';
 
  414     if (count($filter) > 0) {
 
  415       foreach ($filter as $key => $value) {
 
  416         if ($key == 
't.rowid') {
 
  417           $sqlwhere[] = $key.
" = ".((int) $value);
 
  418         } elseif ($key != 
'customsql' && in_array($this->fields[$key][
'type'], array(
'date', 
'datetime', 
'timestamp'))) {
 
  419           $sqlwhere[] = $key.
" = '".$this->
db->idate($value).
"'";
 
  420         } elseif ($key == 
'customsql') {
 
  421           $sqlwhere[] = $value;
 
  422         } elseif (strpos($value, 
'%') === 
false) {
 
  423           $sqlwhere[] = $key.
" IN (".$this->
db->sanitize($this->
db->escape($value)).
")";
 
  425           $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
 
  429     if (count($sqlwhere) > 0) {
 
  430       $sql .= 
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
 
  433     if (!empty($sortfield)) {
 
  434       $sql .= $this->
db->order($sortfield, $sortorder);
 
  436     if (!empty($limit)) {
 
  437       $sql .= 
' '.$this->db->plimit($limit, $offset);
 
  444       while ($i < ($limit ? min($limit, $num) : $num)) {
 
  445         $obj = $this->
db->fetch_object(
$resql);
 
  447         $record = 
new self($this->db);
 
  448         $record->setVarsFromFetchObj($obj);
 
  450         $records[$record->id] = $record;
 
  458       $this->errors[] = 
'Error '.$this->db->lasterror();
 
  459       dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
 
  484   public function delete(
User $user, $notrigger = 
false)
 
  500     if ($this->status < 0) {
 
  501       $this->error = 
'ErrorDeleteLineNotAllowedByObjectStatus';
 
  518     global $conf, $langs;
 
  520     require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
 
  525     if ($this->status == self::STATUS_VALIDATED) {
 
  526       dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
 
  543     if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) { 
 
  548     $this->newref = $num;
 
  552       $sql = 
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
 
  553       $sql .= 
" SET ref = '".$this->db->escape($num).
"',";
 
  554       $sql .= 
" status = ".self::STATUS_VALIDATED;
 
  555       if (!empty($this->fields[
'date_validation'])) {
 
  556         $sql .= 
", date_validation = '".$this->db->idate($now).
"'";
 
  558       if (!empty($this->fields[
'fk_user_valid'])) {
 
  559         $sql .= 
", fk_user_valid = ".((int) $user->id);
 
  561       $sql .= 
" WHERE rowid = ".((int) $this->
id);
 
  563       dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
 
  567         $this->error = $this->
db->lasterror();
 
  571       if (!$error && !$notrigger) {
 
  573         $result = $this->
call_trigger(
'SKILLRANK_VALIDATE', $user);
 
  582       $this->oldref = $this->ref;
 
  585       if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
 
  587         $sql = 
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->
db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'skillrank/".$this->
db->escape($this->newref).
"'";
 
  588         $sql .= 
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'skillrank/".$this->
db->escape($this->
ref).
"' and entity = ".((int) $conf->entity);
 
  591           $error++; $this->error = $this->
db->lasterror();
 
  597         $dirsource = $conf->hrm->dir_output.
'/skillrank/'.$oldref;
 
  598         $dirdest = $conf->hrm->dir_output.
'/skillrank/'.$newref;
 
  599         if (!$error && file_exists($dirsource)) {
 
  600           dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
 
  602           if (@rename($dirsource, $dirdest)) {
 
  605             $listoffiles = 
dol_dir_list($conf->hrm->dir_output.
'/skillrank/'.$newref, 
'files', 1, 
'^'.preg_quote($oldref, 
'/'));
 
  606             foreach ($listoffiles as $fileentry) {
 
  607               $dirsource = $fileentry[
'name'];
 
  608               $dirdest = preg_replace(
'/^'.preg_quote($oldref, 
'/').
'/', $newref, $dirsource);
 
  609               $dirsource = $fileentry[
'path'].
'/'.$dirsource;
 
  610               $dirdest = $fileentry[
'path'].
'/'.$dirdest;
 
  611               @rename($dirsource, $dirdest);
 
  621       $this->status = self::STATUS_VALIDATED;
 
  628       $this->
db->rollback();
 
  644     if ($this->status <= self::STATUS_DRAFT) {
 
  655     return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 
'SKILLRANK_UNVALIDATE');
 
  665   public function cancel($user, $notrigger = 0)
 
  668     if ($this->status != self::STATUS_VALIDATED) {
 
  679     return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 
'SKILLRANK_CANCEL');
 
  689   public function reopen($user, $notrigger = 0)
 
  692     if ($this->status != self::STATUS_CANCELED) {
 
  703     return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 
'SKILLRANK_REOPEN');
 
  716   public function getNomUrl($withpicto = 0, $option = 
'', $notooltip = 0, $morecss = 
'', $save_lastsearch_value = -1)
 
  718     global $conf, $langs, $hookmanager;
 
  720     if (!empty($conf->dol_no_mouse_hover)) {
 
  726     $label = 
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"SkillRank").
'</u>';
 
  727     if (isset($this->status)) {
 
  728       $label .= 
' '.$this->getLibStatut(5);
 
  731     $label .= 
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
 
  733     $url = 
dol_buildpath(
'/hrm/skillrank_card.php', 1).
'?id='.$this->id;
 
  735     if ($option != 
'nolink') {
 
  737       $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
 
  738       if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
 
  739         $add_save_lastsearch_values = 1;
 
  741       if ($add_save_lastsearch_values) {
 
  742         $url .= 
'&save_lastsearch_values=1';
 
  747     if (empty($notooltip)) {
 
  748       if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
 
  749         $label = $langs->trans(
"ShowSkillRank");
 
  750         $linkclose .= 
' alt="'.dol_escape_htmltag($label, 1).
'"';
 
  752       $linkclose .= 
' title="'.dol_escape_htmltag($label, 1).
'"';
 
  753       $linkclose .= 
' class="classfortooltip'.($morecss ? 
' '.$morecss : 
'').
'"';
 
  755       $linkclose = ($morecss ? 
' class="'.$morecss.
'"' : 
'');
 
  758     if ($option == 
'nolink') {
 
  759       $linkstart = 
'<span';
 
  761       $linkstart = 
'<a href="'.$url.
'"';
 
  763     $linkstart .= $linkclose.
'>';
 
  764     if ($option == 
'nolink') {
 
  765       $linkend = 
'</span>';
 
  770     $result .= $linkstart;
 
  772     if (empty($this->showphoto_on_popup)) {
 
  774         $result .= 
img_object(($notooltip ? 
'' : $label), ($this->picto ? $this->picto : 
'generic'), ($notooltip ? (($withpicto != 2) ? 
'class="paddingright"' : 
'') : 
'class="'.(($withpicto != 2) ? 
'paddingright ' : 
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
 
  778         require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
 
  780         list($class, $module) = explode(
'@', $this->picto);
 
  783         $filename = $filearray[0][
'name'];
 
  784         if (!empty($filename)) {
 
  785           $pospoint = strpos($filearray[0][
'name'], 
'.');
 
  787           $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
 
  788           if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
 
  789             $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>';
 
  791             $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>';
 
  796           $result .= 
img_object(($notooltip ? 
'' : $label), ($this->picto ? $this->picto : 
'generic'), ($notooltip ? (($withpicto != 2) ? 
'class="paddingright"' : 
'') : 
'class="'.(($withpicto != 2) ? 
'paddingright ' : 
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
 
  801     if ($withpicto != 2) {
 
  802       $result .= $this->ref;
 
  808     global $action, $hookmanager;
 
  809     $hookmanager->initHooks(array(
'skillrankdao'));
 
  810     $parameters = array(
'id'=>$this->
id, 
'getnomurl' => &$result);
 
  811     $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action); 
 
  813       $result = $hookmanager->resPrint;
 
  815       $result .= $hookmanager->resPrint;
 
  829     return $this->LibStatut($this->status, $mode);
 
  843     if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
 
  846       $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
 
  847       $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
 
  848       $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
 
  849       $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
 
  850       $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
 
  851       $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
 
  854     $statusType = 
'status'.$status;
 
  856     if ($status == self::STATUS_CANCELED) {
 
  857       $statusType = 
'status6';
 
  860     return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], 
'', $statusType, $mode);
 
  871     $sql = 
'SELECT rowid, date_creation as datec, tms as datem,';
 
  872     $sql .= 
' fk_user_creat, fk_user_modif';
 
  873     $sql .= 
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
 
  874     $sql .= 
' WHERE t.rowid = '.((int) $id);
 
  875     $result = $this->
db->query($sql);
 
  877       if ($this->
db->num_rows($result)) {
 
  878         $obj = $this->
db->fetch_object($result);
 
  879         $this->
id = $obj->rowid;
 
  881         $this->user_creation_id = $obj->fk_user_creat;
 
  882         $this->user_modification_id = $obj->fk_user_modif;
 
  883         $this->date_creation     = $this->
db->jdate($obj->datec);
 
  884         $this->date_modification = empty($obj->datem) ? 
'' : $this->
db->jdate($obj->datem);
 
  887       $this->
db->free($result);
 
  905     $this->initAsSpecimenCommon();
 
  915     $this->lines = array();
 
  939     global $langs, $conf;
 
  942     if (empty($conf->global->hrm_SKILLRANK_ADDON)) {
 
  943       $conf->global->hrm_SKILLRANK_ADDON = 
'mod_skillrank_standard';
 
  946     if (!empty($conf->global->hrm_SKILLRANK_ADDON)) {
 
  949       $file = $conf->global->hrm_SKILLRANK_ADDON.
".php";
 
  950       $classname = $conf->global->hrm_SKILLRANK_ADDON;
 
  953       $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
 
  954       foreach ($dirmodels as $reldir) {
 
  958         $mybool |= @include_once $dir.$file;
 
  961       if ($mybool === 
false) {
 
  966       if (class_exists($classname)) {
 
  967         $obj = 
new $classname();
 
  968         $numref = $obj->getNextValue($this);
 
  970         if ($numref != 
'' && $numref != 
'-1') {
 
  973           $this->error = $obj->error;
 
  978         print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
 
  982       print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
 
  998   public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = 
null)
 
 1000     global $conf, $langs;
 
 1003     $includedocgeneration = 0;
 
 1005     $langs->load(
"hrm");
 
 1008       $modele = 
'standard_skillrank';
 
 1010       if (!empty($this->model_pdf)) {
 
 1011         $modele = $this->model_pdf;
 
 1012       } elseif (!empty($conf->global->SKILLRANK_ADDON_PDF)) {
 
 1013         $modele = $conf->global->SKILLRANK_ADDON_PDF;
 
 1017     $modelpath = 
"core/modules/hrm/doc/";
 
 1019     if ($includedocgeneration && !empty($modele)) {
 
 1020       $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
 
 1035     global $conf, $langs;
 
 1051     $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.
 
reopen($user, $notrigger=0)
Set back to validated status.
 
__construct(DoliDB $db)
Constructor.
 
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
 
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the database.
 
createFromClone(User $user, $fromid)
Clone an object into another one.
 
create(User $user, $notrigger=false)
Create object into database.
 
LibStatut($status, $mode=0)
Return the status.
 
setDraft($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)
 
fetchLines()
Load object lines in memory from the database.
 
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
 
fetch($id, $ref=null)
Load object in memory from the database.
 
cloneFromCurrentSkill($currentSkill, $fk_user)
Clone skillrank Object linked to job with user id The skillrank table is a join table that is marked ...
 
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
 
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
 
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.
 
validate($user, $notrigger=0)
Validate object.
 
getLibStatut($mode=0)
Return the label of the status.
 
cancel($user, $notrigger=0)
Set cancel status.
 
update(User $user, $notrigger=false)
Update object into database.
 
getLinesArray()
Create an array of lines.
 
Class to manage Dolibarr users.
 
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.
 
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.
 
isModEnabled($module)
Is Dolibarr module enabled.
 
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
 
$conf db
API class for accounts.