Skip to content

Commit

Permalink
Qual: Remove errors reported by PHP Code Sniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 28, 2011
1 parent 76a6d6a commit bb41478
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
4 changes: 2 additions & 2 deletions htdocs/bookmarks/bookmarks.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
/**
* Add area with bookmarks in menu
*
* @param $aDb
* @param $aLangs
* @param DoliDb $aDb Database handler
* @param Translate $aLangs Object lang
* @return string
*/
function printBookmarksList ($aDb, $aLangs)
Expand Down
38 changes: 22 additions & 16 deletions htdocs/bookmarks/class/bookmark.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ class Bookmark


/**
* \brief Manufacturer
* \param db Handler for Database Access
* \param id Bookmark Id
* Constructor
*
* @param DoliDB $db Handler for Database Access
* @param int $id Bookmark Id
*/
function Bookmark($db, $id=-1)
{
Expand All @@ -52,8 +53,10 @@ function Bookmark($db, $id=-1)
}

/**
* \brief Directs the bookmark
* \param id Bookmark Id Loader
* Directs the bookmark
*
* @param int $id Bookmark Id Loader
* @return int <0 if KO, >0 if OK
*/
function fetch($id)
{
Expand All @@ -63,7 +66,7 @@ function fetch($id)
$sql.= " WHERE rowid = ".$id;

dol_syslog("Bookmark::fetch sql=".$sql, LOG_DEBUG);
$resql = $this->db->query ($sql);
$resql = $this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);
Expand All @@ -90,8 +93,9 @@ function fetch($id)
}

/**
* \brief Insere bookmark en base
* \return int <0 si ko, rowid du bookmark cree si ok
* Insert bookmark into database
*
* @return int <0 si ko, rowid du bookmark cree si ok
*/
function create()
{
Expand All @@ -114,7 +118,7 @@ function create()
$sql.= ")";

dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
$resql = $this->db->query ($sql);
$resql = $this->db->query($sql);
if ($resql)
{
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."bookmark");
Expand Down Expand Up @@ -142,8 +146,9 @@ function create()
}

/**
* \brief Update bookmark record
* \return int <0 si ko, >0 si ok
* Update bookmark record
*
* @return int <0 if KO, > if OK
*/
function update()
{
Expand All @@ -163,7 +168,7 @@ function update()
$sql.= " WHERE rowid = ".$this->id;

dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
if ($this->db->query ($sql))
if ($this->db->query($sql))
{
return 1;
}
Expand All @@ -175,17 +180,18 @@ function update()
}

/**
* \brief Removes the bookmark
* \param id Id removed bookmark
* \return int <0 si ko, >0 si ok
* Removes the bookmark
*
* @param int $id Id removed bookmark
* @return int <0 si ko, >0 si ok
*/
function remove($id)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark";
$sql .= " WHERE rowid = ".$id;

dol_syslog("Bookmark::remove sql=".$sql, LOG_DEBUG);
$resql=$this->db->query ($sql);
$resql=$this->db->query($sql);
if ($resql)
{
return 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/bookmarks/liste.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
$sql.= " WHERE 1=1";
if (! $user->admin) $sql.= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)";
$sql.= $db->order($sortfield.", position",$sortorder);
$sql.= $db->plimit( $limit, $offset);
$sql.= $db->plimit($limit, $offset);

$resql=$db->query($sql);
if ($resql)
Expand Down

0 comments on commit bb41478

Please sign in to comment.