From ec5e84075e32f571d036beedb9fb3afecbfb23e7 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 3 May 2018 10:18:38 +0200 Subject: [PATCH 1/9] NEW Rights to ignore price min --- htdocs/comm/propal/card.php | 4 ++-- htdocs/commande/card.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/fiche-rec.php | 4 ++-- htdocs/contrat/card.php | 2 +- htdocs/core/modules/modProduct.class.php | 7 +++++++ htdocs/langs/fr_FR/admin.lang | 1 + 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 004b32a83fc..e61863b0697 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -967,7 +967,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) { + if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -1087,7 +1087,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { + if (empty($user->rights->produit->ignore_price_min) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error ++; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 76a290a79cd..45953815fff 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -902,7 +902,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) { + if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -1023,7 +1023,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { + if (empty($user->rights->produit->ignore_price_min) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dbce9c2e76d..293fa784adf 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1839,7 +1839,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) { + if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -1984,7 +1984,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { + if (empty($user->rights->produit->ignore_price_min) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error ++; } diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 1fc7fa1fb96..8c918f77cac 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -666,7 +666,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) + if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); @@ -833,7 +833,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) + if (empty($user->rights->produit->ignore_price_min) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error ++; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d474da18a85..4dbbb32e915 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -564,7 +564,7 @@ if (empty($reshook)) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) + if (empty($user->rights->produit->ignore_price_min) && ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) { $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); $result = -1 ; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index bfbc28d8321..665ed9ba2bc 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -129,6 +129,13 @@ class modProduct extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'export'; $r++; + + $this->rights[$r][0] = 39; + $this->rights[$r][1] = 'Ignore minimum price'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'ignore_price_min'; + $r++; // Menus //------- diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 49a80dabe7a..837940a7bea 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -645,6 +645,7 @@ Permission32=Créer/modifier les produits Permission34=Supprimer les produits Permission36=Voir/gérer les produits cachés Permission38=Exporter les produits +Permission39=Outrepasser le prix de vente minimum d'un produit Permission41=Lire les projets et tâches (partagés ou dont vous êtes un contact). Permet la saisie de temps passé, par vous et votre hiérarchie (vos subordonnés), sur les tâches assignées. Permission42=Créer/modifier les projets (projets partagés et projets pour lesquels je suis contact). Permet aussi de créer des tâches et d'assigner des utilisateurs aux projets et tâches. Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact) From 8cd6c72a2fea1bf611da2ffe683c163d36590305 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 7 May 2018 10:04:43 +0200 Subject: [PATCH 2/9] NEW advanced rights --- htdocs/comm/propal/card.php | 5 ++--- htdocs/commande/card.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/fiche-rec.php | 4 ++-- htdocs/contrat/card.php | 2 +- htdocs/core/modules/modProduct.class.php | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e61863b0697..bfd46d4c836 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -967,7 +967,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -1086,8 +1086,7 @@ if (empty($reshook)) $price_min = $product->multiprices_min [$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - - if (empty($user->rights->produit->ignore_price_min) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error ++; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 45953815fff..956c7321180 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -902,7 +902,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -1023,7 +1023,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - if (empty($user->rights->produit->ignore_price_min) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 293fa784adf..3996883f1eb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1839,7 +1839,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -1984,7 +1984,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (empty($user->rights->produit->ignore_price_min) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error ++; } diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 8c918f77cac..36b9cb3462d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -666,7 +666,7 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if (empty($user->rights->produit->ignore_price_min) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); @@ -833,7 +833,7 @@ if (empty($reshook)) $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (empty($user->rights->produit->ignore_price_min) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error ++; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4dbbb32e915..baafdbf5c8a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -564,7 +564,7 @@ if (empty($reshook)) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if (empty($user->rights->produit->ignore_price_min) && ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) { $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); $result = -1 ; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 665ed9ba2bc..5020efec241 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -134,7 +134,7 @@ class modProduct extends DolibarrModules $this->rights[$r][1] = 'Ignore minimum price'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'ignore_price_min'; + $this->rights[$r][4] = 'ignore_price_min_advance'; $r++; // Menus From c2e23954157ac2d17e57bb2db27936d1a2518d50 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 21 Sep 2018 09:18:12 +0200 Subject: [PATCH 3/9] Comment and typo --- htdocs/adherents/card.php | 10 +++++++--- htdocs/adherents/class/adherent.class.php | 1 + htdocs/adherents/subscription.php | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 3d3c8fb6e54..fd465dd1803 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -622,8 +622,9 @@ if (empty($reshook)) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; @@ -693,8 +694,9 @@ if (empty($reshook)) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; @@ -1384,6 +1386,7 @@ else // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -1444,8 +1447,9 @@ else // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f3e4e4d0df8..a4e80d3b626 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2628,6 +2628,7 @@ class Adherent extends CommonObject // Send reminder email $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 78a7ce8495f..08c3c3c87f5 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -359,8 +359,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; @@ -1053,8 +1054,9 @@ if ($rowid > 0) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; From bde8d8ae0e28818787c932c36f720b3a138f7541 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 21 Sep 2018 09:32:50 +0200 Subject: [PATCH 4/9] Comment and typo --- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- .../contract/doc/doc_generic_contract_odt.modules.php | 1 + htdocs/core/modules/contract/doc/pdf_strato.modules.php | 4 ++-- htdocs/core/modules/dons/html_cerfafr.modules.php | 1 + .../expedition/doc/doc_generic_shipment_odt.modules.php | 1 + htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- .../core/modules/expensereport/doc/pdf_standard.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f62b699b4ef..9b49be6063f 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -114,7 +114,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "withdrawals", "companies", "projects", "bills")); if (! empty($conf->bank->dir_output)) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9cbd5f31959..c7c032bbddc 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1239,7 +1239,7 @@ class pdf_einstein extends ModelePDFCommandes { global $conf,$langs,$hookmanager; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 5ba56d8b73d..4e8036c7eea 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -216,6 +216,7 @@ class doc_generic_contract_odt extends ModelePDFContract $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->contrat->dir_output) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c7c393c96e3..fe0a79c6c8e 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -180,7 +180,7 @@ class pdf_strato extends ModelePDFContract // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "contracts")); if ($conf->contrat->dir_output) @@ -542,7 +542,7 @@ class pdf_strato extends ModelePDFContract $default_font_size = pdf_getPDFFontSize($outputlangs); - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "contract", "companies")); pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 3890c03ba62..8f6c10119c4 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -83,6 +83,7 @@ class html_cerfafr extends ModeleDon if (! is_object($outputlangs)) $outputlangs=$langs; + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "donations")); $currency = !empty($currency) ? $currency : $conf->currency; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 53738f23df2..8277ff40820 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -227,6 +227,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->expedition->dir_output."/sending") diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 68f6f544fc4..3d786bf111d 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -165,7 +165,7 @@ class pdf_merou extends ModelePdfExpedition // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); if ($conf->expedition->dir_output) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 8086667a4f5..e4ded69fe9c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -196,7 +196,7 @@ class pdf_rouget extends ModelePdfExpedition // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); $nblignes = count($object->lines); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index ec06221e5de..0cfa9fddb5c 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -211,7 +211,7 @@ class pdf_standard extends ModeleExpenseReport // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "trips", "projects", "dict")); $nblignes = count($object->lines); @@ -568,9 +568,9 @@ class pdf_standard extends ModeleExpenseReport */ function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { - global $conf,$langs,$hookmanager; + global $conf, $langs, $hookmanager; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "trips", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 7d39969ece9..555e2f76ee0 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -239,7 +239,7 @@ class pdf_crabe extends ModelePDFFactures // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); $nblignes = count($object->lines); @@ -1574,7 +1574,7 @@ class pdf_crabe extends ModelePDFFactures { global $conf, $langs; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "bills", "propal", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index c51e0452481..f9576a974f1 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -172,7 +172,7 @@ class pdf_soleil extends ModelePDFFicheinter // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "interventions", "dict", "companies")); if ($conf->ficheinter->dir_output) From 9fab0a1d457a76bdffecb2ba8ad367278ba6d773 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 21 Sep 2018 14:16:22 +0200 Subject: [PATCH 5/9] Update comments --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/livraison/doc/pdf_typhon.modules.php | 2 +- .../modules/product/doc/doc_generic_product_odt.modules.php | 1 + .../modules/project/task/doc/doc_generic_task_odt.modules.php | 1 + .../usergroup/doc/doc_generic_usergroup_odt.modules.php | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index c7c032bbddc..05231f7e9d7 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -224,7 +224,7 @@ class pdf_einstein extends ModelePDFCommandes // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); $nblignes = count($object->lines); diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index ae0dcb6a74f..8b8c629c30b 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -195,7 +195,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "sendings", "deliveries")); if ($conf->expedition->dir_output) diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 1ee00f486e5..82b33d35240 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -240,6 +240,7 @@ class doc_generic_product_odt extends ModelePDFProduct $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->produit->dir_output) diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index d76ae3b586a..425f9ad1b18 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -445,6 +445,7 @@ class doc_generic_task_odt extends ModelePDFTask $sav_charset_output=$outputlangs->charset_output; $outputlangs->charset_output='UTF-8'; + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 798231ed688..b89f68d755b 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -44,9 +44,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** From 2afaccf09923aa021608ddc415d2aa9ddf1816d0 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 21 Sep 2018 14:32:31 +0200 Subject: [PATCH 6/9] Update mod_ticket_universal.php --- htdocs/core/modules/ticket/mod_ticket_universal.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 409aa2daf00..a8170935eb0 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -33,20 +33,11 @@ class mod_ticket_universal extends ModeleNumRefTicket * Dolibarr version of the loaded document * @public string */ - public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' -<<<<<<< HEAD -<<<<<<< HEAD /** * @var string Error code (or message) */ -======= ->>>>>>> upstream/develop -======= - /** - * @var string Error code (or message) - */ ->>>>>>> d5003c9d3c507b5064a1f8e96a1ae9a019b6a5e9 public $error = ''; /** From 0bcec6c923098a9297d34baeb63a431e8ffcb8f5 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 21 Sep 2018 14:33:48 +0200 Subject: [PATCH 7/9] Update doc_generic_user_odt.modules.php --- .../modules/user/doc/doc_generic_user_odt.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index bce2aca823a..ac69176b1c1 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -42,15 +42,15 @@ class doc_generic_user_odt extends ModelePDFUser public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** - * Dolibarr version of the loaded document - * @public string - */ + * Dolibarr version of the loaded document + * @public string + */ public $version = 'dolibarr'; From 870f504633ac8ac688d5ebce2aad3546c4d6cab8 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 21 Sep 2018 14:34:30 +0200 Subject: [PATCH 8/9] Update doc_generic_usergroup_odt.modules.php --- .../doc/doc_generic_usergroup_odt.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index b89f68d755b..53e42d46832 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -44,15 +44,15 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup public $emetteur; /** - * @var array() Minimum version of PHP required by module. + * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) - */ + */ public $phpmin = array(5, 4); /** - * Dolibarr version of the loaded document - * @public string - */ + * Dolibarr version of the loaded document + * @public string + */ public $version = 'dolibarr'; From 3464afe391f8d536fdbbf6fc544985651aadf7d2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 21 Sep 2018 15:12:17 +0200 Subject: [PATCH 9/9] Update comment --- .../modules/supplier_proposal/doc/pdf_aurore.modules.php | 6 +++--- htdocs/core/tpl/card_presend.tpl.php | 1 + htdocs/public/members/new.php | 3 ++- htdocs/public/payment/paymentok.php | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index c20e57f2d5c..31097dd8c34 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -214,7 +214,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal")); $nblignes = count($object->lines); @@ -1280,9 +1280,9 @@ class pdf_aurore extends ModelePDFSupplierProposal */ function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { - global $conf,$langs; + global $conf, $langs; - // Translations + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index b6f11828ffe..4a4301c5a5f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -74,6 +74,7 @@ if ($action == 'presend') { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($newlang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions')); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 7e09e990221..0ced86fdd67 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -277,8 +277,9 @@ if ($action == 'add') // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index b46f651f9b4..20a0cacd2e8 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -500,8 +500,9 @@ if ($ispaymentok) // Set output language $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); - // Get email content from templae + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;