Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/langs/fr_FR/admin.lang
	htdocs/projet/graph_opportunities.inc.php
	htdocs/user/class/usergroup.class.php
This commit is contained in:
Laurent Destailleur 2021-01-14 14:09:09 +01:00
commit 16d98d2691
4 changed files with 22 additions and 13 deletions

View File

@ -224,6 +224,7 @@ Value=Value
PersonalValue=Personal value
NewObject=New %s
NewValue=New value
OldValue=Old value %s
CurrentValue=Current value
Code=Code
Type=Type

View File

@ -875,7 +875,7 @@ Permission773=Supprimer les notes de frais
Permission774=Lire toutes les notes de frais (même pour les utilisateurs en dehors de ma hierarchie)
Permission775=Approuver les notes de frais
Permission776=Payer les notes de frais
Permission777=Lisez les notes de frais de tout le monde
Permission777=Lire les notes de frais de tout le monde
Permission778=Créer / modifier les notes de frais de tout le monde
Permission779=Exporter les notes de frais
Permission1001=Consulter les stocks

View File

@ -20,9 +20,8 @@
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
{
$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown
$sql .= " WHERE p.entity IN (".getEntity('project').")";
$sql .= " AND p.fk_opp_status = cls.rowid";
$sql .= " AND p.fk_statut = 1"; // Opend projects only
if ($mine || empty($user->rights->projet->all->lire)) $sql .= " AND p.rowid IN (".$projectsListId.")";
if ($socid) $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
@ -64,16 +63,25 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
$ponderated_opp_amount = $ponderated_opp_amount / 100;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n";
$listofstatus = array_keys($listofoppstatus);
foreach ($listofstatus as $status)
{
$labelStatus = '';
print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n";
$listofstatus = array_keys($listofoppstatus);
// Complete with values found into database and not into the dictionary
foreach($valsamount as $key => $val) {
if (!in_array($key, $listofstatus)) {
$listofstatus[] = $key;
}
}
foreach ($listofstatus as $status)
{
$labelStatus = '';
$code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code');
if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];
if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];
if (empty($labelStatus)) $labelStatus = $langs->transnoentitiesnoconv('OldValue', $status); // When id is id of an entry no more in dictionary for example.
//$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';
//$labelStatus .= ' - '.price2num($listofoppstatus[$status]).'%';

View File

@ -656,8 +656,8 @@ class UserGroup extends CommonObject
{
global $user, $conf;
if (!empty($this->name)) {
$this->nom = $this->name; // Field for 'name' is called 'nom' in database
if (empty($this->nom) && !empty($this->name)) {
$this->nom = $this->name;
}
return $this->updateCommon($user, $notrigger);