29require_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;
116 public $fk_user_creat;
117 public $fk_user_modif;
122 public $author_alias;
134 const STATUS_DRAFT = 0;
135 const STATUS_VALIDATED = 1;
166 public $fields = array(
167 'rowid' =>array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'index'=>1,
'position'=>1,
'comment'=>
'Id'),
168 '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'),
169 'aliasalt' =>array(
'type'=>
'varchar(255)',
'label'=>
'AliasAlt',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>0,
'position'=>11,
'searchall'=>0,
'comment'=>
'Alias alternative of page'),
170 'type_container' =>array(
'type'=>
'varchar(16)',
'label'=>
'Type',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>0,
'position'=>12,
'comment'=>
'Type of container'),
171 'title' =>array(
'type'=>
'varchar(255)',
'label'=>
'Label',
'enabled'=>1,
'visible'=>1,
'position'=>30,
'searchall'=>1,
'help'=>
'UseTextBetween5And70Chars'),
172 'description' =>array(
'type'=>
'varchar(255)',
'label'=>
'Description',
'enabled'=>1,
'visible'=>1,
'position'=>30,
'searchall'=>1),
173 '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"'),
174 'keywords' =>array(
'type'=>
'varchar(255)',
'label'=>
'Keywords',
'enabled'=>1,
'visible'=>1,
'position'=>45,
'searchall'=>0),
175 'lang' =>array(
'type'=>
'varchar(6)',
'label'=>
'Lang',
'enabled'=>1,
'notnull'=>-1,
'visible'=>1,
'position'=>45,
'searchall'=>0),
177 'fk_website' =>array(
'type'=>
'integer',
'label'=>
'WebsiteId',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'position'=>40,
'searchall'=>0,
'foreignkey'=>
'websitepage.rowid'),
178 'fk_page' =>array(
'type'=>
'integer',
'label'=>
'ParentPageId',
'enabled'=>1,
'visible'=>1,
'notnull'=>-1,
'position'=>45,
'searchall'=>0,
'foreignkey'=>
'website.rowid'),
179 'allowed_in_frames' =>array(
'type'=>
'integer',
'label'=>
'AllowedInFrames',
'enabled'=>1,
'visible'=>-1,
'position'=>48,
'searchall'=>0,
'default'=>0),
180 'htmlheader' =>array(
'type'=>
'html',
'label'=>
'HtmlHeader',
'enabled'=>1,
'visible'=>0,
'position'=>50,
'searchall'=>0),
181 'content' =>array(
'type'=>
'mediumtext',
'label'=>
'Content',
'enabled'=>1,
'visible'=>0,
'position'=>51,
'searchall'=>0),
182 'grabbed_from' =>array(
'type'=>
'varchar(255)',
'label'=>
'GrabbedFrom',
'enabled'=>1,
'visible'=>1,
'index'=>1,
'position'=>400,
'comment'=>
'URL page content was grabbed from'),
183 'date_creation' =>array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'position'=>500),
184 'tms' =>array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'position'=>501),
186 'fk_user_creat' =>array(
'type'=>
'integer',
'label'=>
'UserAuthor',
'enabled'=>1,
'visible'=>-1,
'notnull'=>
true,
'position'=>510),
187 'author_alias' =>array(
'type'=>
'varchar(64)',
'label'=>
'AuthorAlias',
'enabled'=>1,
'visible'=>-1,
'index'=>0,
'position'=>511,
'comment'=>
'Author alias'),
188 'fk_user_modif' =>array(
'type'=>
'integer',
'label'=>
'UserModif',
'enabled'=>1,
'visible'=>-1,
'position'=>512),
190 'import_key' =>array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>1,
'visible'=>-1,
'index'=>1,
'position'=>1000,
'notnull'=>-1),
191 'object_type' => array(
'type' =>
'varchar(255)',
'label' =>
'ObjectType',
'enabled'=>1,
'visible'=>0,
'position'=>46,
'searchall'=>0,
'help'=>
''),
192 'fk_object' => array(
'type' =>
'varchar(255)',
'label' =>
'ObjectId',
'enabled'=>1,
'visible'=>0,
'position'=>47,
'searchall'=>0,
'help'=>
'')
217 $this->keywords =
dol_trunc($this->keywords, 255,
'right',
'utf-8', 1);
218 if ($this->aliasalt) {
219 $this->aliasalt =
','.preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $this->aliasalt)).
',';
222 $this->pageurl = preg_replace(
'/[^a-z0-9\-\_]/i',
'', $this->pageurl);
223 $this->pageurl = preg_replace(
'/\-\-+/',
'-', $this->pageurl);
224 $this->pageurl = preg_replace(
'/^\-/',
'', $this->pageurl);
227 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
244 public function fetch($id, $website_id =
null, $page =
null, $aliasalt =
null)
250 $sql .=
" t.fk_website,";
251 $sql .=
' t.type_container,';
252 $sql .=
" t.pageurl,";
253 $sql .=
" t.aliasalt,";
255 $sql .=
" t.description,";
257 $sql .=
" t.keywords,";
258 $sql .=
" t.htmlheader,";
259 $sql .=
" t.content,";
261 $sql .=
" t.fk_page,";
262 $sql .=
" t.allowed_in_frames,";
263 $sql .=
" t.status,";
264 $sql .=
" t.grabbed_from,";
265 $sql .=
" t.date_creation,";
266 $sql .=
" t.tms as date_modification,";
267 $sql .=
" t.fk_user_creat,";
268 $sql .=
" t.author_alias,";
269 $sql .=
" t.fk_user_modif,";
270 $sql .=
" t.import_key,";
271 $sql .=
" t.object_type,";
272 $sql .=
" t.fk_object";
273 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
275 $sql .=
' WHERE 1 = 1';
277 $sql .=
' AND t.rowid = '.((int) $id);
280 $sql .=
' AND t.rowid <> '.abs($id);
282 if (
null !== $website_id) {
283 $sql .=
" AND t.fk_website = '".$this->db->escape($website_id).
"'";
287 $tmppage = explode(
'/', $page);
288 if (!empty($tmppage[1])) {
289 $pagetouse = $tmppage[1];
290 if (strlen($tmppage[0])) {
291 $langtouse = $tmppage[0];
294 $sql .=
" AND t.pageurl = '".$this->db->escape($pagetouse).
"'";
296 $sql .=
" AND t.lang = '".$this->db->escape($langtouse).
"'";
300 $sql .=
" AND (t.aliasalt LIKE '%,".$this->db->escape($aliasalt).
",%' OR t.aliasalt LIKE '%, ".$this->db->escape($aliasalt).
",%')";
304 $sql .= $this->db->plimit(1);
306 $resql = $this->db->query($sql);
308 $numrows = $this->db->num_rows($resql);
310 $obj = $this->db->fetch_object($resql);
312 $this->
id = $obj->rowid;
314 $this->fk_website = $obj->fk_website;
315 $this->type_container = $obj->type_container;
317 $this->pageurl = $obj->pageurl;
318 $this->
ref = $obj->pageurl;
319 $this->aliasalt = preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $obj->aliasalt));
321 $this->title = $obj->title;
323 $this->image = $obj->image;
324 $this->keywords = $obj->keywords;
325 $this->htmlheader = $obj->htmlheader;
326 $this->content = $obj->content;
327 $this->lang = $obj->lang;
328 $this->fk_page = $obj->fk_page;
329 $this->allowed_in_frames = $obj->allowed_in_frames;
330 $this->status = $obj->status;
331 $this->grabbed_from = $obj->grabbed_from;
332 $this->date_creation = $this->db->jdate($obj->date_creation);
333 $this->date_modification = $this->db->jdate($obj->date_modification);
334 $this->fk_user_creat = $obj->fk_user_creat;
335 $this->author_alias = $obj->author_alias;
336 $this->fk_user_modif = $obj->fk_user_modif;
337 $this->import_key = $obj->import_key;
338 $this->object_type = $obj->object_type;
339 $this->fk_object = $obj->fk_object;
341 $this->db->free($resql);
349 $this->errors[] =
'Error '.$this->db->lasterror();
350 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
368 public function fetchAll($websiteid, $sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
376 $sql .=
" t.fk_website,";
377 $sql .=
" t.type_container,";
378 $sql .=
" t.pageurl,";
379 $sql .=
" t.aliasalt,";
381 $sql .=
" t.description,";
383 $sql .=
" t.keywords,";
384 $sql .=
" t.htmlheader,";
385 $sql .=
" t.content,";
387 $sql .=
" t.fk_page,";
388 $sql .=
" t.allowed_in_frames,";
389 $sql .=
" t.status,";
390 $sql .=
" t.grabbed_from,";
391 $sql .=
" t.date_creation,";
392 $sql .=
" t.tms as date_modification,";
393 $sql .=
" t.fk_user_creat,";
394 $sql .=
" t.author_alias,";
395 $sql .=
" t.fk_user_modif,";
396 $sql .=
" t.import_key,";
397 $sql .=
" t.object_type,";
398 $sql .=
" t.fk_object";
399 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
400 $sql .=
' WHERE t.fk_website = '.((int) $websiteid);
403 if (count($filter) > 0) {
404 foreach ($filter as $key => $value) {
405 if ($key ==
't.rowid' || $key ==
'rowid' || $key ==
't.fk_website' || $key ==
'fk_website' || $key ==
'status' || $key ==
't.status') {
406 $sqlwhere[] = $key.
" = ".((int) $value);
407 } elseif ($key ==
'type_container' || $key ==
't.type_container') {
408 $sqlwhere[] = $key.
" = '".$this->db->escape($value).
"'";
409 } elseif ($key ==
'lang' || $key ==
't.lang') {
410 $listoflang = array();
412 foreach (explode(
',', $value) as $tmpvalue) {
413 if ($tmpvalue ==
'null') {
417 $listoflang[] =
"'".$this->db->escape(substr(str_replace(
"'",
'', $tmpvalue), 0, 2)).
"'";
419 $stringtouse = $key.
" IN (".$this->db->sanitize(join(
',', $listoflang), 1).
")";
421 $stringtouse =
"(".$stringtouse.
" OR ".$key.
" IS NULL)";
423 $sqlwhere[] = $stringtouse;
425 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
429 if (count($sqlwhere) > 0) {
430 $sql .=
" AND (".implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere).
')';
433 if (!empty($sortfield)) {
434 $sql .= $this->db->order($sortfield, $sortorder);
436 if (!empty($limit)) {
437 $sql .= $this->db->plimit($limit, $offset);
440 $resql = $this->db->query($sql);
442 $num = $this->db->num_rows($resql);
444 while ($obj = $this->db->fetch_object($resql)) {
445 $record =
new self($this->db);
447 $record->id = $obj->rowid;
448 $record->fk_website = $obj->fk_website;
449 $record->type_container = $obj->type_container;
450 $record->pageurl = $obj->pageurl;
451 $record->aliasalt = preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $obj->aliasalt));
452 $record->title = $obj->title;
453 $record->description = $obj->description;
454 $record->image = $obj->image;
455 $record->keywords = $obj->keywords;
456 $record->htmlheader = $obj->htmlheader;
457 $record->content = $obj->content;
458 $record->lang = $obj->lang;
459 $record->fk_page = $obj->fk_page;
460 $record->allowed_in_frames = $obj->allowed_in_frames;
461 $record->status = $obj->status;
462 $record->grabbed_from = $obj->grabbed_from;
463 $record->date_creation = $this->db->jdate($obj->date_creation);
464 $record->date_modification = $this->db->jdate($obj->date_modification);
465 $record->fk_user_creat = $obj->fk_user_creat;
466 $record->author_alias = $obj->author_alias;
467 $record->fk_user_modif = $obj->fk_user_modif;
468 $record->import_key = $obj->import_key;
469 $record->object_type = $obj->object_type;
470 $record->fk_object = $obj->fk_object;
472 $records[$record->id] = $record;
474 $this->db->free($resql);
478 $this->error =
'Error '.$this->db->lasterror();
479 $this->errors[] = $this->error;
480 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
494 public function countAll($websiteid, array $filter = array(), $filtermode =
'AND')
500 $sql =
'SELECT COUNT(t.rowid) as nb';
501 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
502 $sql .=
' WHERE t.fk_website = '.((int) $websiteid);
505 if (count($filter) > 0) {
506 foreach ($filter as $key => $value) {
507 if ($key ==
't.rowid' || $key ==
't.fk_website' || $key ==
'status') {
508 $sqlwhere[] = $key.
" = ".((int) $value);
509 } elseif ($key ==
'type_container') {
510 $sqlwhere[] = $key.
" = '".$this->db->escape($value).
"'";
511 } elseif ($key ==
'lang' || $key ==
't.lang') {
512 $listoflang = array();
514 foreach (explode(
',', $value) as $tmpvalue) {
515 if ($tmpvalue ==
'null') {
519 $listoflang[] =
"'".$this->db->escape(substr(str_replace(
"'",
'', $tmpvalue), 0, 2)).
"'";
521 $stringtouse = $key.
" IN (".$this->db->sanitize(join(
',', $listoflang), 1).
")";
523 $stringtouse =
"(".$stringtouse.
" OR ".$key.
" IS NULL)";
525 $sqlwhere[] = $stringtouse;
527 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
531 if (count($sqlwhere) > 0) {
532 $sql .=
' AND ('.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere).
')';
535 $resql = $this->db->query($sql);
537 $obj = $this->db->fetch_object($resql);
542 $this->db->free($resql);
546 $this->error =
'Error '.$this->db->lasterror();
547 $this->errors[] = $this->error;
548 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
564 $this->keywords =
dol_trunc($this->keywords, 255,
'right',
'utf-8', 1);
565 if ($this->aliasalt) {
566 $this->aliasalt =
','.preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $this->aliasalt)).
',';
569 $this->pageurl = preg_replace(
'/[^a-z0-9\-\_]/i',
'', $this->pageurl);
570 $this->pageurl = preg_replace(
'/\-\-+/',
'-', $this->pageurl);
571 $this->pageurl = preg_replace(
'/^\-/',
'', $this->pageurl);
574 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
576 if ($this->fk_page > 0) {
577 if (empty($this->lang)) {
578 $this->error =
"ErrorLanguageMandatoryIfPageSetAsTranslationOfAnother";
582 $tmppage->fetch($this->fk_page);
583 if ($tmppage->lang == $this->lang) {
584 $this->error =
"ErrorLanguageOfTranslatedPageIsSameThanThisPage";
599 public function delete(
User $user, $notrigger =
false)
607 foreach ($this->childtablesoncascade as $table) {
608 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$table;
609 $sql .=
" WHERE fk_website_page = ".(int) $this->
id;
611 $result = $this->db->query($sql);
614 $this->errors[] = $this->db->lasterror();
628 $websiteobj =
new Website($this->db);
629 $result = $websiteobj->fetch($this->fk_website);
632 global $dolibarr_main_data_root;
633 $pathofwebsite = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$websiteobj->ref;
635 $filealias = $pathofwebsite.
'/'.$this->pageurl.
'.php';
636 $filetpl = $pathofwebsite.
'/page'.$this->
id.
'.tpl.php';
641 $this->error = $websiteobj->error;
642 $this->errors = $websiteobj->errors;
665 public function createFromClone(
User $user, $fromid, $newref, $newlang =
'', $istranslation = 0, $newwebsite = 0, $newtitle =
'')
667 global $hookmanager, $langs;
674 $object =
new self($this->db);
677 if (empty($newref) && !empty($newtitle)) {
682 if (empty($newref)) {
683 $langs->load(
"errors");
684 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_TITLE"));
691 $object->fetch($fromid);
696 $object->ref = $newref;
697 $object->pageurl = $newref;
698 $object->aliasalt =
'';
699 $object->fk_user_creat = $user->id;
700 $object->author_alias =
'';
701 $object->date_creation = $now;
702 $object->title = ($newtitle ==
'1' ? $object->title : ($newtitle ? $newtitle : $object->title));
703 $object->description = $object->title;
704 if (!empty($newlang)) {
705 $object->lang = $newlang;
707 if ($istranslation) {
708 $object->fk_page = $fromid;
710 $object->fk_page = 0;
712 if (!empty($newwebsite)) {
713 $object->fk_website = $newwebsite;
715 $object->import_key =
'';
716 $object->status = self::STATUS_DRAFT;
719 $object->context[
'createfromclone'] =
'createfromclone';
720 $result = $object->create($user);
723 $this->error = $object->error;
724 $this->errors = $object->errors;
725 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
728 unset($object->context[
'createfromclone']);
736 $this->db->rollback();
753 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
755 global $langs, $conf, $db;
756 global $dolibarr_main_authentication, $dolibarr_main_demo;
761 $label =
'<u>'.$langs->trans(
"Page").
'</u>';
763 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->
ref.
'<br>';
764 $label .=
'<b>'.$langs->trans(
'ID').
':</b> '.$this->
id.
'<br>';
765 $label .=
'<b>'.$langs->trans(
'Title').
':</b> '.$this->title.
'<br>';
766 $label .=
'<b>'.$langs->trans(
'Language').
':</b> '.$this->lang;
768 $url = DOL_URL_ROOT.
'/website/index.php?websiteid='.$this->fk_website.
'&pageid='.$this->id;
771 if (empty($notooltip)) {
772 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
773 $label = $langs->trans(
"ShowMyObject");
774 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
776 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
777 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
779 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
782 $linkstart =
'<a href="'.$url.
'"';
783 $linkstart .= $linkclose.
'>';
788 $result .= $linkstart;
790 $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);
792 if ($withpicto != 2) {
793 $result .= $this->ref;
808 return $this->
LibStatut($this->status, $mode);
824 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
827 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
828 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
829 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
830 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
833 $statusType =
'status5';
834 if ($status == self::STATUS_VALIDATED) {
835 $statusType =
'status4';
838 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
853 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
871 $this->fk_website =
'';
872 $this->type_container =
'page';
873 $this->pageurl =
'specimen';
874 $this->aliasalt =
'specimenalt';
875 $this->title =
'My Page';
878 $this->keywords =
'keyword1, keyword2';
879 $this->allowed_in_frames = 1;
880 $this->htmlheader =
'';
881 $this->content =
'<html><body>This is a html content</body></html>';
883 $this->grabbed_from =
'';
884 $this->date_creation = $now - (24 * 30 * 3600);
885 $this->date_modification = $now - (24 * 7 * 3600);
886 $this->fk_user_creat = $user->id;
887 $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)
Return the label of a given status.
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)
Return the label of the status.
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,...
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after 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)
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.