29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
41 public $module =
'hrm';
46 public $element =
'job';
51 public $table_element =
'hrm_job';
57 public $ismultientitymanaged = 0;
62 public $isextrafieldmanaged = 1;
67 public $picto =
'technic';
70 const STATUS_DRAFT = 0;
71 const STATUS_VALIDATED = 1;
72 const STATUS_CANCELED = 9;
105 public $fields=array(
106 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
107 'label' => array(
'type'=>
'varchar(128)',
'label'=>
'Label',
'enabled'=>
'1',
'position'=>20,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'searchall'=>1,
'showoncombobox'=>
'1',
'comment'=>
"Label of object"),
108 'description' => array(
'type'=>
'text',
'label'=>
'Description',
'enabled'=>
'1',
'position'=>21,
'notnull'=>0,
'visible'=>1,),
109 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>2,),
110 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>2,),
111 'deplacement' => array(
'type'=>
'select',
'required'=> 1,
'label'=>
'NeedBusinessTravels',
'enabled'=> 1,
'position'=> 90,
'notnull'=> 1,
'visible'=> 1,
'arrayofkeyval'=> array(0 =>
"No", 1=>
"Yes"),
'default'=>0),
112 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>70,
'notnull'=>0,
'visible'=>0,),
113 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>71,
'notnull'=>0,
'visible'=>0,),
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,),
120 public $date_creation;
124 public $note_private;
125 public $fk_user_creat;
126 public $fk_user_modif;
140 public $fk_element =
'fk_job';
150 protected $childtables = array(
'hrm_evaluation',
'hrm_job_user');
157 protected $childtablesoncascade = array(
"@SkillRank:hrm/class/skillrank.class.php:fk_object:objecttype='job'");
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 (empty($conf->multicompany->enabled) && 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);
222 return $resultcreate;
234 global $langs, $extrafields;
239 $object =
new self($this->db);
244 $result = $object->fetchCommon($fromid);
245 if ($result > 0 && !empty($object->table_element_line)) {
246 $object->fetchLines();
255 unset($object->fk_user_creat);
256 unset($object->import_key);
259 if (property_exists($object,
'ref')) {
260 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"Copy_Of_".$object->ref : $this->fields[
'ref'][
'default'];
262 if (property_exists($object,
'label')) {
263 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
265 if (property_exists($object,
'status')) {
266 $object->status = self::STATUS_DRAFT;
268 if (property_exists($object,
'date_creation')) {
269 $object->date_creation =
dol_now();
271 if (property_exists($object,
'date_modification')) {
272 $object->date_modification = null;
276 if (is_array($object->array_options) && count($object->array_options) > 0) {
277 $extrafields->fetch_name_optionals_label($this->table_element);
278 foreach ($object->array_options as $key => $option) {
279 $shortkey = preg_replace(
'/options_/',
'', $key);
280 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
282 unset($object->array_options[$key]);
288 $object->context[
'createfromclone'] =
'createfromclone';
289 $result = $object->createCommon($user);
292 $this->error = $object->error;
293 $this->errors = $object->errors;
305 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
312 unset($object->context[
'createfromclone']);
319 $this->
db->rollback();
331 public function fetch($id, $ref = null)
334 if ($result > 0 && !empty($this->table_element_line)) {
347 $this->lines = array();
365 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
375 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
376 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
377 $sql .=
' WHERE t.entity IN ('.getEntity($this->table_element).
')';
379 $sql .=
' WHERE 1 = 1';
383 if (count($filter) > 0) {
384 foreach ($filter as $key => $value) {
385 if ($key ==
't.rowid') {
386 $sqlwhere[] = $key.
'='.$value;
387 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
388 $sqlwhere[] = $key.
' = \''.$this->
db->idate($value).
'\'';
389 } elseif ($key ==
'customsql') {
390 $sqlwhere[] = $value;
391 } elseif (strpos($value,
'%') ===
false) {
392 $sqlwhere[] = $key.
' IN ('.$this->
db->sanitize($this->
db->escape($value)).
')';
394 $sqlwhere[] = $key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
398 if (count($sqlwhere) > 0) {
399 $sql .=
" AND (".implode(
" ".$filtermode.
" ", $sqlwhere).
")";
402 if (!empty($sortfield)) {
403 $sql .= $this->
db->order($sortfield, $sortorder);
405 if (!empty($limit)) {
406 $sql .=
' '.$this->db->plimit($limit, $offset);
413 while ($i < ($limit ? min($limit, $num) : $num)) {
414 $obj = $this->
db->fetch_object(
$resql);
416 $record =
new self($this->db);
417 $record->setVarsFromFetchObj($obj);
419 $records[$record->id] = $record;
427 $this->errors[] =
'Error '.$this->db->lasterror();
428 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
453 public function delete(
User $user, $notrigger =
false)
469 if ($this->status < 0) {
470 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
487 global $conf, $langs;
489 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
494 if ($this->status == self::STATUS_VALIDATED) {
495 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
512 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
517 $this->newref = $num;
521 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
522 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
523 $sql .=
" status = ".self::STATUS_VALIDATED;
524 if (!empty($this->fields[
'date_validation'])) {
525 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
527 if (!empty($this->fields[
'fk_user_valid'])) {
528 $sql .=
", fk_user_valid = ".((int) $user->id);
530 $sql .=
" WHERE rowid = ".((int) $this->
id);
532 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
536 $this->error = $this->
db->lasterror();
540 if (!$error && !$notrigger) {
551 $this->oldref = $this->ref;
554 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
556 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->
db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'job/".$this->
db->escape($this->newref).
"'";
557 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'job/".$this->
db->escape($this->
ref).
"' and entity = ".$conf->entity;
560 $error++; $this->error = $this->
db->lasterror();
566 $dirsource = $conf->hrm->dir_output.
'/job/'.$oldref;
567 $dirdest = $conf->hrm->dir_output.
'/job/'.$newref;
568 if (!$error && file_exists($dirsource)) {
569 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
571 if (@rename($dirsource, $dirdest)) {
574 $listoffiles =
dol_dir_list($conf->hrm->dir_output.
'/job/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
575 foreach ($listoffiles as $fileentry) {
576 $dirsource = $fileentry[
'name'];
577 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
578 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
579 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
580 @rename($dirsource, $dirdest);
590 $this->status = self::STATUS_VALIDATED;
597 $this->
db->rollback();
613 $Tab = $j->getForUser($fk_user);
615 if (empty($Tab))
return '';
617 $job = array_shift($Tab);
634 $TPosition = $position->getForUser($userid);
635 foreach ($TPosition as $UPosition) {
636 $TReturn[$UPosition->Job->rowid] = $UPosition->Job->ref;
651 if ($this->status <= self::STATUS_DRAFT) {
662 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'JOB_UNVALIDATE');
672 public function cancel($user, $notrigger = 0)
675 if ($this->status != self::STATUS_VALIDATED) {
686 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'JOB_CANCEL');
696 public function reopen($user, $notrigger = 0)
699 if ($this->status != self::STATUS_CANCELED) {
710 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'JOB_REOPEN');
723 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
725 global $conf, $langs, $hookmanager;
727 if (!empty($conf->dol_no_mouse_hover)) {
733 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Job").
'</u>';
734 if (isset($this->status)) {
735 $label .=
' '.$this->getLibStatut(5);
738 $label .=
'<b>'.$langs->trans(
'Label').
':</b> '.$this->label;
740 $url =
dol_buildpath(
'/hrm/job_card.php', 1).
'?id='.$this->id;
742 if ($option !=
'nolink') {
744 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
745 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
746 $add_save_lastsearch_values = 1;
748 if ($add_save_lastsearch_values) {
749 $url .=
'&save_lastsearch_values=1';
754 if (empty($notooltip)) {
755 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
756 $label = $langs->trans(
"ShowJob");
757 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
759 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
760 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
762 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
765 if ($option ==
'nolink') {
766 $linkstart =
'<span';
768 $linkstart =
'<a href="'.$url.
'"';
770 $linkstart .= $linkclose.
'>';
771 if ($option ==
'nolink') {
772 $linkend =
'</span>';
777 $result .= $linkstart;
779 if (empty($this->showphoto_on_popup)) {
781 $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);
785 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
787 list($class, $module) = explode(
'@', $this->picto);
788 $upload_dir = $conf->$module->multidir_output[$conf->entity].
"/$class/".
dol_sanitizeFileName($this->label);
790 $filename = $filearray[0][
'name'];
791 if (!empty($filename)) {
792 $pospoint = strpos($filearray[0][
'name'],
'.');
794 $pathtophoto = $class.
'/'.$this->label.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
795 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
796 $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>';
798 $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>';
803 $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);
808 if ($withpicto != 2) {
809 $result .= $this->label;
815 global $action, $hookmanager;
816 $hookmanager->initHooks(array(
'jobdao'));
817 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
818 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
820 $result = $hookmanager->resPrint;
822 $result .= $hookmanager->resPrint;
836 return $this->LibStatut($this->status, $mode);
850 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
853 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
854 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
855 $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
856 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Draft');
857 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Enabled');
858 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv(
'Disabled');
861 $statusType =
'status'.$status;
863 if ($status == self::STATUS_CANCELED) {
864 $statusType =
'status6';
867 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
878 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
879 $sql .=
' fk_user_creat, fk_user_modif';
880 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
881 $sql .=
' WHERE t.rowid = '.((int) $id);
882 $result = $this->
db->query($sql);
884 if ($this->
db->num_rows($result)) {
885 $obj = $this->
db->fetch_object($result);
886 $this->
id = $obj->rowid;
888 $this->user_creation_id = $obj->fk_user_creat;
889 $this->user_modification_id = $obj->fk_user_modif;
890 $this->date_creation = $this->
db->jdate($obj->datec);
891 $this->date_modification = empty($obj->datem) ?
'' : $this->
db->jdate($obj->datem);
894 $this->
db->free($result);
912 $this->initAsSpecimenCommon();
922 $this->lines = array();
925 $result = $objectline->fetchAll(
'ASC',
'position', 0, 0, array(
'customsql'=>
'fk_job = '.$this->
id));
927 if (is_numeric($result)) {
928 $this->error = $this->error;
929 $this->errors = $this->errors;
932 $this->lines = $result;
944 global $langs, $conf;
947 if (empty($conf->global->hrm_JOB_ADDON)) {
948 $conf->global->hrm_JOB_ADDON =
'mod_job_standard';
951 if (!empty($conf->global->hrm_JOB_ADDON)) {
954 $file = $conf->global->hrm_JOB_ADDON.
".php";
955 $classname = $conf->global->hrm_JOB_ADDON;
958 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
959 foreach ($dirmodels as $reldir) {
963 $mybool |= @include_once $dir.$file;
966 if ($mybool ===
false) {
971 if (class_exists($classname)) {
972 $obj =
new $classname();
973 $numref = $obj->getNextValue($this);
975 if ($numref !=
'' && $numref !=
'-1') {
978 $this->error = $obj->error;
983 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
987 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1003 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
1005 global $conf, $langs;
1008 $includedocgeneration = 0;
1010 $langs->load(
"hrm");
1013 $modele =
'standard_job';
1015 if (!empty($this->model_pdf)) {
1016 $modele = $this->model_pdf;
1017 } elseif (!empty($conf->global->JOB_ADDON_PDF)) {
1018 $modele = $conf->global->JOB_ADDON_PDF;
1022 $modelpath =
"core/modules/hrm/doc/";
1024 if ($includedocgeneration && !empty($modele)) {
1025 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1040 global $conf, $langs;
1056 $this->
db->commit();
1063 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
1076 public $isextrafieldmanaged = 0;
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
info($id)
Load the info information in the object.
create(User $user, $notrigger=false)
Create object into database.
fetchLinesCommon($morewhere= '')
Load object in memory from the database.
$conf db
API class for accounts.
__construct(DoliDB $db)
Constructor.
dol_now($mode= 'auto')
Return date for now.
getForUser($userid)
Get jobs for user.
Class to manage Dolibarr users.
Class to manage Dolibarr database access.
__construct(DoliDB $db)
Constructor.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
cancel($user, $notrigger=0)
Set cancel status.
createCommon(User $user, $notrigger=false)
Create object into database.
getLinesArray()
Create an array of lines.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
fetchLines()
Load object lines in memory from the database.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
getLastJobForUser($fk_user)
Get last job for user.
fetch($id, $ref=null)
Load object in memory from the database.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
getFieldList($alias= '')
Function to concat keys of fields.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
LibStatut($status, $mode=0)
Return the status.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
getNomUrl($withpicto=0, $option= '', $notooltip=0, $morecss= '', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
updateCommon(User $user, $notrigger=false)
Update object into database.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
copy_linked_contact($objFrom, $source= 'internal')
Copy contact from one element to current.
validate($user, $notrigger=0)
Validate object.
call_trigger($triggerName, $user)
Call trigger based on this instance.
getLibStatut($mode=0)
Return the label of the status.
update(User $user, $notrigger=false)
Update object into database.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
setStatusCommon($user, $status, $notrigger=0, $triggercode= '')
Set to a status.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
dolGetStatus($statusLabel= '', $statusLabelShort= '', $html= '', $statusType= 'status0', $displayMode=0, $url= '', $params=array())
Output the badge of a status.
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.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
reopen($user, $notrigger=0)
Set back to validated status.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
setDraft($user, $notrigger=0)
Set draft status.
fetchCommon($id, $ref=null, $morewhere= '')
Load object in memory from the database.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module...