34 public $element=
'bookmark';
39 public $table_element=
'bookmark';
45 public $ismultientitymanaged = 1;
50 public $picto =
'bookmark';
100 $sql =
"SELECT rowid, fk_user, dateb as datec, url, target,";
101 $sql.=
" title, position, favicon";
102 $sql.=
" FROM ".MAIN_DB_PREFIX.
"bookmark";
103 $sql.=
" WHERE rowid = ".$id;
104 $sql.=
" AND entity = ".$conf->entity;
107 $resql = $this->db->query($sql);
110 $obj = $this->db->fetch_object(
$resql);
112 $this->
id = $obj->rowid;
113 $this->ref = $obj->rowid;
115 $this->fk_user = $obj->fk_user;
116 $this->datec = $this->db->jdate($obj->datec);
117 $this->url = $obj->url;
118 $this->target = $obj->target;
119 $this->title = $obj->title;
120 $this->position= $obj->position;
121 $this->favicon = $obj->favicon;
143 $this->url=trim($this->url);
144 $this->title=trim($this->title);
145 if (empty($this->position)) $this->position=0;
151 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"bookmark (fk_user,dateb,url,target";
152 $sql.=
",title,favicon,position";
155 $sql.= ($this->fk_user > 0 ? $this->fk_user:
"0").
",";
156 $sql.=
" '".$this->db->idate($now).
"',";
157 $sql.=
" '".$this->db->escape($this->url).
"', '".$this->db->escape($this->target).
"',";
158 $sql.=
" '".$this->db->escape($this->title).
"', '".$this->db->escape($this->favicon).
"', '".$this->db->escape($this->position).
"'";
159 $sql.=
", ".$this->db->escape($conf->entity);
163 $resql = $this->db->query($sql);
166 $id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"bookmark");
175 $this->error=$this->db->lasterror();
176 $this->errno=$this->db->lasterrno();
177 $this->db->rollback();
183 $this->error=$this->db->lasterror();
184 $this->errno=$this->db->lasterrno();
185 $this->db->rollback();
198 $this->url=trim($this->url);
199 $this->title=trim($this->title);
200 if (empty($this->position)) $this->position=0;
202 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bookmark";
203 $sql.=
" SET fk_user = ".($this->fk_user > 0 ? $this->fk_user :
"0");
204 $sql.=
" ,dateb = '".$this->db->idate($this->datec).
"'";
205 $sql.=
" ,url = '".$this->db->escape($this->url).
"'";
206 $sql.=
" ,target = '".$this->db->escape($this->target).
"'";
207 $sql.=
" ,title = '".$this->db->escape($this->title).
"'";
208 $sql.=
" ,favicon = '".$this->db->escape($this->favicon).
"'";
209 $sql.=
" ,position = '".$this->db->escape($this->position).
"'";
210 $sql.=
" WHERE rowid = ".$this->id;
213 if ($this->db->query($sql))
219 $this->error=$this->db->lasterror();
232 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"bookmark";
233 $sql .=
" WHERE rowid = ".$id;
236 $resql=$this->db->query($sql);
243 $this->error=$this->db->lasterror();
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->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) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
fetch($id)
Directs the bookmark.
Class to manage Dolibarr database access.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
static replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
Function used to replace a thirdparty id with another one.
create()
Insert bookmark into database.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
static commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
Function used to replace a thirdparty id with another one.
dol_now($mode='gmt')
Return date for now.
__construct($db)
Constructor.
update()
Update bookmark record.
getLibStatut($mode)
Return label of contact status.
Class to manage bookmarks.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)