mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
add translations count (#31398)
This commit is contained in:
parent
6f6826e387
commit
0b1d243a7a
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -273,9 +273,9 @@ class Categorie extends CommonObject
|
|||
public $childs = array();
|
||||
|
||||
/**
|
||||
* @var ?array{string,array{label:string,description:string,note?:string}} multilangs
|
||||
* @var ?array<string,array{label:string,description:string,note?:string}> 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<int,array{id:int,fk_parent:int,label:string,description:string,color:string,position:int,socid:int,type:string,entity:int,array_options:array<string,mixed>,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<int,array{id:int,fk_parent:int,label:string,description:string,color:string,position:int,socid:int,type:string,entity:int,array_options:array<string,mixed>,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
|
||||
*/
|
||||
public function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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] .= '<span class="badge marginleftonlyshort">'.$nbTranslations.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'translation';
|
||||
$h++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 Jean-Rémi TAPONIER <jean-remi@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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] .= '<span class="badge marginleftonlyshort">'.$nbTranslations.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'translation';
|
||||
$h++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user