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';
61 public $type_container;
84 public $allowed_in_frames;
97 public $date_creation;
102 public $date_modification;
107 public $author_alias;
119 const STATUS_DRAFT = 0;
120 const STATUS_VALIDATED = 1;
151 public $fields = array(
152 'rowid' =>array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'index'=>1,
'position'=>1,
'comment'=>
'Id'),
153 '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'),
154 'aliasalt' =>array(
'type'=>
'varchar(255)',
'label'=>
'AliasAlt',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>0,
'position'=>11,
'searchall'=>0,
'comment'=>
'Alias alternative of page'),
155 'type_container' =>array(
'type'=>
'varchar(16)',
'label'=>
'Type',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'index'=>0,
'position'=>12,
'comment'=>
'Type of container'),
156 'title' =>array(
'type'=>
'varchar(255)',
'label'=>
'Label',
'enabled'=>1,
'visible'=>1,
'position'=>30,
'searchall'=>1,
'help'=>
'UseTextBetween5And70Chars'),
157 'description' =>array(
'type'=>
'varchar(255)',
'label'=>
'Description',
'enabled'=>1,
'visible'=>1,
'position'=>30,
'searchall'=>1),
158 '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"'),
159 'keywords' =>array(
'type'=>
'varchar(255)',
'label'=>
'Keywords',
'enabled'=>1,
'visible'=>1,
'position'=>45,
'searchall'=>0),
160 'lang' =>array(
'type'=>
'varchar(6)',
'label'=>
'Lang',
'enabled'=>1,
'notnull'=>-1,
'visible'=>1,
'position'=>45,
'searchall'=>0),
162 'fk_website' =>array(
'type'=>
'integer',
'label'=>
'WebsiteId',
'enabled'=>1,
'visible'=>1,
'notnull'=>1,
'position'=>40,
'searchall'=>0,
'foreignkey'=>
'websitepage.rowid'),
163 'fk_page' =>array(
'type'=>
'integer',
'label'=>
'ParentPageId',
'enabled'=>1,
'visible'=>1,
'notnull'=>-1,
'position'=>45,
'searchall'=>0,
'foreignkey'=>
'website.rowid'),
164 'allowed_in_frames' =>array(
'type'=>
'integer',
'label'=>
'AllowedInFrames',
'enabled'=>1,
'visible'=>-1,
'position'=>48,
'searchall'=>0,
'default'=>0),
165 'htmlheader' =>array(
'type'=>
'text',
'label'=>
'HtmlHeader',
'enabled'=>1,
'visible'=>0,
'position'=>50,
'searchall'=>0),
166 'content' =>array(
'type'=>
'mediumtext',
'label'=>
'Content',
'enabled'=>1,
'visible'=>0,
'position'=>51,
'searchall'=>0),
167 'grabbed_from' =>array(
'type'=>
'varchar(255)',
'label'=>
'GrabbedFrom',
'enabled'=>1,
'visible'=>1,
'index'=>1,
'position'=>400,
'comment'=>
'URL page content was grabbed from'),
168 'date_creation' =>array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'position'=>500),
169 'tms' =>array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>1,
'visible'=>-1,
'notnull'=>1,
'position'=>501),
171 'fk_user_creat' =>array(
'type'=>
'integer',
'label'=>
'UserAuthor',
'enabled'=>1,
'visible'=>-1,
'notnull'=>
true,
'position'=>510),
172 'author_alias' =>array(
'type'=>
'varchar(64)',
'label'=>
'AuthorAlias',
'enabled'=>1,
'visible'=>-1,
'index'=>0,
'position'=>511,
'comment'=>
'Author alias'),
173 'fk_user_modif' =>array(
'type'=>
'integer',
'label'=>
'UserModif',
'enabled'=>1,
'visible'=>-1,
'position'=>512),
175 'import_key' =>array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>1,
'visible'=>-1,
'index'=>1,
'position'=>1000,
'notnull'=>-1),
176 'object_type' => array(
'type' =>
'varchar(255)',
'label' =>
'ObjectType',
'enabled'=>1,
'visible'=>0,
'position'=>46,
'searchall'=>0,
'help'=>
''),
177 'fk_object' => array(
'type' =>
'varchar(255)',
'label' =>
'ObjectId',
'enabled'=>1,
'visible'=>0,
'position'=>47,
'searchall'=>0,
'help'=>
'')
192 public $fk_element =
'fk_website_page';
207 protected $childtablesoncascade = array(
'categorie_website_page');
231 $this->keywords =
dol_trunc($this->keywords, 255,
'right',
'utf-8', 1);
232 if ($this->aliasalt) $this->aliasalt =
','.preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $this->aliasalt)).
',';
235 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
252 public function fetch($id, $website_id = null, $page = null, $aliasalt = null)
258 $sql .=
" t.fk_website,";
259 $sql .=
' t.type_container,';
260 $sql .=
" t.pageurl,";
261 $sql .=
" t.aliasalt,";
263 $sql .=
" t.description,";
265 $sql .=
" t.keywords,";
266 $sql .=
" t.htmlheader,";
267 $sql .=
" t.content,";
269 $sql .=
" t.fk_page,";
270 $sql .=
" t.allowed_in_frames,";
271 $sql .=
" t.status,";
272 $sql .=
" t.grabbed_from,";
273 $sql .=
" t.date_creation,";
274 $sql .=
" t.tms as date_modification,";
275 $sql .=
" t.fk_user_creat,";
276 $sql .=
" t.author_alias,";
277 $sql .=
" t.fk_user_modif,";
278 $sql .=
" t.import_key,";
279 $sql .=
" t.object_type,";
280 $sql .=
" t.fk_object";
281 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
283 $sql .=
' WHERE 1 = 1';
286 $sql .=
' AND t.rowid = '.$id;
289 if ($id < 0) $sql .=
' AND t.rowid <> '.abs($id);
290 if (null !== $website_id) {
291 $sql .=
" AND t.fk_website = '".$this->db->escape($website_id).
"'";
295 $tmppage = explode(
'/', $page);
296 if (!empty($tmppage[1])) {
297 $pagetouse = $tmppage[1];
298 if (strlen($tmppage[0])) $langtouse = $tmppage[0];
300 $sql .=
" AND t.pageurl = '".$this->db->escape($pagetouse).
"'";
301 if ($langtouse) $sql .=
" AND t.lang = '".$this->db->escape($langtouse).
"'";
303 if ($aliasalt) $sql .=
" AND (t.aliasalt LIKE '%,".$this->db->escape($aliasalt).
",%' OR t.aliasalt LIKE '%, ".$this->
db->escape($aliasalt).
",%')";
306 $sql .= $this->
db->plimit(1);
310 $numrows = $this->
db->num_rows(
$resql);
312 $obj = $this->
db->fetch_object(
$resql);
314 $this->
id = $obj->rowid;
316 $this->fk_website = $obj->fk_website;
317 $this->type_container = $obj->type_container;
319 $this->pageurl = $obj->pageurl;
320 $this->ref = $obj->pageurl;
321 $this->aliasalt = preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $obj->aliasalt));
323 $this->title = $obj->title;
325 $this->image = $obj->image;
326 $this->keywords = $obj->keywords;
327 $this->htmlheader = $obj->htmlheader;
328 $this->content = $obj->content;
329 $this->lang = $obj->lang;
330 $this->fk_page = $obj->fk_page;
331 $this->allowed_in_frames = $obj->allowed_in_frames;
332 $this->status = $obj->status;
333 $this->grabbed_from = $obj->grabbed_from;
334 $this->date_creation = $this->
db->jdate($obj->date_creation);
335 $this->date_modification = $this->
db->jdate($obj->date_modification);
336 $this->fk_user_creat = $obj->fk_user_creat;
337 $this->author_alias = $obj->author_alias;
338 $this->fk_user_modif = $obj->fk_user_modif;
339 $this->import_key = $obj->import_key;
340 $this->object_type = $obj->object_type;
341 $this->fk_object = $obj->fk_object;
351 $this->errors[] =
'Error '.$this->db->lasterror();
352 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
370 public function fetchAll($websiteid, $sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
378 $sql .=
" t.fk_website,";
379 $sql .=
" t.type_container,";
380 $sql .=
" t.pageurl,";
381 $sql .=
" t.aliasalt,";
383 $sql .=
" t.description,";
385 $sql .=
" t.keywords,";
386 $sql .=
" t.htmlheader,";
387 $sql .=
" t.content,";
389 $sql .=
" t.fk_page,";
390 $sql .=
" t.allowed_in_frames,";
391 $sql .=
" t.status,";
392 $sql .=
" t.grabbed_from,";
393 $sql .=
" t.date_creation,";
394 $sql .=
" t.tms as date_modification,";
395 $sql .=
" t.fk_user_creat,";
396 $sql .=
" t.author_alias,";
397 $sql .=
" t.fk_user_modif,";
398 $sql .=
" t.import_key,";
399 $sql .=
" t.object_type,";
400 $sql .=
" t.fk_object";
401 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
402 $sql .=
' WHERE t.fk_website = '.$websiteid;
405 if (count($filter) > 0) {
406 foreach ($filter as $key => $value) {
407 if ($key ==
't.rowid' || $key ==
't.fk_website' || $key ==
'status') {
408 $sqlwhere[] = $key.
' = '.$value;
409 } elseif ($key ==
'type_container') {
410 $sqlwhere[] = $key.
" = '".$this->
db->escape($value).
"'";
411 } elseif ($key ==
'lang' || $key ==
't.lang') {
412 $listoflang = array();
414 foreach (explode(
',', $value) as $tmpvalue) {
415 if ($tmpvalue ==
'null') {
419 $listoflang[] =
"'".$this->db->escape(substr(str_replace(
"'",
'', $tmpvalue), 0, 2)).
"'";
421 $stringtouse = $key.
" IN (".join(
',', $listoflang).
")";
422 if ($foundnull) $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(
' '.$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 ($obj = $this->
db->fetch_object(
$resql))
446 $record =
new self($this->db);
448 $record->id = $obj->rowid;
449 $record->fk_website = $obj->fk_website;
450 $record->type_container = $obj->type_container;
451 $record->pageurl = $obj->pageurl;
452 $record->aliasalt = preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $obj->aliasalt));
453 $record->title = $obj->title;
454 $record->description = $obj->description;
455 $record->image = $obj->image;
456 $record->keywords = $obj->keywords;
457 $record->htmlheader = $obj->htmlheader;
458 $record->content = $obj->content;
459 $record->lang = $obj->lang;
460 $record->fk_page = $obj->fk_page;
461 $record->allowed_in_frames = $obj->allowed_in_frames;
462 $record->status = $obj->status;
463 $record->grabbed_from = $obj->grabbed_from;
464 $record->date_creation = $this->
db->jdate($obj->date_creation);
465 $record->date_modification = $this->
db->jdate($obj->date_modification);
466 $record->fk_user_creat = $obj->fk_user_creat;
467 $record->author_alias = $obj->author_alias;
468 $record->fk_user_modif = $obj->fk_user_modif;
469 $record->import_key = $obj->import_key;
470 $record->object_type = $obj->object_type;
471 $record->fk_object = $obj->fk_object;
473 $records[$record->id] = $record;
479 $this->error =
'Error '.$this->db->lasterror();
480 $this->errors[] = $this->error;
481 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
495 public function countAll($websiteid, array $filter = array(), $filtermode =
'AND')
501 $sql =
'SELECT COUNT(t.rowid) as nb';
502 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
503 $sql .=
' WHERE t.fk_website = '.$websiteid;
506 if (count($filter) > 0) {
507 foreach ($filter as $key => $value) {
508 if ($key ==
't.rowid' || $key ==
't.fk_website' || $key ==
'status') {
509 $sqlwhere[] = $key.
' = '.$value;
510 } elseif ($key ==
'type_container') {
511 $sqlwhere[] = $key.
" = '".$this->
db->escape($value).
"'";
512 } elseif ($key ==
'lang' || $key ==
't.lang') {
513 $listoflang = array();
515 foreach (explode(
',', $value) as $tmpvalue) {
516 if ($tmpvalue ==
'null') {
520 $listoflang[] =
"'".$this->db->escape(substr(str_replace(
"'",
'', $tmpvalue), 0, 2)).
"'";
522 $stringtouse = $key.
" IN (".join(
',', $listoflang).
")";
523 if ($foundnull) $stringtouse =
'('.$stringtouse.
' OR '.$key.
' IS NULL)';
524 $sqlwhere[] = $stringtouse;
526 $sqlwhere[] = $key.
' LIKE \'%'.$this->
db->escape($value).
'%\'';
530 if (count($sqlwhere) > 0) {
531 $sql .=
' AND ('.implode(
' '.$filtermode.
' ', $sqlwhere).
')';
536 $obj = $this->
db->fetch_object(
$resql);
545 $this->error =
'Error '.$this->db->lasterror();
546 $this->errors[] = $this->error;
547 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
563 $this->keywords =
dol_trunc($this->keywords, 255,
'right',
'utf-8', 1);
564 if ($this->aliasalt) $this->aliasalt =
','.preg_replace(
'/,+$/',
'', preg_replace(
'/^,+/',
'', $this->aliasalt)).
',';
567 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
569 if ($this->fk_page > 0) {
570 if (empty($this->lang)) {
571 $this->error =
"ErrorLanguageMandatoryIfPageSetAsTranslationOfAnother";
575 $tmppage->fetch($this->fk_page);
576 if ($tmppage->lang == $this->lang) {
577 $this->error =
"ErrorLanguageOfTranslatedPageIsSameThanThisPage";
592 public function delete(
User $user, $notrigger =
false)
598 foreach ($this->childtablesoncascade as $table)
600 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$table;
601 $sql .=
" WHERE fk_website_page = ".(int) $this->
id;
603 $result = $this->
db->query($sql);
606 $this->errors[] = $this->
db->lasterror();
623 $result = $websiteobj->fetch($this->fk_website);
627 global $dolibarr_main_data_root;
628 $pathofwebsite = $dolibarr_main_data_root.
'/website/'.$websiteobj->ref;
630 $filealias = $pathofwebsite.
'/'.$this->pageurl.
'.php';
631 $filetpl = $pathofwebsite.
'/page'.$this->
id.
'.tpl.php';
636 $this->error = $websiteobj->error;
637 $this->errors = $websiteobj->errors;
660 public function createFromClone(
User $user, $fromid, $newref, $newlang =
'', $istranslation = 0, $newwebsite = 0, $newtitle =
'')
662 global $hookmanager, $langs;
669 $object =
new self($this->db);
672 if (empty($newref) && !empty($newtitle)) {
677 if (empty($newref)) {
678 $langs->load(
"errors");
679 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WEBSITE_TITLE"));
686 $object->fetch($fromid);
691 $object->ref = $newref;
692 $object->pageurl = $newref;
693 $object->aliasalt =
'';
694 $object->fk_user_creat = $user->id;
695 $object->author_alias =
'';
696 $object->date_creation = $now;
697 $object->title = ($newtitle ==
'1' ? $object->title : ($newtitle ? $newtitle : $object->title));
698 $object->description = $object->title;
699 if (!empty($newlang)) $object->lang = $newlang;
700 if ($istranslation) $object->fk_page = $fromid;
701 else $object->fk_page = 0;
702 if (!empty($newwebsite)) $object->fk_website = $newwebsite;
703 $object->import_key =
'';
706 $object->context[
'createfromclone'] =
'createfromclone';
707 $result = $object->create($user);
710 $this->error = $object->error;
711 $this->errors = $object->errors;
712 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
715 unset($object->context[
'createfromclone']);
723 $this->
db->rollback();
740 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
742 global $langs, $conf, $db;
743 global $dolibarr_main_authentication, $dolibarr_main_demo;
748 $label =
'<u>'.$langs->trans(
"Page").
'</u>';
750 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref.
'<br>';
751 $label .=
'<b>'.$langs->trans(
'ID').
':</b> '.$this->
id.
'<br>';
752 $label .=
'<b>'.$langs->trans(
'Title').
':</b> '.$this->title.
'<br>';
753 $label .=
'<b>'.$langs->trans(
'Language').
':</b> '.$this->lang;
755 $url = DOL_URL_ROOT.
'/website/index.php?websiteid='.$this->fk_website.
'&pageid='.$this->id;
758 if (empty($notooltip))
760 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
762 $label = $langs->trans(
"ShowMyObject");
763 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
765 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
766 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
768 else $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
770 $linkstart =
'<a href="'.$url.
'"';
771 $linkstart .= $linkclose.
'>';
776 $result .= $linkstart;
777 if ($withpicto) $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);
778 if ($withpicto != 2) $result .= $this->ref;
792 return $this->
LibStatut($this->status, $mode);
808 if (empty($this->labelStatus) || empty($this->labelStatusShort))
812 $this->labelStatus[self::STATUS_DRAFT] = $langs->trans(
'Disabled');
813 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Enabled');
814 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans(
'Disabled');
815 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans(
'Enabled');
818 $statusType =
'status5';
819 if ($status == self::STATUS_VALIDATED) $statusType =
'status4';
821 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
836 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
854 $this->fk_website =
'';
855 $this->type_container =
'page';
856 $this->pageurl =
'specimen';
857 $this->aliasalt =
'specimenalt';
858 $this->title =
'My Page';
861 $this->keywords =
'keyword1, keyword2';
862 $this->allowed_in_frames = 1;
863 $this->htmlheader =
'';
864 $this->content =
'<html><body>This is a html content</body></html>';
866 $this->grabbed_from =
'';
867 $this->date_creation = $now - (24 * 30 * 3600);
868 $this->date_modification = $now - (24 * 7 * 3600);
869 $this->fk_user_creat = $user->id;
870 $this->author_alias =
'mypublicpseudo';
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in 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.
LibStatut($status, $mode=0)
Renvoi le libelle d'un status donne.
__construct(DoliDB $db)
Constructor.
</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.
dol_now($mode= 'auto')
Return date for now.
setCategoriesCommon($categories, $type_categ)
Sets object to given categories.
Class to manage Dolibarr users.
Class to manage Dolibarr database access.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
createCommon(User $user, $notrigger=false)
Create object into database.
create(User $user, $notrigger=false)
Create object into database.
$conf db
API class for accounts.
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.
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_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
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.
getLibStatut($mode=0)
Retourne le libelle du status d'un user (actif, inactif)
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_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.
dolGetStatus($statusLabel= '', $statusLabelShort= '', $html= '', $statusType= 'status0', $displayMode=0, $url= '', $params=array())
Output the badge of a status.
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, this->firstname.
update(User $user, $notrigger=false)
Update object into database.
setCategories($categories)
Sets object to given categories.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
fetch($id, $website_id=null, $page=null, $aliasalt=null)
Load object in memory from the database.