';
// Zip / Town
@@ -609,7 +609,7 @@ else if ($id || $ref)
* @param Object $object Object we want to see categories it can be classified into
* @param int $typeid Type of category (0, 1, 2, 3)
* @param int $socid Id thirdparty
- * @param string $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
+ * @param int $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
* @return int 0
*/
function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index de8d494f9fc..f5828ecdea7 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -297,7 +297,6 @@ class Categorie extends CommonObject
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookCategorydao'));
$parameters=array();
- $action='update';
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
@@ -334,7 +333,7 @@ class Categorie extends CommonObject
* Delete a category from database
*
* @param User $user Object user that ask to delete
- * @return void
+ * @return int <0 KO >0 OK
*/
function delete($user)
{
@@ -689,7 +688,9 @@ class Categorie extends CommonObject
*/
function containsObject($type, $object_id)
{
- $field = ''; $classname = ''; $category_table = ''; $object_table = '';
+ $field = '';
+ $category_table = '';
+
if ($type == 'product') {
$field = 'product';
}
@@ -726,7 +727,7 @@ class Categorie extends CommonObject
/**
* Return childs of a category
*
- * @return void
+ * @return array|int <0 KO, array ok
*/
function get_filles()
{
@@ -1045,7 +1046,7 @@ class Categorie extends CommonObject
* Retourne les categories de premier niveau (qui ne sont pas filles)
*
* @param int $type Type of category
- * @return void
+ * @return array
*/
function get_main_categories($type=null)
{
@@ -1058,7 +1059,7 @@ class Categorie extends CommonObject
*
* @param string $sep Separator
* @param string $url Url
- * @return void
+ * @return array
*/
function print_all_ways($sep = " >> ", $url='')
{
@@ -1088,7 +1089,7 @@ class Categorie extends CommonObject
/**
* Retourne un tableau contenant la liste des categories meres
*
- * @return void
+ * @return int|array <0 KO, array OK
*/
function get_meres()
{
@@ -1123,7 +1124,7 @@ class Categorie extends CommonObject
* Retourne dans un tableau tous les chemins possibles pour arriver a la categorie
* en partant des categories principales, representes par des tableaux de categories
*
- * @return void
+ * @return array
*/
function get_all_ways()
{
@@ -1315,7 +1316,7 @@ class Categorie extends CommonObject
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
- $result=dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
+ dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage))
{
@@ -1560,8 +1561,6 @@ class Categorie extends CommonObject
*/
function initAsSpecimen()
{
- global $user,$langs,$conf;
-
dol_syslog(get_class($this)."::initAsSpecimen");
// Initialise parametres
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index c54d7d889b2..36a44f4bdda 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -66,7 +66,9 @@ if ($id > 0)
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
- if ($object->id) $result = $object->add_photo($upload_dir, $_FILES['userfile']);
+ if ($object->id) {
+ $object->add_photo($upload_dir, $_FILES['userfile']);
+ }
}
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 5448666dbdb..c02df68db2c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2794,7 +2794,7 @@ class Form
* @param string $htmlname HTML field name
* @param int $maxlength Maximum length for labels
* @param int $excludeafterid Exclude all categories after this leaf in category tree.
- * @return void
+ * @return string
* @see select_categories
*/
function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0)