diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index bf70f5469ff..b3595c3b43f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -739,7 +739,7 @@ class BOM extends CommonObject $this->db->begin(); - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new BOMLine($this->db); $line->fetch($rowid); $line->fetch_optionals(); @@ -823,7 +823,7 @@ class BOM extends CommonObject $this->db->begin(); - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new BOMLine($this->db); $line->fetch($idline); $line->fetch_optionals(); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 97b85792520..2a9e52454df 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -273,9 +273,9 @@ class Categorie extends CommonObject public $childs = array(); /** - * @var ?array{string,array{label:string,description:string,note?:string}} multilangs + * @var ?array Array for multilangs */ - public $multilangs; + public $multilangs = array(); /** * @var int imgWidth @@ -1008,7 +1008,7 @@ class Categorie extends CommonObject * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * @return int<-1,0>|array,visible:int,ref_ext:string,multilangs?:array{string,array{label:string,description:string,note?:string}}}> Array of categories, 0 if no cat, -1 on error + * @return int<-1,0>|array,visible:int,ref_ext:string,multilangs?:array}> Array of categories, 0 if no cat, -1 on error */ public function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 5cf2c238a33..f84defd8390 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -954,7 +954,7 @@ class Propal extends CommonObject $price = (float) $pu - $remise; } - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new PropaleLigne($this->db); $line->fetch($rowid); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 369b7844172..14b44008580 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3230,7 +3230,7 @@ class Commande extends CommonOrder $price = ((float) $pu - $remise); } - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new OrderLine($this->db); $line->fetch($rowid); $line->fetch_optionals(); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4ba7a029122..748ca9a08c8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4248,7 +4248,7 @@ class Facture extends CommonInvoice } $price = price2num($price); - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new FactureLigne($this->db); $line->fetch($rowid); $line->fetch_optionals(); diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index ac0ecf9fc24..df41eeebf65 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2011 Regis Houssin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,6 +54,10 @@ function categories_prepare_head(Categorie $object, $type) if (getDolGlobalInt('MAIN_MULTILANGS')) { $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type; $head[$h][1] = $langs->trans("Translation"); + $nbTranslations = (!is_null($object->multilangs) && is_countable($object->multilangs)) ? count($object->multilangs) : 0; + if ($nbTranslations > 0) { + $head[$h][1] .= ''.$nbTranslations.''; + } $head[$h][2] = 'translation'; $h++; } diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 53383acad48..18e34ae02ea 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -7,6 +7,7 @@ * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024 Jean-Rémi TAPONIER * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -94,6 +95,10 @@ function product_prepare_head($object) if (getDolGlobalInt('MAIN_MULTILANGS')) { $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id; $head[$h][1] = $langs->trans("Translations"); + $nbTranslations = !empty($object->multilangs) ? count($object->multilangs) : 0; + if ($nbTranslations > 0) { + $head[$h][1] .= ''.$nbTranslations.''; + } $head[$h][2] = 'translation'; $h++; } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 04dd9a1a2c0..ca614d62b41 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3021,7 +3021,7 @@ class CommandeFournisseur extends CommonOrder $localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; $localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $this->line = new CommandeFournisseurLigne($this->db); $this->line->fetch($rowid); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2d0241ae5f6..6a9a0bdb36e 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2425,7 +2425,7 @@ class FactureFournisseur extends CommonInvoice $info_bits = 0; } - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new SupplierInvoiceLine($this->db); $line->fetch($id); $line->fetch_optionals(); diff --git a/htdocs/index.php b/htdocs/index.php index 0152b6e5fe1..3e26957e650 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2015 Marcos García - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2024 MDW * Copyright (C) 2024 Alexandre Spangaro * @@ -174,7 +174,7 @@ $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD') && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { $showweather = (!getDolGlobalString('MAIN_DISABLE_METEO') || getDolGlobalInt('MAIN_DISABLE_METEO') == 2) ? 1 : 0; - //Array that contains all WorkboardResponse classes to process them + // Array that contains all WorkboardResponse classes to process them $dashboardlines = array(); // Do not include sections without management permission diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index d400c8e46f1..1424f305489 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -788,7 +788,7 @@ class SupplierProposal extends CommonObject $pu = $pu_ttc; } - //Fetch current line from the database and then clone the object and set it in $oldline property + // Fetch current line from the database and then clone the object and set it in $oldline property $line = new SupplierProposalLine($this->db); $line->fetch($rowid); $line->fetch_optionals(); diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 9f12cab929f..696804b52ff 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -641,7 +641,7 @@ class ProductAttribute extends CommonObject $this->db->begin(); - //Fetch current line from the database and then clone the object and set it in $oldcopy property + // Fetch current line from the database and then clone the object and set it in $oldcopy property $this->line = new ProductAttributeValue($this->db); // Position to use @@ -691,7 +691,7 @@ class ProductAttribute extends CommonObject $this->db->begin(); - //Fetch current line from the database and then clone the object and set it in $oldcopy property + // Fetch current line from the database and then clone the object and set it in $oldcopy property $this->line = new ProductAttributeValue($this->db); $result = $this->line->fetch($lineid); if ($result > 0) { @@ -732,7 +732,7 @@ class ProductAttribute extends CommonObject $this->db->begin(); - //Fetch current line from the database + // Fetch current line from the database $this->line = new ProductAttributeValue($this->db); $result = $this->line->fetch($lineid); if ($result > 0) {