29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
41 public $element =
'websitepage';
46 public $table_element =
'website_page';
51 public $picto =
'file-code';
56 public $fk_element =
'fk_website_page';
61 protected $childtablesoncascade = array(
'categorie_website_page');
73 public $type_container;
96 public $allowed_in_frames;
109 public $date_creation;
114 public $date_modification;
119 public $author_alias;
131 const STATUS_DRAFT = 0;
132 const STATUS_VALIDATED = 1;
163 public $fields = array(
164 'rowid' =>array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'index'=>1,
'position'=>1,
'comment'=>
'Id'),
165 'pageurl' =>array(
'type'=>
'varchar(16)',
'label'=>
'WEBSITE_PAGENAME',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>1,
'position'=>10,
'searchall'=>1,
'comment'=>
'Ref/alias of page'),
166 'aliasalt' =>array(
'type'=>
'varchar(255)',
'label'=>
'AliasAlt',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>0,
'position'=>11,
'searchall'=>0,
'comment'=>
'Alias alternative of page'),
167 'type_container' =>array(
'type'=>
'varchar(16)',
'label'=>
'Type',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>0,
'position'=>12,
'comment'=>
'Type of container'),
168 'title' =>array(
'type'=>
'varchar(255)',
'label'=>
'Label',
'enabled'=>1,
'visible'=>1,
'position'=>30,
'searchall'=>1,
'help'=>
'UseTextBetween5And70Chars'),
169 'description' =>array(
'type'=>
'varchar(255)',
'label'=>
'Description',
'enabled'=>1,
'visible'=>1,
'position'=>30,
'searchall'=>1),
170 'image' =>array(
'type'=>
'varchar(255)',
'label'=>
'Image',
'enabled'=>1,
'visible'=>1,
'position'=>32,
'searchall'=>0,
'help'=>
'Relative path of media. Used if Type is "blogpost"'),
171 'keywords' =>array(
'type'=>
'varchar(255)',
'label'=>
'Keywords',
'enabled'=>1,
'visible'=>1,
'position'=>45,
'searchall'=>0),
172 'lang' =>array(
'type'=>
'varchar(6)',
'label'=>
'Lang',
'enabled'=>1,
'notnull'=>-1,
'visible'=>1,
'position'=>45,
'searchall'=>0),
174 'fk_website' =>array(
'type'=>
'integer',
'label'=>
'WebsiteId',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'position'=>40,
'searchall'=>0,
'foreignkey'=>
'websitepage.rowid'),
175 'fk_page' =>array(
'type'=>
'integer',
'label'=>
'ParentPageId',
'enabled'=>1,
'visible'=>1,
'notnull'=>-1,
'position'=>45,
'searchall'=>0,
'foreignkey'=>
'website.rowid'),
176 'allowed_in_frames' =>array(
'type'=>
'integer',
'label'=>
'AllowedInFrames',
'enabled'=>1,
'visible'=>-1,
'position'=>48,
'searchall'=>0,
'default'=>0),
177 'htmlheader' =>array(
'type'=>
'text',
'label'=>
'HtmlHeader',
'enabled'=>1,
'visible'=>0,
'position'=>50,
'searchall'=>0),
178 'content' =>array(
'type'=>
'mediumtext',
'label'=>
'Content',
'enabled'=>1,
'visible'=>0,
'position'=>51,
'searchall'=>0),
179 'grabbed_from' =>array(
'type'=>
'varchar(255)',
'label'=>
'GrabbedFrom',
'enabled'=>1,
'visible'=>1,
'index'=>1,
'position'=>400,
'comment'=>
'URL page content was grabbed from'),
180 'date_creation' =>array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'position'=>500),
181 'tms' =>array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'position'=>501),
183 'fk_user_creat' =>array(
'type'=>
'integer',
'label'=>
'UserAuthor',
'enabled'=>1,
'visible'=>-1,
'notnull'=>
true,
'position'=>510),
184 'author_alias' =>array(
'type'=>
'varchar(64)',
'label'=>
'AuthorAlias',
'enabled'=>1,
'visible'=>-1,
'index'=>0,
'position'=>511,
'comment'=>
'Author alias'),
185 'fk_user_modif' =>array(
'type'=>
'integer',
'label'=>
'UserModif',
'enabled'=>1,
'visible'=>-1,
'position'=>512),
187 'import_key' =>array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>1,
'visible'=>-1,
'index'=>1,
'position'=>1000,
'notnull'=>-1),
188 'object_type' => array(
'type' =>
'varchar(255)',
'label' =>
'ObjectType',
'enabled'=>1,
'visible'=>0,
'position'=>46,
'searchall'=>0,
'help'=>
''),
189 'fk_object' => array(
'type' =>
'varchar(255)',
'label' =>
'ObjectId',
'enabled'=>1,
'visible'=>0,
'position'=>47,
'searchall'=>0,
'help'=>
'')
214 $this->keywords =
dol_trunc($this->keywords, 255,
'right',
'utf-8', 1);
215 if ($this->aliasalt) {
216 $this->aliasalt =
','.preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $this->aliasalt)).
',';
219 $this->pageurl = preg_replace(
'/[^a-z0-9\-\_]/i',
'', $this->pageurl);
220 $this->pageurl = preg_replace(
'/\-\-+/',
'-', $this->pageurl);
221 $this->pageurl = preg_replace(
'/^\-/',
'', $this->pageurl);
224 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
241 public function fetch($id, $website_id =
null, $page =
null, $aliasalt =
null)
247 $sql .=
" t.fk_website,";
248 $sql .=
' t.type_container,';
249 $sql .=
" t.pageurl,";
250 $sql .=
" t.aliasalt,";
252 $sql .=
" t.description,";
254 $sql .=
" t.keywords,";
255 $sql .=
" t.htmlheader,";
256 $sql .=
" t.content,";
258 $sql .=
" t.fk_page,";
259 $sql .=
" t.allowed_in_frames,";
260 $sql .=
" t.status,";
261 $sql .=
" t.grabbed_from,";
262 $sql .=
" t.date_creation,";
263 $sql .=
" t.tms as date_modification,";
264 $sql .=
" t.fk_user_creat,";
265 $sql .=
" t.author_alias,";
266 $sql .=
" t.fk_user_modif,";
267 $sql .=
" t.import_key,";
268 $sql .=
" t.object_type,";
269 $sql .=
" t.fk_object";
270 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
272 $sql .=
' WHERE 1 = 1';
274 $sql .=
' AND t.rowid = '.((int) $id);
277 $sql .=
' AND t.rowid <> '.abs($id);
279 if (
null !== $website_id) {
280 $sql .=
" AND t.fk_website = '".$this->db->escape($website_id).
"'";
284 $tmppage = explode(
'/', $page);
285 if (!empty($tmppage[1])) {
286 $pagetouse = $tmppage[1];
287 if (strlen($tmppage[0])) {
288 $langtouse = $tmppage[0];
291 $sql .=
" AND t.pageurl = '".$this->db->escape($pagetouse).
"'";
293 $sql .=
" AND t.lang = '".$this->db->escape($langtouse).
"'";
297 $sql .=
" AND (t.aliasalt LIKE '%,".$this->db->escape($aliasalt).
",%' OR t.aliasalt LIKE '%, ".$this->
db->escape($aliasalt).
",%')";
301 $sql .= $this->
db->plimit(1);
305 $numrows = $this->
db->num_rows(
$resql);
307 $obj = $this->
db->fetch_object(
$resql);
309 $this->
id = $obj->rowid;
311 $this->fk_website = $obj->fk_website;
312 $this->type_container = $obj->type_container;
314 $this->pageurl = $obj->pageurl;
315 $this->
ref = $obj->pageurl;
316 $this->aliasalt = preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $obj->aliasalt));
318 $this->title = $obj->title;
320 $this->image = $obj->image;
321 $this->keywords = $obj->keywords;
322 $this->htmlheader = $obj->htmlheader;
323 $this->content = $obj->content;
324 $this->lang = $obj->lang;
325 $this->fk_page = $obj->fk_page;
326 $this->allowed_in_frames = $obj->allowed_in_frames;
327 $this->status = $obj->status;
328 $this->grabbed_from = $obj->grabbed_from;
329 $this->date_creation = $this->
db->jdate($obj->date_creation);
330 $this->date_modification = $this->
db->jdate($obj->date_modification);
331 $this->fk_user_creat = $obj->fk_user_creat;
332 $this->author_alias = $obj->author_alias;
333 $this->fk_user_modif = $obj->fk_user_modif;
334 $this->import_key = $obj->import_key;
335 $this->object_type = $obj->object_type;
336 $this->fk_object = $obj->fk_object;
346 $this->errors[] =
'Error '.$this->db->lasterror();
347 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
365 public function fetchAll($websiteid, $sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
373 $sql .=
" t.fk_website,";
374 $sql .=
" t.type_container,";
375 $sql .=
" t.pageurl,";
376 $sql .=
" t.aliasalt,";
378 $sql .=
" t.description,";
380 $sql .=
" t.keywords,";
381 $sql .=
" t.htmlheader,";
382 $sql .=
" t.content,";
384 $sql .=
" t.fk_page,";
385 $sql .=
" t.allowed_in_frames,";
386 $sql .=
" t.status,";
387 $sql .=
" t.grabbed_from,";
388 $sql .=
" t.date_creation,";
389 $sql .=
" t.tms as date_modification,";
390 $sql .=
" t.fk_user_creat,";
391 $sql .=
" t.author_alias,";
392 $sql .=
" t.fk_user_modif,";
393 $sql .=
" t.import_key,";
394 $sql .=
" t.object_type,";
395 $sql .=
" t.fk_object";
396 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
397 $sql .=
' WHERE t.fk_website = '.((int) $websiteid);
400 if (count($filter) > 0) {
401 foreach ($filter as $key => $value) {
402 if ($key ==
't.rowid' || $key ==
'rowid' || $key ==
't.fk_website' || $key ==
'fk_website' || $key ==
'status' || $key ==
't.status') {
403 $sqlwhere[] = $key.
" = ".((int) $value);
404 } elseif ($key ==
'type_container' || $key ==
't.type_container') {
405 $sqlwhere[] = $key.
" = '".$this->
db->escape($value).
"'";
406 } elseif ($key ==
'lang' || $key ==
't.lang') {
407 $listoflang = array();
409 foreach (explode(
',', $value) as $tmpvalue) {
410 if ($tmpvalue ==
'null') {
414 $listoflang[] =
"'".$this->db->escape(substr(str_replace(
"'",
'', $tmpvalue), 0, 2)).
"'";
416 $stringtouse = $key.
" IN (".$this->
db->sanitize(join(
',', $listoflang), 1).
")";
418 $stringtouse =
"(".$stringtouse.
" OR ".$key.
" IS NULL)";
420 $sqlwhere[] = $stringtouse;
422 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
426 if (count($sqlwhere) > 0) {
427 $sql .=
" AND (".implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere).
')';
430 if (!empty($sortfield)) {
431 $sql .= $this->
db->order($sortfield, $sortorder);
433 if (!empty($limit)) {
434 $sql .= $this->
db->plimit($limit, $offset);
441 while ($obj = $this->
db->fetch_object(
$resql)) {
442 $record =
new self($this->db);
444 $record->id = $obj->rowid;
445 $record->fk_website = $obj->fk_website;
446 $record->type_container = $obj->type_container;
447 $record->pageurl = $obj->pageurl;
448 $record->aliasalt = preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $obj->aliasalt));
449 $record->title = $obj->title;
450 $record->description = $obj->description;
451 $record->image = $obj->image;
452 $record->keywords = $obj->keywords;
453 $record->htmlheader = $obj->htmlheader;
454 $record->content = $obj->content;
455 $record->lang = $obj->lang;
456 $record->fk_page = $obj->fk_page;
457 $record->allowed_in_frames = $obj->allowed_in_frames;
458 $record->status = $obj->status;
459 $record->grabbed_from = $obj->grabbed_from;
460 $record->date_creation = $this->
db->jdate($obj->date_creation);
461 $record->date_modification = $this->
db->jdate($obj->date_modification);
462 $record->fk_user_creat = $obj->fk_user_creat;
463 $record->author_alias = $obj->author_alias;
464 $record->fk_user_modif = $obj->fk_user_modif;
465 $record->import_key = $obj->import_key;
466 $record->object_type = $obj->object_type;
467 $record->fk_object = $obj->fk_object;
469 $records[$record->id] = $record;
475 $this->error =
'Error '.$this->db->lasterror();
476 $this->errors[] = $this->error;
477 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
491 public function countAll($websiteid, array $filter = array(), $filtermode =
'AND')
497 $sql =
'SELECT COUNT(t.rowid) as nb';
498 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
499 $sql .=
' WHERE t.fk_website = '.((int) $websiteid);
502 if (count($filter) > 0) {
503 foreach ($filter as $key => $value) {
504 if ($key ==
't.rowid' || $key ==
't.fk_website' || $key ==
'status') {
505 $sqlwhere[] = $key.
" = ".((int) $value);
506 } elseif ($key ==
'type_container') {
507 $sqlwhere[] = $key.
" = '".$this->
db->escape($value).
"'";
508 } elseif ($key ==
'lang' || $key ==
't.lang') {
509 $listoflang = array();
511 foreach (explode(
',', $value) as $tmpvalue) {
512 if ($tmpvalue ==
'null') {
516 $listoflang[] =
"'".$this->db->escape(substr(str_replace(
"'",
'', $tmpvalue), 0, 2)).
"'";
518 $stringtouse = $key.
" IN (".$this->
db->sanitize(join(
',', $listoflang), 1).
")";
520 $stringtouse =
"(".$stringtouse.
" OR ".$key.
" IS NULL)";
522 $sqlwhere[] = $stringtouse;
524 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
528 if (count($sqlwhere) > 0) {
529 $sql .=
' AND ('.implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere).
')';
534 $obj = $this->
db->fetch_object(
$resql);
543 $this->error =
'Error '.$this->db->lasterror();
544 $this->errors[] = $this->error;
545 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
561 $this->keywords =
dol_trunc($this->keywords, 255,
'right',
'utf-8', 1);
562 if ($this->aliasalt) {
563 $this->aliasalt =
','.preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $this->aliasalt)).
',';
566 $this->pageurl = preg_replace(
'/[^a-z0-9\-\_]/i',
'', $this->pageurl);
567 $this->pageurl = preg_replace(
'/\-\-+/',
'-', $this->pageurl);
568 $this->pageurl = preg_replace(
'/^\-/',
'', $this->pageurl);
571 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
573 if ($this->fk_page > 0) {
574 if (empty($this->lang)) {
575 $this->error =
"ErrorLanguageMandatoryIfPageSetAsTranslationOfAnother";
579 $tmppage->fetch($this->fk_page);
580 if ($tmppage->lang == $this->lang) {
581 $this->error =
"ErrorLanguageOfTranslatedPageIsSameThanThisPage";
596 public function delete(
User $user, $notrigger =
false)
604 foreach ($this->childtablesoncascade as $table) {
605 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$table;
606 $sql .=
" WHERE fk_website_page = ".(int) $this->
id;
608 $result = $this->
db->query($sql);
611 $this->errors[] = $this->
db->lasterror();
626 $result = $websiteobj->fetch($this->fk_website);
629 global $dolibarr_main_data_root;
630 $pathofwebsite = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$websiteobj->ref;
632 $filealias = $pathofwebsite.
'/'.$this->pageurl.
'.php';
633 $filetpl = $pathofwebsite.
'/page'.$this->id.
'.tpl.php';
638 $this->error = $websiteobj->error;
639 $this->errors = $websiteobj->errors;
662 public function createFromClone(
User $user, $fromid, $newref, $newlang =
'', $istranslation = 0, $newwebsite = 0, $newtitle =
'')
664 global $hookmanager, $langs;
671 $object =
new self($this->db);
674 if (empty($newref) && !empty($newtitle)) {
679 if (empty($newref)) {
680 $langs->load(
"errors");
681 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_TITLE"));
688 $object->fetch($fromid);
693 $object->ref = $newref;
694 $object->pageurl = $newref;
695 $object->aliasalt =
'';
696 $object->fk_user_creat = $user->id;
697 $object->author_alias =
'';
698 $object->date_creation = $now;
699 $object->title = ($newtitle ==
'1' ? $object->title : ($newtitle ? $newtitle : $object->title));
700 $object->description = $object->title;
701 if (!empty($newlang)) {
702 $object->lang = $newlang;
704 if ($istranslation) {
705 $object->fk_page = $fromid;
707 $object->fk_page = 0;
709 if (!empty($newwebsite)) {
710 $object->fk_website = $newwebsite;
712 $object->import_key =
'';
713 $object->status = self::STATUS_DRAFT;
716 $object->context[
'createfromclone'] =
'createfromclone';
717 $result = $object->create($user);
720 $this->error = $object->error;
721 $this->errors = $object->errors;
722 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
725 unset($object->context[
'createfromclone']);
733 $this->
db->rollback();
750 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
752 global $langs, $conf, $db;
753 global $dolibarr_main_authentication, $dolibarr_main_demo;
758 $label =
'<u>'.$langs->trans(
"Page").
'</u>';
760 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->
ref.
'<br>';
761 $label .=
'<b>'.$langs->trans(
'ID').
':</b> '.$this->
id.
'<br>';
762 $label .=
'<b>'.$langs->trans(
'Title').
':</b> '.$this->title.
'<br>';
763 $label .=
'<b>'.$langs->trans(
'Language').
':</b> '.$this->lang;
765 $url = DOL_URL_ROOT.
'/website/index.php?websiteid='.$this->fk_website.
'&pageid='.$this->id;
768 if (empty($notooltip)) {
769 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
770 $label = $langs->trans(
"ShowMyObject");
771 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
773 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
774 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
776 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
779 $linkstart =
'<a href="'.$url.
'"';
780 $linkstart .= $linkclose.
'>';
785 $result .= $linkstart;
787 $result .=
img_picto(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
789 if ($withpicto != 2) {
790 $result .= $this->ref;
805 return $this->
LibStatut($this->status, $mode);
821 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
824 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
825 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
826 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
827 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
830 $statusType =
'status5';
831 if ($status == self::STATUS_VALIDATED) {
832 $statusType =
'status4';
835 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
850 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
868 $this->fk_website =
'';
869 $this->type_container =
'page';
870 $this->pageurl =
'specimen';
871 $this->aliasalt =
'specimenalt';
872 $this->title =
'My Page';
875 $this->keywords =
'keyword1, keyword2';
876 $this->allowed_in_frames = 1;
877 $this->htmlheader =
'';
878 $this->content =
'<html><body>This is a html content</body></html>';
880 $this->grabbed_from =
'';
881 $this->date_creation = $now - (24 * 30 * 3600);
882 $this->date_modification = $now - (24 * 7 * 3600);
883 $this->fk_user_creat = $user->id;
884 $this->author_alias =
'mypublicpseudo';
Parent class of all other business classes (invoices, contracts, proposals, orders,...
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
updateCommon(User $user, $notrigger=false)
Update object into database.
setCategoriesCommon($categories, $type_categ='', $remove_existing=true)
Sets object to given categories.
Class to manage Dolibarr database access.
Class to manage Dolibarr users.
update(User $user, $notrigger=false)
Update object into database.
__construct(DoliDB $db)
Constructor.
countAll($websiteid, array $filter=array(), $filtermode='AND')
Count objects in the database.
fetchAll($websiteid, $sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Return array of all web site pages.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
fetch($id, $website_id=null, $page=null, $aliasalt=null)
Load object in memory from the database.
LibStatut($status, $mode=0)
Renvoi le libelle d'un status donne.
create(User $user, $notrigger=false)
Create object into database.
createFromClone(User $user, $fromid, $newref, $newlang='', $istranslation=0, $newwebsite=0, $newtitle='')
Load an object from its id and create a new one in database.
getLibStatut($mode=0)
Retourne le libelle du status d'un user (actif, inactif)
setCategories($categories)
Sets object to given categories.
getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
Return a link to the user card (with optionaly the picto) Use this->id,this->lastname,...
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.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db
API class for accounts.