From 15796ec5922264c56ad1585ba7e6453a8e4d4a26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 May 2014 12:19:45 +0200 Subject: [PATCH] Fix: checkstyle errors --- htdocs/core/class/commonobject.class.php | 16 +++++++++------- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/translate.class.php | 6 +++--- htdocs/core/lib/resource.lib.php | 8 +++++++- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7f13f128541..0a44be050e7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3290,9 +3290,11 @@ abstract class CommonObject * Add resources to the current object : add entry into llx_element_resources *Need $this->element & $this->id * - * @param int $resource_id Resource id + * @param int $resource_id Resource id * @param string $resource_element Resource element - * @return int <=0 if KO, >0 if OK + * @param int $busy Busy or not + * @param int $mandatory Mandatory or not + * @return int <=0 if KO, >0 if OK */ function add_element_resource($resource_id,$resource_element,$busy=0,$mandatory=0) { @@ -3327,7 +3329,7 @@ abstract class CommonObject return 0; } } - + /** * Delete a link to resource line * @@ -3339,12 +3341,12 @@ abstract class CommonObject function delete_resource($rowid, $element, $notrigger=0) { global $user,$langs,$conf; - + $error=0; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; $sql.= " WHERE rowid =".$rowid; - + dol_syslog(get_class($this)."::delete_resource sql=".$sql); if ($this->db->query($sql)) { @@ -3359,7 +3361,7 @@ abstract class CommonObject } // End call triggers } - + return 1; } else diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1de888a6f11..d3111d38a05 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3264,7 +3264,7 @@ class Form { global $conf,$langs,$user; - $langs->load_cache_currencies(''); + $langs->loadCacheCurrencies(''); $out=''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index a185433abef..a7cabd9468d 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -722,7 +722,7 @@ class Translate if (function_exists("mb_convert_encoding")) { - $this->load_cache_currencies($forceloadall?'':$currency_code); + $this->loadCacheCurrencies($forceloadall?'':$currency_code); if (isset($this->cache_currencies[$currency_code]) && ! empty($this->cache_currencies[$currency_code]['unicode']) && is_array($this->cache_currencies[$currency_code]['unicode'])) { @@ -742,7 +742,7 @@ class Translate * @param string $currency_code Get only currency. Get all if ''. * @return int Nb of loaded lines, 0 if already loaded, <0 if KO */ - public function load_cache_currencies($currency_code) + public function loadCacheCurrencies($currency_code) { global $db; @@ -754,7 +754,7 @@ class Translate if (! empty($currency_code)) $sql.=" AND code_iso = '".$currency_code."'"; //$sql.= " ORDER BY code_iso ASC"; // Not required, a sort is done later - dol_syslog(get_class($this).'::load_cache_currencies sql='.$sql, LOG_DEBUG); + dol_syslog(get_class($this).'::loadCacheCurrencies sql='.$sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index c516485ed9d..e92d59dcac7 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -17,11 +17,17 @@ */ /** - * \file lib/resource.lib.php + * \file htdocs/core/lib/resource.lib.php * \ingroup resource * \brief This file is library for resource module */ +/** + * Prepare head for tabs + * + * @param Object $object Object + * @return array Array of head entries + */ function resourcePrepareHead($object) { global $langs, $conf, $user;