24 require_once DOL_DOCUMENT_ROOT.
"/core/class/commonobject.class.php";
25 require_once DOL_DOCUMENT_ROOT.
"/core/lib/functions2.lib.php";
35 public $element =
'dolresource';
40 public $table_element =
'resource';
45 public $picto =
'resource';
48 public $resource_type;
57 public $fk_user_create;
62 public $cache_code_type_resource = array();
83 public function create($user, $notrigger = 0)
85 global $conf, $langs, $hookmanager;
90 if (isset($this->ref)) $this->ref = trim($this->ref);
92 if (!is_numeric($this->country_id)) $this->country_id = 0;
93 if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource = trim($this->fk_code_type_resource);
94 if (isset($this->note_public)) $this->note_public = trim($this->note_public);
95 if (isset($this->note_private)) $this->note_private = trim($this->note_private);
99 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.$this->table_element.
"(";
102 $sql .=
"description,";
103 $sql .=
"fk_country,";
104 $sql .=
"fk_code_type_resource,";
105 $sql .=
"note_public,";
106 $sql .=
"note_private";
107 $sql .=
") VALUES (";
108 $sql .= $conf->entity.
", ";
109 $sql .=
" ".(!isset($this->ref) ?
'NULL' :
"'".$this->db->escape($this->ref).
"'").
",";
111 $sql .=
" ".($this->country_id > 0 ? $this->country_id :
'null').
",";
112 $sql .=
" ".(!isset($this->fk_code_type_resource) ?
'NULL' :
"'".$this->db->escape($this->fk_code_type_resource).
"'").
",";
113 $sql .=
" ".(!isset($this->note_public) ?
'NULL' :
"'".$this->db->escape($this->note_public).
"'").
",";
114 $sql .=
" ".(!isset($this->note_private) ?
'NULL' :
"'".$this->db->escape($this->note_private).
"'");
119 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
122 $error++; $this->errors[] =
"Error ".$this->db->lasterror();
127 $this->
id = $this->
db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
145 if (!$error && !$notrigger)
148 $result = $this->
call_trigger(
'RESOURCE_CREATE', $user);
149 if ($result < 0) $error++;
156 foreach ($this->errors as $errmsg)
158 dol_syslog(get_class($this).
"::create ".$errmsg, LOG_ERR);
159 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
161 $this->
db->rollback();
176 public function fetch($id, $ref =
'')
181 $sql .=
" t.entity,";
183 $sql .=
" t.description,";
184 $sql .=
" t.fk_country,";
185 $sql .=
" t.fk_code_type_resource,";
186 $sql .=
" t.note_public,";
187 $sql .=
" t.note_private,";
189 $sql .=
" ty.label as type_label";
190 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
191 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_type_resource as ty ON ty.code=t.fk_code_type_resource";
192 if ($id) $sql .=
" WHERE t.rowid = ".$this->db->escape($id);
193 else $sql .=
" WHERE t.ref = '".$this->db->escape($ref).
"'";
195 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
201 $obj = $this->
db->fetch_object(
$resql);
203 $this->
id = $obj->rowid;
204 $this->entity = $obj->entity;
205 $this->ref = $obj->ref;
207 $this->country_id = $obj->fk_country;
208 $this->fk_code_type_resource = $obj->fk_code_type_resource;
209 $this->note_public = $obj->note_public;
210 $this->note_private = $obj->note_private;
211 $this->type_label = $obj->type_label;
221 $this->error =
"Error ".$this->db->lasterror();
222 dol_syslog(get_class($this).
"::fetch ".$this->error, LOG_ERR);
235 public function update($user = null, $notrigger = 0)
237 global $conf, $langs, $hookmanager;
241 if (isset($this->ref)) $this->ref = trim($this->ref);
242 if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource = trim($this->fk_code_type_resource);
244 if (!is_numeric($this->country_id)) $this->country_id = 0;
246 if (empty($this->oldcopy))
248 $org =
new self($this->db);
249 $org->fetch($this->
id);
250 $this->oldcopy = $org;
254 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element.
" SET";
255 $sql .=
" ref=".(isset($this->ref) ?
"'".$this->db->escape($this->ref).
"'" :
"null").
",";
256 $sql .=
" description=".(isset($this->
description) ?
"'".$this->db->escape($this->
description).
"'" :
"null").
",";
257 $sql .=
" fk_country=".($this->country_id > 0 ? $this->country_id :
"null").
",";
258 $sql .=
" fk_code_type_resource=".(isset($this->fk_code_type_resource) ?
"'".$this->db->escape($this->fk_code_type_resource).
"'" :
"null").
",";
259 $sql .=
" tms=".(dol_strlen($this->tms) != 0 ?
"'".$this->db->idate($this->tms).
"'" :
'null').
"";
260 $sql .=
" WHERE rowid=".$this->id;
264 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
266 if (!
$resql) { $error++; $this->errors[] =
"Error ".$this->db->lasterror(); }
273 $result = $this->
call_trigger(
'RESOURCE_MODIFY', $user);
274 if ($result < 0) $error++;
279 if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
282 if (!empty($conf->resource->dir_output))
286 if (file_exists($olddir))
288 $res = @rename($olddir, $newdir);
291 $langs->load(
"errors");
292 $this->error = $langs->trans(
'ErrorFailToRenameDir', $olddir, $newdir);
317 foreach ($this->errors as $errmsg)
319 dol_syslog(get_class($this).
"::update ".$errmsg, LOG_ERR);
320 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
322 $this->
db->rollback();
343 $sql .=
" t.resource_id,";
344 $sql .=
" t.resource_type,";
345 $sql .=
" t.element_id,";
346 $sql .=
" t.element_type,";
348 $sql .=
" t.mandatory,";
349 $sql .=
" t.fk_user_create,";
351 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as t";
352 $sql .=
" WHERE t.rowid = ".$this->db->escape($id);
354 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
360 $obj = $this->
db->fetch_object(
$resql);
362 $this->
id = $obj->rowid;
363 $this->resource_id = $obj->resource_id;
364 $this->resource_type = $obj->resource_type;
365 $this->element_id = $obj->element_id;
366 $this->element_type = $obj->element_type;
367 $this->busy = $obj->busy;
368 $this->mandatory = $obj->mandatory;
369 $this->fk_user_create = $obj->fk_user_create;
371 if ($obj->resource_id && $obj->resource_type) {
374 if ($obj->element_id && $obj->element_type) {
382 $this->error =
"Error ".$this->db->lasterror();
394 public function delete($rowid, $notrigger = 0)
396 global $user, $langs, $conf;
397 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
403 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
404 $sql .=
" WHERE rowid =".$rowid;
407 if ($this->
db->query($sql))
409 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"element_resources";
410 $sql .=
" WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid);
411 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
415 $this->error = $this->
db->lasterror();
419 $this->error = $this->
db->lasterror();
429 dol_syslog(get_class($this).
"::delete error -3 ".$this->error, LOG_ERR);
436 $result = $this->
call_trigger(
'RESOURCE_DELETE', $user);
437 if ($result < 0) $error++;
445 if (!empty($conf->resource->dir_output))
448 if (file_exists($dir))
453 $this->errors[] =
'ErrorFailToDeleteDir';
465 $this->
db->rollback();
481 public function fetch_all($sortorder, $sortfield, $limit, $offset, $filter =
'')
486 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
491 $sql .=
" t.entity,";
493 $sql .=
" t.description,";
494 $sql .=
" t.fk_code_type_resource,";
497 if (!empty($extrafields->attributes[$this->table_element][
'label']))
498 foreach ($extrafields->attributes[$this->table_element][
'label'] as $key => $val) $sql .= ($extrafields->attributes[$this->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
' as options_'.$key.
', ' :
'');
499 $sql .=
" ty.label as type_label";
500 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
501 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_type_resource as ty ON ty.code=t.fk_code_type_resource";
502 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$this->table_element.
"_extrafields as ef ON ef.fk_object=t.rowid";
503 $sql .=
" WHERE t.entity IN (".getEntity(
'resource').
")";
505 if (!empty($filter)) {
506 foreach ($filter as $key => $value) {
507 if (strpos($key,
'date')) {
508 $sql .=
' AND '.$key.
' = \''.$this->
db->idate($value).
'\'';
509 } elseif (strpos($key,
'ef.') !==
false) {
512 $sql .=
' AND '.$key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
516 $sql .= $this->
db->order($sortfield, $sortorder);
518 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
520 $result = $this->
db->query($sql);
521 $this->num_all = $this->
db->num_rows($result);
523 if ($limit) $sql .= $this->
db->plimit($limit, $offset);
524 dol_syslog(get_class($this).
"::fetch_all", LOG_DEBUG);
526 $this->lines = array();
533 while ($obj = $this->
db->fetch_object(
$resql))
536 $line->id = $obj->rowid;
537 $line->ref = $obj->ref;
538 $line->description = $obj->description;
539 $line->country_id = $obj->fk_country;
540 $line->fk_code_type_resource = $obj->fk_code_type_resource;
541 $line->type_label = $obj->type_label;
545 $line->fetch_optionals();
547 $this->lines[] = $line;
553 $this->error = $this->
db->lasterror();
575 $sql .=
" t.resource_id,";
576 $sql .=
" t.resource_type,";
577 $sql .=
" t.element_id,";
578 $sql .=
" t.element_type,";
580 $sql .=
" t.mandatory,";
581 $sql .=
" t.fk_user_create,";
583 $sql .=
' FROM '.MAIN_DB_PREFIX.
'element_resources as t ';
584 $sql .=
" WHERE t.entity IN (".getEntity(
'resource').
")";
587 if (!empty($filter)) {
588 foreach ($filter as $key => $value) {
589 if (strpos($key,
'date')) {
590 $sql .=
' AND '.$key.
' = \''.$this->
db->idate($value).
'\'';
592 $sql .=
' AND '.$key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
596 $sql .= $this->
db->order($sortfield, $sortorder);
597 if ($limit) $sql .= $this->
db->plimit($limit + 1, $offset);
598 dol_syslog(get_class($this).
"::fetch_all", LOG_DEBUG);
606 while ($obj = $this->
db->fetch_object(
$resql))
609 $line->id = $obj->rowid;
610 $line->resource_id = $obj->resource_id;
611 $line->resource_type = $obj->resource_type;
612 $line->element_id = $obj->element_id;
613 $line->element_type = $obj->element_type;
614 $line->busy = $obj->busy;
615 $line->mandatory = $obj->mandatory;
616 $line->fk_user_create = $obj->fk_user_create;
618 if ($obj->resource_id && $obj->resource_type)
620 if ($obj->element_id && $obj->element_type)
622 $this->lines[] = $line;
628 $this->error = $this->
db->lasterror();
644 public function fetch_all_used($sortorder, $sortfield, $limit, $offset = 1, $filter =
'')
649 if (!$sortorder) $sortorder =
"ASC";
650 if (!$sortfield) $sortfield =
"t.rowid";
654 $sql .=
" t.resource_id,";
655 $sql .=
" t.resource_type,";
656 $sql .=
" t.element_id,";
657 $sql .=
" t.element_type,";
659 $sql .=
" t.mandatory,";
660 $sql .=
" t.fk_user_create,";
662 $sql .=
' FROM '.MAIN_DB_PREFIX.
'element_resources as t ';
663 $sql .=
" WHERE t.entity IN (".getEntity(
'resource').
")";
666 if (!empty($filter)) {
667 foreach ($filter as $key => $value) {
668 if (strpos($key,
'date')) {
669 $sql .=
' AND '.$key.
' = \''.$this->
db->idate($value).
'\'';
671 $sql .=
' AND '.$key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
675 $sql .= $this->
db->order($sortfield, $sortorder);
676 if ($limit) $sql .= $this->
db->plimit($limit + 1, $offset);
677 dol_syslog(get_class($this).
"::fetch_all", LOG_DEBUG);
685 $this->lines = array();
686 while ($obj = $this->
db->fetch_object(
$resql))
689 $line->id = $obj->rowid;
690 $line->resource_id = $obj->resource_id;
691 $line->resource_type = $obj->resource_type;
692 $line->element_id = $obj->element_id;
693 $line->element_type = $obj->element_type;
694 $line->busy = $obj->busy;
695 $line->mandatory = $obj->mandatory;
696 $line->fk_user_create = $obj->fk_user_create;
704 $this->error = $this->
db->lasterror();
723 if (!empty($conf->modules_parts[
'resources']))
725 $this->available_resources = (array) $conf->modules_parts[
'resources'];
727 return count($this->available_resources);
743 global $conf, $langs;
747 if (isset($this->resource_id)) $this->resource_id = trim($this->resource_id);
748 if (isset($this->resource_type)) $this->resource_type = trim($this->resource_type);
749 if (isset($this->element_id)) $this->element_id = trim($this->element_id);
750 if (isset($this->element_type)) $this->element_type = trim($this->element_type);
751 if (isset($this->busy)) $this->busy = trim($this->busy);
752 if (isset($this->mandatory)) $this->mandatory = trim($this->mandatory);
755 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"element_resources SET";
756 $sql .=
" resource_id=".(isset($this->resource_id) ?
"'".$this->db->escape($this->resource_id).
"'" :
"null").
",";
757 $sql .=
" resource_type=".(isset($this->resource_type) ?
"'".$this->db->escape($this->resource_type).
"'" :
"null").
",";
758 $sql .=
" element_id=".(isset($this->element_id) ? $this->element_id :
"null").
",";
759 $sql .=
" element_type=".(isset($this->element_type) ?
"'".$this->db->escape($this->element_type).
"'" :
"null").
",";
760 $sql .=
" busy=".(isset($this->busy) ? $this->busy :
"null").
",";
761 $sql .=
" mandatory=".(isset($this->mandatory) ? $this->mandatory :
"null").
",";
762 $sql .=
" tms=".(dol_strlen($this->tms) != 0 ?
"'".$this->db->idate($this->tms).
"'" :
'null').
"";
764 $sql .=
" WHERE rowid=".$this->id;
768 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
770 if (!
$resql) { $error++; $this->errors[] =
"Error ".$this->db->lasterror(); }
777 $result = $this->
call_trigger(
'RESOURCE_MODIFY', $user);
778 if ($result < 0) $error++;
786 foreach ($this->errors as $errmsg)
788 dol_syslog(get_class($this).
"::update ".$errmsg, LOG_ERR);
789 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
791 $this->
db->rollback();
810 $resources = array();
813 $sql =
'SELECT rowid, resource_id, resource_type, busy, mandatory';
814 $sql .=
' FROM '.MAIN_DB_PREFIX.
'element_resources';
815 $sql .=
" WHERE element_id=".$element_id.
" AND element_type='".$this->
db->escape($element).
"'";
817 $sql .=
" AND resource_type LIKE '%".$this->db->escape($resource_type).
"%'";
818 $sql .=
' ORDER BY resource_type';
820 dol_syslog(get_class($this).
"::getElementResources", LOG_DEBUG);
822 $resources = array();
830 $obj = $this->
db->fetch_object(
$resql);
832 $resources[$i] = array(
833 'rowid' => $obj->rowid,
834 'resource_id' => $obj->resource_id,
835 'resource_type'=>$obj->resource_type,
837 'mandatory'=>$obj->mandatory
857 foreach ($resources as $nb => $resource) {
876 if (is_array($this->cache_code_type_resource) && count($this->cache_code_type_resource))
return 0;
878 $sql =
"SELECT rowid, code, label, active";
879 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_type_resource";
880 $sql .=
" WHERE active > 0";
881 $sql .=
" ORDER BY rowid";
882 dol_syslog(get_class($this).
"::load_cache_code_type_resource", LOG_DEBUG);
890 $obj = $this->
db->fetch_object(
$resql);
892 $label = ($langs->trans(
"ResourceTypeShort".$obj->code) != (
"ResourceTypeShort".$obj->code) ? $langs->trans(
"ResourceTypeShort".$obj->code) : ($obj->label !=
'-' ? $obj->label :
''));
893 $this->cache_code_type_resource[$obj->rowid][
'code'] = $obj->code;
894 $this->cache_code_type_resource[$obj->rowid][
'label'] = $label;
895 $this->cache_code_type_resource[$obj->rowid][
'active'] = $obj->active;
916 public function getNomUrl($withpicto = 0, $option =
'', $get_params =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
918 global $conf, $langs;
921 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"Resource").
'</u>';
923 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
927 if (isset($this->type_label)) {
928 $label .=
'<br><b>'.$langs->trans(
"ResourceType").
":</b> ".$this->type_label;
931 $url = DOL_URL_ROOT.
'/resource/card.php?id='.$this->id;
933 if ($option !=
'nolink')
936 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
937 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/',
$_SERVER[
"PHP_SELF"])) $add_save_lastsearch_values = 1;
938 if ($add_save_lastsearch_values) $url .=
'&save_lastsearch_values=1';
942 if (empty($notooltip))
944 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
946 $label = $langs->trans(
"ShowMyObject");
947 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
949 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
950 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
951 }
else $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
953 $linkstart =
'<a href="'.$url.$get_params.
'"';
954 $linkstart .= $linkclose.
'>';
959 $result .= $linkstart;
960 if ($withpicto) $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);
961 if ($withpicto != 2) $result .= $this->ref;
976 return $this->
LibStatut($this->status, $mode);
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
static LibStatut($status, $mode=0)
Return the status.
create($user, $notrigger=0)
Create object into database.
fetch_all_available()
Fetch all resources available, declared by modules Load available resource in array $this->available_...
$conf db
API class for accounts.
fetch_all_resources($sortorder, $sortfield, $limit, $offset, $filter= '')
Load all objects into $this->lines.
insertExtraFields($trigger= '', $userused=null)
Add/Update all extra fields values for the current object.
fetch_element_resource($id)
Load object in memory from database.
fetch_all_used($sortorder, $sortfield, $limit, $offset=1, $filter= '')
Load all objects into $this->lines.
update_element_resource($user=null, $notrigger=0)
Update element resource into database.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getNomUrl($withpicto=0, $option= '', $get_params= '', $notooltip=0, $morecss= '', $save_lastsearch_value=-1)
Return clicable link of object (with eventually picto)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
getLibStatut($mode=0)
Retourne le libelle du status d'un user (actif, inactif)
fetchElementResources($element, $element_id)
Return an int number of resources linked to the element.
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories) ...
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
__construct($db)
Constructor.
deleteExtraFields()
Delete all extra fields values for the current object.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
fetch_optionals($rowid=null, $optionsArray=null)
Function to get extra fields of an object into $this->array_options This method is in most cases call...
fetch_all($sortorder, $sortfield, $limit, $offset, $filter= '')
Load resource objects into $this->lines.
print $_SERVER["PHP_SELF"]
Edit parameters.
call_trigger($triggerName, $user)
Call trigger based on this instance.
load_cache_code_type_resource()
Load in cache resource type code (setup in dictionary)
fetch($id, $ref= '')
Load object in memory from database.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getElementResources($element, $element_id, $resource_type= '')
Return an array with resources linked to the element.
fetchObjectByElement($element_id, $element_type, $element_ref= '')
Fetch an object from its id and element_type Inclusion of classes is automatic.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
update($user=null, $notrigger=0)
Update object into database.