From 3215e066e49b74e71a51ab2f4b1ecd2477396f09 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 10:00:44 +0100 Subject: [PATCH 001/233] copy linked categories when cloning a product --- htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 14 ++++++++++++++ htdocs/product/class/product.class.php | 26 ++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 401ccc5462e..9c96f12c589 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -147,6 +147,7 @@ RowMaterial=Raw Material CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service +CloneCategoriesProduct=Clone tags/categories linked ClonePricesProduct=Clone prices CloneCompositionProduct=Clone virtual product/service CloneCombinationsProduct=Clone product variants diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 77ad53a3eff..2339a0c921f 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -146,6 +146,7 @@ RowMaterial=Matière première CloneProduct=Cloner produit/service ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service +CloneCategoriesProduct=Cloner les catégories associées ClonePricesProduct=Cloner les prix CloneCompositionProduct=Cloner le produits packagés CloneCombinationsProduct=Cloner les variantes diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 18ea87cb03a..e433b9a6558 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -520,6 +520,19 @@ if (empty($reshook)) } } + if (GETPOST('clone_categories')) + { + $result = $object->clone_categories($originalId, $id); + + if ($result < 1) + { + $db->rollback(); + setEventMessage($langs->trans('ErrorProductClone'), null, 'errors'); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$originalId); + exit; + } + } + // $object->clone_fournisseurs($originalId, $id); $db->commit(); @@ -1982,6 +1995,7 @@ $formquestionclone=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), + array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), ); if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 51a5d7c72d0..3466625dfe5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3611,6 +3611,32 @@ class Product extends CommonObject return 1; } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * copy related categories to another product + * + * @param int $fromId Id produit source + * @param int $toId Id produit cible + * @return int < 0 si erreur, > 0 si ok + */ + function clone_categories($fromId, $toId) + { + $this->db->begin(); + + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'categorie_product (fk_categorie, fk_product)'; + $sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_product"; + $sql.= " WHERE fk_product = '".$fromId."'"; + + if (! $this->db->query($sql)) + { + $this->db->rollback(); + return -1; + } + + $this->db->commit(); + return 1; + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre From 08d517c053ebb4f8bd87d6edd3301505ce745c17 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 10:35:27 +0100 Subject: [PATCH 002/233] custom content was deleted --- htdocs/custom/.gitignore | 4 ++++ htdocs/custom/README.md | 22 ++++++++++++++++++++++ htdocs/custom/index.html | 0 3 files changed, 26 insertions(+) create mode 100644 htdocs/custom/.gitignore create mode 100644 htdocs/custom/README.md create mode 100644 htdocs/custom/index.html diff --git a/htdocs/custom/.gitignore b/htdocs/custom/.gitignore new file mode 100644 index 00000000000..9420e8c61eb --- /dev/null +++ b/htdocs/custom/.gitignore @@ -0,0 +1,4 @@ +/* +!.gitignore +!README.md +!index.html diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md new file mode 100644 index 00000000000..3a486e5a4a8 --- /dev/null +++ b/htdocs/custom/README.md @@ -0,0 +1,22 @@ +# DOLIBARR ERP & CRM custom directory for external modules. + +This directory is dedicated to store external modules. +To use it, just copy here the directory of the module into this directory. + +Note: On linux or MAC systems, it is better to unzip/store the external module directory into +a different place than this directory and just adding a symbolic link here to the htdocs directory +of the module. + +For example on Linux OS: Get the module from the command +mkdir ~/git; cd ~/git +git clone https://git.framasoft.org/p/newmodule/newmodule.git +Then create the symbolic link +ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule + +WARNING !!! +Check also that the /custom directory is active by adding into dolibarr conf/conf.php file the following +two lines, so dolibarr will also scan /custom directory to find external external modules: + +$dolibarr_main_url_root_alt='/custom'; +$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; + diff --git a/htdocs/custom/index.html b/htdocs/custom/index.html new file mode 100644 index 00000000000..e69de29bb2d From 7bc0260661a138193afa4a442a22dfdef51dc029 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2019 14:15:55 +0100 Subject: [PATCH 003/233] begin factorization of categories cloning --- htdocs/langs/en_US/categories.lang | 1 + htdocs/langs/fr_FR/categories.lang | 1 + htdocs/product/card.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index eb34e302cad..dd446249ebe 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -88,3 +88,4 @@ AddProductServiceIntoCategory=Add the following product/service ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category +CloneCategoriesProduct=Clone tags/categories linked diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index b65024a5217..9d58f0ff40d 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -88,3 +88,4 @@ AddProductServiceIntoCategory=Ajouter le produit/service suivant ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste ChooseCategory=Choisissez une catégorie +CloneCategories=Cloner les catégories associées diff --git a/htdocs/product/card.php b/htdocs/product/card.php index e433b9a6558..9becc71bbb8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1995,7 +1995,7 @@ $formquestionclone=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), - array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), + array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategories"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), ); if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) From 61f9aac887f9755531884043abe5a11e091e51d3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2019 14:16:41 +0100 Subject: [PATCH 004/233] begin factorization of categories cloning --- htdocs/langs/en_US/products.lang | 1 - htdocs/langs/fr_FR/products.lang | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 9c96f12c589..401ccc5462e 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -147,7 +147,6 @@ RowMaterial=Raw Material CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service -CloneCategoriesProduct=Clone tags/categories linked ClonePricesProduct=Clone prices CloneCompositionProduct=Clone virtual product/service CloneCombinationsProduct=Clone product variants diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 2339a0c921f..77ad53a3eff 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -146,7 +146,6 @@ RowMaterial=Matière première CloneProduct=Cloner produit/service ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service -CloneCategoriesProduct=Cloner les catégories associées ClonePricesProduct=Cloner les prix CloneCompositionProduct=Cloner le produits packagés CloneCombinationsProduct=Cloner les variantes From f167ad910e280172e2384b771593f999424d02db Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:30:51 +0200 Subject: [PATCH 005/233] camelCase and generic cloneCategories function --- htdocs/core/class/commonobject.class.php | 31 ++++++++++++++++++++++++ htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 4 +-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e962e59264c..ccf255af4d7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7517,4 +7517,35 @@ abstract class CommonObject } } } + + /** + * copy related categories to another object + * + * @param int $fromId Id object source + * @param int $toId Id object cible + * @param string $type Type of category ('product', ...) + * @return int < 0 si erreur, > 0 si ok + */ + function cloneCategories($fromId, $toId, $type='') + { + $this->db->begin(); + + if (empty($type)) $type = $this->table_element; + + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $categorystatic = new Categorie($this->db); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type] . " (fk_categorie, fk_product)"; + $sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type]; + $sql.= " WHERE fk_product = '".$fromId."'"; + + if (! $this->db->query($sql)) + { + $this->db->rollback();die($sql); + return -1; + } + + $this->db->commit(); + return 1; + } } diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 401ccc5462e..62c22548f36 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -148,6 +148,7 @@ CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service ClonePricesProduct=Clone prices +CloneCategoriesProduct=Clone tags/categories linked CloneCompositionProduct=Clone virtual product/service CloneCombinationsProduct=Clone product variants ProductIsUsed=This product is used diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 77ad53a3eff..be288c604af 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -147,6 +147,7 @@ CloneProduct=Cloner produit/service ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service ClonePricesProduct=Cloner les prix +CloneCategoriesProduct=Cloner les catégories associées CloneCompositionProduct=Cloner le produits packagés CloneCombinationsProduct=Cloner les variantes ProductIsUsed=Ce produit est utilisé diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9becc71bbb8..5354fcde70f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -522,7 +522,7 @@ if (empty($reshook)) if (GETPOST('clone_categories')) { - $result = $object->clone_categories($originalId, $id); + $result = $object->cloneCategories($originalId, $id); if ($result < 1) { @@ -1995,7 +1995,7 @@ $formquestionclone=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), - array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategories"), 'value' => 1), + array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), ); if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) From d0fcece6130dcfb99504a5a824c8414879d23055 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:34:23 +0200 Subject: [PATCH 006/233] dont make generic translations --- htdocs/langs/en_US/categories.lang | 1 - htdocs/langs/fr_FR/categories.lang | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index dd446249ebe..eb34e302cad 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -88,4 +88,3 @@ AddProductServiceIntoCategory=Add the following product/service ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category -CloneCategoriesProduct=Clone tags/categories linked diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 9d58f0ff40d..b65024a5217 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -88,4 +88,3 @@ AddProductServiceIntoCategory=Ajouter le produit/service suivant ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste ChooseCategory=Choisissez une catégorie -CloneCategories=Cloner les catégories associées From 45b3a0588f6b02b6bffdfcc2cdc5856d243a3281 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:40:57 +0200 Subject: [PATCH 007/233] remove old dev --- htdocs/product/class/product.class.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3466625dfe5..0087be5eab5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3612,31 +3612,6 @@ class Product extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * copy related categories to another product - * - * @param int $fromId Id produit source - * @param int $toId Id produit cible - * @return int < 0 si erreur, > 0 si ok - */ - function clone_categories($fromId, $toId) - { - $this->db->begin(); - - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'categorie_product (fk_categorie, fk_product)'; - $sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_product"; - $sql.= " WHERE fk_product = '".$fromId."'"; - - if (! $this->db->query($sql)) - { - $this->db->rollback(); - return -1; - } - - $this->db->commit(); - return 1; - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre From 8e2ef8e56cf807e56e3ef949142dfd7c95e25af5 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 5 Apr 2019 11:42:12 +0200 Subject: [PATCH 008/233] remove old dev --- htdocs/product/class/product.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0087be5eab5..51a5d7c72d0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3611,7 +3611,6 @@ class Product extends CommonObject return 1; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre From 7a651b50719a74bfcd795b8a59efc18933230f15 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 26 Apr 2019 13:53:22 +0200 Subject: [PATCH 009/233] New: Add ref_client field on template invoice --- .../facture/class/facture-rec.class.php | 6 ++++- htdocs/compta/facture/class/facture.class.php | 1 + htdocs/compta/facture/fiche-rec.php | 22 ++++++++++++++++--- .../install/mysql/migration/9.0.0-10.0.0.sql | 1 + .../install/mysql/tables/llx_facture_rec.sql | 1 + 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 89f324d2450..eba6fa42288 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -77,6 +77,7 @@ class FactureRec extends CommonInvoice public $total; public $db_table; public $propalid; + public $ref_client; public $date_last_gen; public $date_when; @@ -166,6 +167,7 @@ class FactureRec extends CommonInvoice $sql.= ", fk_account"; $sql.= ", fk_cond_reglement"; $sql.= ", fk_mode_reglement"; + $sql.= ", ref_client"; $sql.= ", usenewprice"; $sql.= ", frequency"; $sql.= ", unit_frequency"; @@ -194,6 +196,7 @@ class FactureRec extends CommonInvoice $sql.= ", ".(! empty($facsrc->fk_account)?"'".$facsrc->fk_account."'":"null"); $sql.= ", ".($facsrc->cond_reglement_id > 0 ? $this->db->escape($facsrc->cond_reglement_id) : "null"); $sql.= ", ".($facsrc->mode_reglement_id > 0 ? $this->db->escape($facsrc->mode_reglement_id) : "null"); + $sql.= ",'".$this->db->escape($this->ref_client)."'"; $sql.= ", ".$this->usenewprice; $sql.= ", ".$this->frequency; $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; @@ -382,7 +385,7 @@ class FactureRec extends CommonInvoice $sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.modelpdf'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project'; - $sql.= ', f.fk_account'; + $sql.= ', f.fk_account, f.ref_client'; $sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.usenewprice, f.auto_validate'; $sql.= ', f.generate_pdf'; $sql.= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; @@ -1127,6 +1130,7 @@ class FactureRec extends CommonInvoice $facture->brouillon = 1; $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; + $facture->ref_client = $facturerec->ref_client; $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c2dc89c903e..9e9005d471d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -358,6 +358,7 @@ class Facture extends CommonInvoice $this->socid = $_facrec->socid; // Invoice created on same thirdparty than template $this->entity = $_facrec->entity; // Invoice created in same entity than template + $this->ref_client = $_facrec->ref_client; // Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_project; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index fa8af87ac29..25144edbcb3 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -174,6 +174,7 @@ if (empty($reshook)) if (! $error) { $object->titre = GETPOST('titre', 'alpha'); + $object->ref_client = GETPOST('ref_client', 'alpha'); $object->note_private = GETPOST('note_private', 'none'); $object->note_public = GETPOST('note_public', 'none'); $object->modelpdf = GETPOST('modelpdf', 'alpha'); @@ -274,7 +275,7 @@ if (empty($reshook)) { $object->setProject(GETPOST('projectid', 'int')); } - // Set bank account + // Set titre elseif ($action == 'setref' && $user->rights->facture->creer) { //var_dump(GETPOST('ref', 'alpha'));exit; @@ -286,6 +287,15 @@ if (empty($reshook)) } else dol_print_error($db, $object->error, $object->errors); } + elseif ($action == 'setref_client' && $user->rights->facture->creer) + { + $result=$object->setValueFrom('ref_client', GETPOST('ref_client', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); + if ($result > 0) + { + $object->ref_client = GETPOST('ref_client', 'alpha'); + } + else dol_print_error($db, $object->error, $object->errors); + } // Set bank account elseif ($action == 'setbankaccount' && $user->rights->facture->creer) { @@ -997,6 +1007,11 @@ if ($action == 'create') print ''; print ''; + // Ref Client + print ''.$langs->trans("RefCustomer").''; + print ''; + print ''; + // Third party print ''.$langs->trans("Customer").''.$object->thirdparty->getNomUrl(1, 'customer').''; print ''; @@ -1229,8 +1244,9 @@ else $morehtmlref.='
'; // Ref customer - //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1); - //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); + $morehtmlref.='
'; // Thirdparty $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 9aa395c22d6..49a19de5316 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -297,3 +297,4 @@ ALTER TABLE llx_inventorydet DROP COLUMN pmp; ALTER TABLE llx_inventorydet DROP COLUMN pa; ALTER TABLE llx_inventorydet DROP COLUMN new_pmp; +ALTER TABLE llx_facture_rec ADD COLUMN ref_client varchar(255) after suspended; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index 1add07c6e8c..2c1c2514488 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -29,6 +29,7 @@ create table llx_facture_rec tms timestamp, -- date creation/modification suspended integer DEFAULT 0, -- 1=suspended + ref_client varchar(255), -- reference for customer amount double(24,8) DEFAULT 0 NOT NULL, remise real DEFAULT 0, From be17e31be18e8bf2e126262f870b6b724b679a0b Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 2 May 2019 11:04:55 +0200 Subject: [PATCH 010/233] New: Add ref_client field on template invoice --- htdocs/compta/facture/fiche-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 25144edbcb3..fa71bdd7f2e 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1009,7 +1009,7 @@ if ($action == 'create') // Ref Client print ''.$langs->trans("RefCustomer").''; - print ''; + print ''; print ''; // Third party From d810e11c4ed967fff1533e003d6567504b31ab2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jun 2019 19:23:32 +0200 Subject: [PATCH 011/233] Update fiche-rec.php --- htdocs/compta/facture/fiche-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index fa71bdd7f2e..c9ee6e592ee 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -275,7 +275,7 @@ if (empty($reshook)) { $object->setProject(GETPOST('projectid', 'int')); } - // Set titre + // Set title/label of template invoice elseif ($action == 'setref' && $user->rights->facture->creer) { //var_dump(GETPOST('ref', 'alpha'));exit; From b70587c150a4a6cfa9a3438cb80736b6a958216a Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 4 Sep 2019 15:14:16 +0200 Subject: [PATCH 012/233] NEW check if a resource is in use in an event --- htdocs/admin/resource.php | 9 ++ htdocs/comm/action/card.php | 58 ++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/resource.lang | 3 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/resource.lang | 3 + htdocs/resource/element_resource.php | 132 +++++++++++++++++++++++++-- 7 files changed, 199 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index a5a0b5fbf3f..3dfd8e1e2c2 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -127,6 +127,15 @@ print ''; print ''; print ''; + +print ''; +print ''.$langs->trans('EnableResourceUsedInEventCheck').''; +print ''; +echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK'); +print ''; +print ''; +print ''; + print ''; print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index af54186e255..f7111ccf545 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -512,6 +512,64 @@ if ($action == 'update') $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; + if (!$error) { + // check if an event resource is already in use + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE ac.id != " . $object->id; + $sql .= " AND er.resource_id IN ("; + $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " WHERE er.element_id = " . $object->id; + $sql .= " AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= ")"; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + } + $db->free($resql); + } + + if ($error) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } + if (! $error) { $db->begin(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f59f4449b8e..e06eafd81be 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1900,6 +1900,7 @@ ResourceSetup=Configuration of Resource module UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts +EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both) diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index 33a5046e006..134cc4c87a3 100644 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -34,3 +34,6 @@ IdResource=Id resource AssetNumber=Serial number ResourceTypeCode=Resource type code ImportDataset_resource_1=Resources + +ErrorResourcesAlreadyInUse=Some resources are in use +ErrorResourceUseInEvent=%s use in %s event \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 7407396835b..be8e67e3359 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1896,6 +1896,7 @@ ResourceSetup=Configuration du module Ressource UseSearchToSelectResource=Utilisez un champ avec auto-complétion pour choisir les ressources (plutôt qu'une liste déroulante). DisabledResourceLinkUser=Désactiver la fonctionnalité pour lier une ressource aux utilisateurs DisabledResourceLinkContact=Désactiver la fonctionnalité pour lier une ressource aux contacts/adresses +EnableResourceUsedInEventCheck=Activer la fonctionnalité de vérification d'une ressource déjà réservée lors d'un évènement ConfirmUnactivation=Confirmer réinitialisation du module OnMobileOnly=Sur petit écran (smartphone) uniquement DisableProspectCustomerType=Désactiver le type de tiers "Prospect + Client" (le tiers doit donc être un client potentiel ou un client, mais ne peut pas être les deux) diff --git a/htdocs/langs/fr_FR/resource.lang b/htdocs/langs/fr_FR/resource.lang index be7547b36da..5db22aedcbd 100644 --- a/htdocs/langs/fr_FR/resource.lang +++ b/htdocs/langs/fr_FR/resource.lang @@ -34,3 +34,6 @@ IdResource=id ressource AssetNumber=Numéro de série ResourceTypeCode=Code de type de ressource ImportDataset_resource_1=Ressources + +ErrorResourcesAlreadyInUse=Des ressources sont déjà occupées +ErrorResourceUseInEvent=%s occupée dans l'événement %s \ No newline at end of file diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 02565a23dd0..e55399f2da4 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -87,6 +87,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + $error = 0; + if ($action == 'add_element_resource' && ! $cancel) { $res = 0; @@ -100,8 +102,68 @@ if (empty($reshook)) { $objstat = fetchObjectByElement($element_id, $element, $element_ref); $objstat->element = $element; // For externals module, we need to keep @xx - $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory); + + // TODO : add this check at update_linked_resource and when modifying event start or end date + // check if an event resource is already in use + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='dolresource' && intval($busy)==1) { + $eventDateStart = $objstat->datep; + $eventDateEnd = $objstat->datef; + $isFullDayEvent = intval($objstat->fulldayevent); + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($objstat->element) . "'"; + $sql .= " WHERE er.resource_id = " . $resource_id; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $objstat->error = $db->lasterror(); + $objstat->errors[] = $objstat->error; + } else { + if ($db->num_rows($resql)>0) { + // already in use + $error++; + $objstat->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $objstat->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $objstat->errors[] = $objstat->error; + } + $db->free($resql); + } + } + + if (!$error) { + $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory); + } } + if (! $error && $res > 0) { setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs'); @@ -123,18 +185,72 @@ if (empty($reshook)) $object->busy = $busy; $object->mandatory = $mandatory; - $result = $object->update_element_resource($user); + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='dolresource' && intval($object->busy)==1) { + $eventDateStart = $object->objelement->datep; + $eventDateEnd = $object->objelement->datef; + $isFullDayEvent = intval($objstat->fulldayevent); + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } - if ($result >= 0) - { + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($object->resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element_type) . "'"; + $sql .= " WHERE er.resource_id = " . $object->resource_id; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql)>0) { + // already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $objstat->error; + } + $db->free($resql); + } + } + + if (!$error) { + $result = $object->update_element_resource($user); + if ($result < 0) $error++; + } + + if ($error) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { setEventMessages($langs->trans('RessourceLineSuccessfullyUpdated'), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); exit; } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } } } From 4ef7e755ad56dc76eb2319f3a87a8fe819f20055 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 5 Sep 2019 09:29:40 +0200 Subject: [PATCH 013/233] FIX only check on busy resources before updating an event --- htdocs/comm/action/card.php | 7 ++++--- htdocs/resource/element_resource.php | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f7111ccf545..ed0ad19b96d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -524,9 +524,10 @@ if ($action == 'update') $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; $sql .= " WHERE ac.id != " . $object->id; $sql .= " AND er.resource_id IN ("; - $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources as er"; - $sql .= " WHERE er.element_id = " . $object->id; - $sql .= " AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources"; + $sql .= " WHERE element_id = " . $object->id; + $sql .= " AND element_type = '" . $db->escape($object->element) . "'"; + $sql .= " AND busy = 1"; $sql .= ")"; $sql .= " AND er.busy = 1"; $sql .= " AND ("; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index e55399f2da4..07bcdb3fd99 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -202,6 +202,7 @@ if (empty($reshook)) $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($object->resource_type) . "'"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element_type) . "'"; $sql .= " WHERE er.resource_id = " . $object->resource_id; + $sql .= " AND ac.id != " . $object->element_id; $sql .= " AND er.busy = 1"; $sql .= " AND ("; From 9ed09db93cd5f1c263ba4b231fb046c618825fa4 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 5 Sep 2019 09:41:15 +0200 Subject: [PATCH 014/233] FIX replace "
" by "
" --- htdocs/comm/action/card.php | 2 +- htdocs/resource/element_resource.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index ed0ad19b96d..44d6b000efe 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -558,7 +558,7 @@ if ($action == 'update') $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; while ($obj = $db->fetch_object($resql)) { - $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); } $object->errors[] = $object->error; } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 07bcdb3fd99..bb9a54a9bf0 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -151,7 +151,7 @@ if (empty($reshook)) $error++; $objstat->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; while ($obj = $db->fetch_object($resql)) { - $objstat->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + $objstat->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); } $objstat->errors[] = $objstat->error; } @@ -232,7 +232,7 @@ if (empty($reshook)) $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; while ($obj = $db->fetch_object($resql)) { - $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); } $object->errors[] = $objstat->error; } From 815d0bbc20d7b49ed5adfb06b31d8503e604bd48 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 5 Sep 2019 11:57:12 +0200 Subject: [PATCH 015/233] FIX rename "dolresource" into "resource" for compatibility with PR 11822 --- htdocs/comm/action/card.php | 2 +- htdocs/resource/element_resource.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 44d6b000efe..c9a4f782b4d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -520,7 +520,7 @@ if ($action == 'update') $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'resource'"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; $sql .= " WHERE ac.id != " . $object->id; $sql .= " AND er.resource_id IN ("; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index bb9a54a9bf0..b842ad6c832 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -105,7 +105,7 @@ if (empty($reshook)) // TODO : add this check at update_linked_resource and when modifying event start or end date // check if an event resource is already in use - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='dolresource' && intval($busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='resource' && intval($busy)==1) { $eventDateStart = $objstat->datep; $eventDateEnd = $objstat->datef; $isFullDayEvent = intval($objstat->fulldayevent); @@ -185,7 +185,7 @@ if (empty($reshook)) $object->busy = $busy; $object->mandatory = $mandatory; - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='dolresource' && intval($object->busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='resource' && intval($object->busy)==1) { $eventDateStart = $object->objelement->datep; $eventDateEnd = $object->objelement->datef; $isFullDayEvent = intval($objstat->fulldayevent); From 6bb5860f62463dc8fe28c5621cc829529746287a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 5 Sep 2019 14:12:52 +0000 Subject: [PATCH 016/233] Fixing style errors. --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 55fef7d0185..b668ae0465f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7801,7 +7801,7 @@ abstract class CommonObject * @param string $type Type of category ('product', ...) * @return int < 0 si erreur, > 0 si ok */ - function cloneCategories($fromId, $toId, $type='') + function cloneCategories($fromId, $toId, $type = '') { $this->db->begin(); From 6902b2cbf22969c58202404c15521fa3bfa3f916 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 5 Sep 2019 16:14:15 +0200 Subject: [PATCH 017/233] fix function visibility thanks to stckler --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 55fef7d0185..0f8dd4f0c00 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7801,7 +7801,7 @@ abstract class CommonObject * @param string $type Type of category ('product', ...) * @return int < 0 si erreur, > 0 si ok */ - function cloneCategories($fromId, $toId, $type='') + public function cloneCategories($fromId, $toId, $type='') { $this->db->begin(); From cd96238adc0407213ce276e60f6d788933e9f0be Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 5 Sep 2019 14:19:35 +0000 Subject: [PATCH 018/233] Fixing style errors. --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0f8dd4f0c00..e395f3d4455 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7801,7 +7801,7 @@ abstract class CommonObject * @param string $type Type of category ('product', ...) * @return int < 0 si erreur, > 0 si ok */ - public function cloneCategories($fromId, $toId, $type='') + public function cloneCategories($fromId, $toId, $type = '') { $this->db->begin(); From 66611f40971344a15d0118cd7051a39c3de0e445 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 9 Sep 2019 09:29:43 +0200 Subject: [PATCH 019/233] FIX rename "resource" (reserved) by "dolresource" --- htdocs/comm/action/card.php | 2 +- htdocs/resource/element_resource.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index c9a4f782b4d..44d6b000efe 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -520,7 +520,7 @@ if ($action == 'update') $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'resource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; $sql .= " WHERE ac.id != " . $object->id; $sql .= " AND er.resource_id IN ("; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index b842ad6c832..bb9a54a9bf0 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -105,7 +105,7 @@ if (empty($reshook)) // TODO : add this check at update_linked_resource and when modifying event start or end date // check if an event resource is already in use - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='resource' && intval($busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element=='action' && $resource_type=='dolresource' && intval($busy)==1) { $eventDateStart = $objstat->datep; $eventDateEnd = $objstat->datef; $isFullDayEvent = intval($objstat->fulldayevent); @@ -185,7 +185,7 @@ if (empty($reshook)) $object->busy = $busy; $object->mandatory = $mandatory; - if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='resource' && intval($object->busy)==1) { + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type=='action' && $object->resource_type=='dolresource' && intval($object->busy)==1) { $eventDateStart = $object->objelement->datep; $eventDateEnd = $object->objelement->datef; $isFullDayEvent = intval($objstat->fulldayevent); From 3ea2e0c915db93fca1ca696a4d6c25477d251fa9 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 9 Sep 2019 15:03:20 +0200 Subject: [PATCH 020/233] NEW add parent id or ref column in warehouse import --- htdocs/core/modules/modStock.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index f3864525d8d..93afcdaebd7 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -316,17 +316,21 @@ class modStock extends DolibarrModules $this->import_fields_array[$r]=array('e.ref'=>"LocationSummary*", 'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse", 'e.address'=>"Address",'e.zip'=>'Zip','e.fk_pays'=>'CountryCode', - 'e.statut'=>'Status' + 'e.statut'=>'Status', + 'e.fk_parent'=>'ParentWarehouse' ); $this->import_convertvalue_array[$r]=array( - 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry') + 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), + 'e.fk_parent'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'ref') ); $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); $this->import_examplevalues_array[$r]=array('e.ref'=>"ALM001", 'e.description'=>"Central Warehouse",'e.lieu'=>"Central", 'e.address'=>"Route 66",'e.zip'=>'28080','e.fk_pays'=>'US', - 'e.statut'=>'1'); + 'e.statut'=>'1', + 'e.fk_parent'=>'' + ); // Import stocks $r++; From f4a565544fc7ac106ccacf004c07e70b91c2914f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 9 Sep 2019 16:33:12 +0200 Subject: [PATCH 021/233] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 87 +++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 446b4fa3cfe..428ebe79c4a 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -178,6 +178,93 @@ class Products extends DolibarrApi } return $obj_ret; } + + /** + * List supplier's products + * + * Get a list of supplier's products + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) + * @param int $category Use this param to filter list by category + * @param int $supplier Use this param to filter list by supplier + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" + * @return array Array of product objects + * + * @url GET supplier + */ + public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') + { + global $db, $conf; + $obj_ret = array(); + $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; + $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; + if ($category > 0) { + $sql.= ", ".MAIN_DB_PREFIX."categorie_product as c"; + } + $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; + + $sql.= ' WHERE t.entity IN ('.getEntity('product').')'; + + if ($supplier > 0) { + $sql.= " AND s.fk_soc = ".$db->escape($supplier); + } + $sql.= " AND s.fk_product = t.rowid "; + // Select products of given category + if ($category > 0) { + $sql.= " AND c.fk_categorie = ".$db->escape($category); + $sql.= " AND c.fk_product = t.rowid "; + } + if ($mode == 1) { + // Show only products + $sql.= " AND t.fk_product_type = 0"; + } elseif ($mode == 2) { + // Show only services + $sql.= " AND t.fk_product_type = 1"; + } + // Add sql filters + if ($sqlfilters) { + if (! DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + $sql.= $db->plimit($limit + 1, $offset); + } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; + while ($i < $min) + { + $obj = $db->fetch_object($result); + $product_static = new Product($db); + if($product_static->fetch($obj->rowid)) { + $obj_ret[] = $this->_cleanObjectDatas($product_static); + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); + } + if(! count($obj_ret)) { + throw new RestException(404, 'No product found'); + } + return $obj_ret; + } /** * Create product object From be66e1bd20ea9bc4de608e4f573c209ba77b9db8 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 9 Sep 2019 14:36:02 +0000 Subject: [PATCH 022/233] Fixing style errors. --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 428ebe79c4a..89dd7ff823a 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -193,7 +193,7 @@ class Products extends DolibarrApi * @param int $supplier Use this param to filter list by supplier * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" * @return array Array of product objects - * + * * @url GET supplier */ public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') From 6a734ea8289bf1f51cfb21e5a84e9344bb4932b7 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 9 Sep 2019 16:58:20 +0200 Subject: [PATCH 023/233] NEW add minimum stock filter in load warehoues for product form --- htdocs/expedition/card.php | 8 +- .../product/class/html.formproduct.class.php | 97 ++++++++++++------- 2 files changed, 68 insertions(+), 37 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index cc05bf686c3..4202607cbd2 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1262,7 +1262,13 @@ if ($action == 'create') if ($line->fk_product > 0) { print ''; - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1); + + $stockMin = false; + if (empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { + $stockMin = 0; + } + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', '', 1, $stockMin, 'stock DESC, e.ref'); + if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) { //print $stock.' '.$quantityToBeDelivered; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index a0ebda88cd9..e356226dd2f 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -55,21 +55,24 @@ class FormProduct } - /** - * Load in cache array list of warehouses - * If fk_product is not 0, we do not use cache - * - * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. - * @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''. - * @param string $status warehouse status filter, following comma separated filter options can be used - * 'warehouseopen' = select products from open warehouses, - * 'warehouseclosed' = select products from closed warehouses, - * 'warehouseinternal' = select products from warehouses for internal correct/transfer only - * @param boolean $sumStock sum total stock of a warehouse, default true - * @param array $exclude warehouses ids to exclude - * @return int Nb of loaded lines, 0 if already loaded, <0 if KO - */ - public function loadWarehouses($fk_product = 0, $batch = '', $status = '', $sumStock = true, $exclude = '') + /** + * Load in cache array list of warehouses + * If fk_product is not 0, we do not use cache + * + * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. + * @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''. + * @param string $status warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only + * @param boolean $sumStock sum total stock of a warehouse, default true + * @param string $exclude warehouses ids to exclude + * @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock + * @param string $orderBy [='e.ref'] Order by + * @return int Nb of loaded lines, 0 if already loaded, <0 if KO + * @throws Exception + */ + public function loadWarehouses($fk_product = 0, $batch = '', $status = '', $sumStock = true, $exclude = '', $stockMin = false, $orderBy = 'e.ref') { global $conf, $langs; @@ -130,8 +133,26 @@ class FormProduct if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')'; - if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.ref, e.description, e.fk_parent"; - $sql.= " ORDER BY e.ref"; + // minimum stock + if ($stockMin !== false) { + if (!empty($fk_product)) { + if (!empty($batch)) { + $sql .= " AND pb.qty > " . $this->db->escape($stockMin); + } else { + $sql .= " AND ps.reel > " . $this->db->escape($stockMin); + } + } + } + + if ($sumStock && empty($fk_product)) { + $sql.= " GROUP BY e.rowid, e.ref, e.description, e.fk_parent"; + + // minimum stock + if ($stockMin !== false) { + $sql .= " HAVING sum(ps.reel) > " . $this->db->escape($stockMin); + } + } + $sql.= " ORDER BY " . $orderBy; dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG); $resql = $this->db->query($sql); @@ -192,25 +213,29 @@ class FormProduct /** * Return list of warehouses * - * @param int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value) - * @param string $htmlname Name of html select html - * @param string $filterstatus warehouse status filter, following comma separated filter options can be used - * 'warehouseopen' = select products from open warehouses, - * 'warehouseclosed' = select products from closed warehouses, - * 'warehouseinternal' = select products from warehouses for internal correct/transfer only - * @param int $empty 1=Can be empty, 0 if not - * @param int $disabled 1=Select is disabled - * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. - * @param string $empty_label Empty label if needed (only if $empty=1) - * @param int $showstock 1=Show stock count - * @param int $forcecombo 1=Force combo iso ajax select2 - * @param array $events Events to add to select2 - * @param string $morecss Add more css classes to HTML select - * @param array $exclude Warehouses ids to exclude - * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse - * @return string HTML select + * @param string|int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value) + * @param string $htmlname Name of html select html + * @param string $filterstatus warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only + * @param int $empty 1=Can be empty, 0 if not + * @param int $disabled 1=Select is disabled + * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. + * @param string $empty_label Empty label if needed (only if $empty=1) + * @param int $showstock 1=Show stock count + * @param int $forcecombo 1=Force combo iso ajax select2 + * @param array $events Events to add to select2 + * @param string $morecss Add more css classes to HTML select + * @param string $exclude Warehouses ids to exclude + * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse + * @param bool|int $stockMin [=false] Value of minimum stock to filter or false not not filter by minimum stock + * @param string $orderBy [='e.ref'] Order by + * @return string HTML select + * + * @throws Exception */ - public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1) + public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') { global $conf,$langs,$user; @@ -218,7 +243,7 @@ class FormProduct $out=''; if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; - $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude); + $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); $nbofwarehouses=count($this->cache_warehouses); if ($conf->use_javascript_ajax && ! $forcecombo) From 48419da7698617d50b69ebcdd56510f5850be975 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 10 Sep 2019 14:58:55 +0200 Subject: [PATCH 024/233] FIX new invoice with generic thirdparty in takepos by default, new invoice should always create with default thirdparty and avoid errors : creating new invoice with last customer and forget to change it... --- htdocs/takepos/invoice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6ae5429d062..accc4befe82 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -280,8 +280,10 @@ if ($action == "delete") { $resql1 = $db->query($sql); $sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = ".$placeid; $resql2 = $db->query($sql); + $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}." where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $resql3 = $db->query($sql); - if ($resql1 && $resql2) + if ($resql1 && $resql2 && $resql3) { $db->commit(); } From 9db2e272895dbb7b30182f7b726a2c86c93a497d Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 10 Sep 2019 21:47:08 +0200 Subject: [PATCH 025/233] add widget box for supplier orders awaiting reception --- ...box_supplier_orders_awaiting_reception.php | 198 ++++++++++++++++++ htdocs/core/modules/modFournisseur.class.php | 1 + htdocs/langs/en_US/boxes.lang | 1 + 3 files changed, 200 insertions(+) create mode 100644 htdocs/core/boxes/box_supplier_orders_awaiting_reception.php diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php new file mode 100644 index 00000000000..bba7e6557de --- /dev/null +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -0,0 +1,198 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2012 Raphaël Doursenaud + * Copyright (C) 2015 Frederic 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_supplier_orders.php + * \ingroup fournisseurs + * \brief Module that generates the latest supplier orders box + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + +/** + * Class that manages the box showing latest supplier orders + */ +class box_supplier_orders_awaiting_reception extends ModeleBoxes +{ + + public $boxcode = "supplierordersawaitingreception"; + public $boximg = "object_order"; + public $boxlabel="BoxLatestSupplierOrdersAwaitingReception"; + public $depends = array("fournisseur"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $param; + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + global $user; + + $this->db = $db; + + $this->hidden = ! ($user->rights->fournisseur->commande->lire); + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + global $conf, $user, $langs, $db; + $langs->loadLangs(array("boxes", "sendings")); + + $this->max = $max; + + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $supplierorderstatic=new CommandeFournisseur($db); + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; + $thirdpartytmp = new Fournisseur($db); + + $this->info_box_head = array('text' => $langs->trans("BoxTitleSupplierOrdersAwaitingReception", $max)); + + if ($user->rights->fournisseur->commande->lire) + { + $sql = "SELECT s.nom as name, s.rowid as socid,"; + $sql.= " s.code_client, s.code_fournisseur,"; + $sql.= " s.logo,"; + $sql.= " c.rowid, c.ref, c.tms, c.date_commande, c.date_livraison, "; + $sql.= " c.total_ht,"; + $sql.= " c.tva as total_tva,"; + $sql.= " c.total_ttc,"; + $sql.= " c.fk_statut"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; + if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.entity = ".$conf->entity; + + $sql.= " AND c.fk_statut = ".CommandeFournisseur::STATUS_ORDERSENT; + if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($user->socid) $sql.= " AND s.rowid = ".$user->socid; + if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY c.date_commande DESC, c.ref DESC "; + else $sql.= " ORDER BY c.date_livraison ASC, c.fk_statut ASC "; + $sql.= $db->plimit($max, 0); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + + $line = 0; + while ($line < $num) { + $objp = $db->fetch_object($result); + $date=$db->jdate($objp->date_commande); + $date_livraison=$db->jdate($objp->date_livraison); + $datem=$db->jdate($objp->tms); + + $supplierorderstatic->date_livraison = $date_livraison; + $supplierorderstatic->statut = $objp->fk_statut; + + $supplierorderstatic->id = $objp->rowid; + $supplierorderstatic->ref = $objp->ref; + + $thirdpartytmp->id = $objp->socid; + $thirdpartytmp->name = $objp->name; + $thirdpartytmp->fournisseur = 1; + $thirdpartytmp->code_fournisseur = $objp->code_fournisseur; + $thirdpartytmp->logo = $objp->logo; + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $supplierorderstatic->getNomUrl(1), + 'asis' => 1 + ); + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right nowrap"', + 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), + ); + + $delayIcon = ''; + if ($supplierorderstatic->hasDelay()) { + $delayIcon = img_warning($langs->trans("Late")); + } + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => $delayIcon.' '. dol_print_date($date_livraison, 'day').'', + 'asis' => 1 + ); + + $line++; + } + + if ($num == 0) + $this->info_box_contents[$line][] = array( + 'td' => 'class="center"', + 'text' => $langs->trans("NoSupplierOrder"), + ); + + $db->free($result); + } else { + $this->info_box_contents[0][] = array( + 'td' => '', + 'maxlength'=>500, + 'text' => ($db->error().' sql='.$sql), + ); + } + } + else + { + $this->info_box_contents[0][] = array( + 'td' => 'class="nohover opacitymedium left"', + 'text' => $langs->trans("ReadPermissionNotAllowed") + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 0553fe3a1fa..3cc418f7d36 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -126,6 +126,7 @@ class modFournisseur extends DolibarrModules 3=>array('file'=>'box_factures_fourn_imp.php','enabledbydefaulton'=>'Home'), 4=>array('file'=>'box_factures_fourn.php','enabledbydefaulton'=>'Home'), 5=>array('file'=>'box_supplier_orders.php','enabledbydefaulton'=>'Home'), + 6=>array('file'=>'box_supplier_orders_awaiting_reception.php','enabledbydefaulton'=>'Home'), ); // Permissions diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index b1ab8e41fbc..3cf7ea24493 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -34,6 +34,7 @@ BoxTitleLastFicheInter=Latest %s modified interventions BoxTitleOldestUnpaidCustomerBills=Customer Invoices: oldest %s unpaid BoxTitleOldestUnpaidSupplierBills=Vendor Invoices: oldest %s unpaid BoxTitleCurrentAccounts=Open Accounts: balances +BoxTitleSupplierOrdersAwaitingReception=Supplier orders awaiting reception BoxTitleLastModifiedContacts=Contacts/Addresses: last %s modified BoxMyLastBookmarks=Bookmarks: latest %s BoxOldestExpiredServices=Oldest active expired services From 337194023abdd2125c9f9d4fcd9c0c9938438fe5 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 10 Sep 2019 22:10:20 +0200 Subject: [PATCH 026/233] Add purchase orders awaiting reception to workboard --- .../fourn/class/fournisseur.commande.class.php | 18 +++++++++++++++--- htdocs/index.php | 5 +++-- htdocs/langs/en_US/orders.lang | 2 ++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 64c7ca73b7b..b3e81247f90 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2804,9 +2804,10 @@ class CommandeFournisseur extends CommonOrder * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Objet user + * @param int $mode "opened", "awaiting" for orders awaiting reception * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - public function load_board($user) + public function load_board($user, $mode = 'opened') { // phpcs:enable global $conf, $langs; @@ -2822,7 +2823,12 @@ class CommandeFournisseur extends CommonOrder $clause = " AND"; } $sql.= $clause." c.entity = ".$conf->entity; - $sql.= " AND c.fk_statut IN (".self::STATUS_VALIDATED.", ".self::STATUS_ACCEPTED.")"; + if($mode==='awaiting'){ + $sql.= " AND c.fk_statut = ".self::STATUS_ORDERSENT; + } + else{ + $sql.= " AND c.fk_statut IN (".self::STATUS_VALIDATED.", ".self::STATUS_ACCEPTED.")"; + } if ($user->societe_id) $sql.=" AND c.fk_soc = ".$user->societe_id; $resql=$this->db->query($sql); @@ -2834,9 +2840,15 @@ class CommandeFournisseur extends CommonOrder $response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SuppliersOrdersToProcess"); $response->labelShort=$langs->trans("Opened"); - $response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; $response->img=img_object('', "order"); + if($mode==='awaiting'){ + $response->label=$langs->trans("SuppliersOrdersAwaitingReception"); + $response->labelShort=$langs->trans("AwaitingReception"); + $response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=3&mainmenu=commercial&leftmenu=orders_suppliers'; + } + while ($obj=$this->db->fetch_object($resql)) { $response->nbtodo++; diff --git a/htdocs/index.php b/htdocs/index.php index d50b5248fab..ed5bd362911 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -425,7 +425,8 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire) { include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; $board = new CommandeFournisseur($db); - $dashboardlines[$board->element] = $board->load_board($user); + $dashboardlines[$board->element . '_opened'] = $board->load_board($user, "opened"); + $dashboardlines[$board->element . '_awaiting'] = $board->load_board($user, 'awaiting'); } // Number of services enabled (delayed) @@ -550,7 +551,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { array( 'groupName' => 'SuppliersOrders', 'stats' => - array('order_supplier'), + array('order_supplier_opened', 'order_supplier_awaiting'), ), 'invoice_supplier' => array( diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 3197cc12bca..ec6ab48e413 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -25,6 +25,8 @@ OrdersToBill=Sales orders delivered OrdersInProcess=Sales orders in process OrdersToProcess=Sales orders to process SuppliersOrdersToProcess=Purchase orders to process +SuppliersOrdersAwaitingReception=Purchase orders awaiting reception +AwaitingReception=Awaiting reception StatusOrderCanceledShort=Canceled StatusOrderDraftShort=Draft StatusOrderValidatedShort=Validated From 3f3282400af95124d476501bac2b63cc5083c37e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Sep 2019 13:57:15 +0200 Subject: [PATCH 027/233] FIX SQL syntax error and CSRF check on vat reports --- htdocs/compta/localtax/card.php | 2 -- htdocs/compta/localtax/clients.php | 17 +++++++++----- htdocs/compta/localtax/index.php | 21 ++++++++++++++++-- htdocs/compta/localtax/quadri_detail.php | 28 ++++++++++++++---------- htdocs/compta/tva/clients.php | 10 ++++----- htdocs/compta/tva/index.php | 8 +++++-- htdocs/compta/tva/quadri_detail.php | 5 +++-- htdocs/core/lib/tax.lib.php | 2 +- htdocs/langs/en_US/companies.lang | 2 -- 9 files changed, 63 insertions(+), 32 deletions(-) diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 821e4d05d7e..0a741e7691b 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -156,8 +156,6 @@ $title=$langs->trans("LT".$object->ltt) . " - " . $langs->trans("Card"); $help_url=''; llxHeader("", $title, $helpurl); - - if ($action == 'create') { print load_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment", $mysoc->country_code)); diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 58b1ccd3f21..c4157d81984 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -85,6 +85,12 @@ $socid = GETPOST('socid', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +if (empty($local)) +{ + accessforbidden('Parameter localTaxType is missing'); + exit; +} + /* @@ -106,11 +112,12 @@ llxHeader('', '', '', '', 0, 0, '', '', $morequerystring); $name=$langs->transcountry($local==1?"LT1ReportByCustomers":"LT2ReportByCustomers", $mysoc->country_code); -$fsearch.='
'; -$fsearch.=' '; -$fsearch.=' '; -$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; -$fsearch.=' '; +$fsearch =''; +$fsearch.=''; +$fsearch.=''; +$fsearch.=''; +$fsearch.=$langs->trans("SalesTurnoverMinimum").': '; +$fsearch.=''; $calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local; // Affiche en-tete du rapport diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 8d288274049..ef5013c84f6 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -188,6 +188,19 @@ function pt($db, $sql, $date) } } +if (empty($localTaxType)) +{ + accessforbidden('Parameter localTaxType is missing'); + exit; +} + + +/* + * Actions + */ + +// None + /* * View @@ -213,7 +226,11 @@ if($localTaxType==1) { $CalcLT= $conf->global->MAIN_INFO_LOCALTAX_CALC2; } -$fsearch.=' '; +$fsearch = ''; +$fsearch.= ''; +$fsearch.= ''; +$fsearch.= ''; + $description = $fsearch; // Show report header @@ -528,7 +545,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc $total = $total + $diff; $subtotal = price2num($subtotal + $diff, 'MT'); - print ''.price(price2num($diff, 'MT')).'\n'; + print ''.price(price2num($diff, 'MT')).''."\n"; print " \n"; print "\n"; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 4bbe5c723e1..c28c5f5f48b 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -97,6 +97,12 @@ $socid = GETPOST('socid', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +if (empty($local)) +{ + accessforbidden('Parameter localTaxType is missing'); + exit; +} + /* @@ -122,9 +128,10 @@ foreach ($listofparams as $param) llxHeader('', $langs->trans("LocalTaxReport"), '', '', 0, 0, '', '', $morequerystring); -$fsearch.=' '; -$fsearch.=' '; -$fsearch.=' '; +$fsearch = ''; +$fsearch.= ''; +$fsearch.= ''; +$fsearch.= ''; $name=$langs->transcountry($local==1?"LT1ReportByQuarters":"LT2ReportByQuarters", $mysoc->country_code); $calcmode=''; @@ -161,7 +168,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
'.$langs->trans("DepositsAreNotIncluded"); } */ -if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
'.$langs->trans("ThisIsAnEstimatedValue"); +if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.=$langs->trans("ThisIsAnEstimatedValue"); // Customers invoices $elementcust=$langs->trans("CustomersInvoices"); @@ -186,15 +193,14 @@ if ($mysoc->tva_assuj) { report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); - if($local==1){ - $vatcust=$langs->transcountry("LocalTax1", $mysoc->country_code); - $vatsup=$langs->transcountry("LocalTax1", $mysoc->country_code); - $vatexpensereport=$langs->transcountry("LocalTax1", $mysoc->country_code); + $vatcust=$langs->transcountry("LT1", $mysoc->country_code); + $vatsup=$langs->transcountry("LT1", $mysoc->country_code); + $vatexpensereport=$langs->transcountry("LT1", $mysoc->country_code); }else{ - $vatcust=$langs->transcountry("LocalTax2", $mysoc->country_code); - $vatsup=$langs->transcountry("LocalTax2", $mysoc->country_code); - $vatexpensereport=$langs->transcountry("LocalTax2", $mysoc->country_code); + $vatcust=$langs->transcountry("LT2", $mysoc->country_code); + $vatsup=$langs->transcountry("LT2", $mysoc->country_code); + $vatexpensereport=$langs->transcountry("LT2", $mysoc->country_code); } // VAT Received and paid diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index e0775313dd3..969d5322008 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -123,11 +123,11 @@ if (isset($_REQUEST['extra_report']) && $_REQUEST['extra_report'] == 1) { llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring); -$fsearch.='
'; -$fsearch.=' '; -$fsearch.=' '; -$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; -$fsearch.=' '; +$fsearch =''; +$fsearch.=''; +$fsearch.=''; +$fsearch.=$langs->trans("SalesTurnoverMinimum").': '; +$fsearch.=''; // Show report header $name=$langs->trans("VATReportByThirdParties"); diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index f0c96dccdd6..6a83d25070b 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -198,7 +198,11 @@ $form=new Form($db); $company_static=new Societe($db); $tva = new Tva($db); -$description = ''; +$fsearch =''; +$fsearch.=''; +$fsearch.=''; + +$description = $fsearch; // Show report header $name = $langs->trans("ReportByMonth"); @@ -208,7 +212,7 @@ if ($modetax == 1) $calcmode=$langs->trans('OptionVATDebitOption'); if ($modetax == 2) $calcmode=$langs->trans('OptionPaymentForProductAndServices'); $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT.'/admin/taxes.php').')'; -$description = $langs->trans("VATSummary").'
'; +$description .= $langs->trans("VATSummary").'
'; if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') $description.=$langs->trans("RulesVATDueProducts"); if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts"); if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='
'.$langs->trans("RulesVATDueServices"); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 8b58bde4199..581e9a1d13e 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -122,8 +122,9 @@ llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring //print load_fiche_titre($langs->trans("VAT"),""); //$fsearch.='
'; -$fsearch.=' '; -$fsearch.=' '; +$fsearch =''; +$fsearch.=''; +$fsearch.=''; //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; //$fsearch.=' '; diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 884ff4fc922..d959a660224 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -124,7 +124,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $invoicefieldref='ref'; } - if ( strpos($type, 'localtax') === 0 ) { + if (strpos($type, 'localtax') === 0) { $f_rate = $type . '_tx'; } else { $f_rate = 'tva_tx'; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index dccd53c597a..532fbf14cb7 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -96,8 +96,6 @@ LocalTax1IsNotUsedES= RE is not used LocalTax2IsUsed=Use third tax LocalTax2IsUsedES= IRPF is used LocalTax2IsNotUsedES= IRPF is not used -LocalTax1ES=RE -LocalTax2ES=IRPF WrongCustomerCode=Customer code invalid WrongSupplierCode=Vendor code invalid CustomerCodeModel=Customer code model From eeaeefe20c20935e39480555ccd033d2a84fe438 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Sep 2019 15:46:37 +0200 Subject: [PATCH 028/233] FIX Add repair.php option 'restore' to restore user picture after v10 --- htdocs/install/repair.php | 204 +++++++++++++++++++++++++++++--------- 1 file changed, 159 insertions(+), 45 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 472e77e1974..d34d43384d0 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -69,6 +69,7 @@ print '

'.$langs->trans("Repair").'

'; print 'Option standard (\'test\' or \'confirmed\') is '.(GETPOST('standard', 'alpha')?GETPOST('standard', 'alpha'):'undefined').'
'."\n"; print 'Option restore_thirdparties_logos (\'test\' or \'confirmed\') is '.(GETPOST('restore_thirdparties_logos', 'alpha')?GETPOST('restore_thirdparties_logos', 'alpha'):'undefined').'
'."\n"; +print 'Option restore_user_pictures (\'test\' or \'confirmed\') is '.(GETPOST('restore_user_pictures', 'alpha')?GETPOST('restore_user_pictures', 'alpha'):'undefined').'
'."\n"; print 'Option clean_linked_elements (\'test\' or \'confirmed\') is '.(GETPOST('clean_linked_elements', 'alpha')?GETPOST('clean_linked_elements', 'alpha'):'undefined').'
'."\n"; print 'Option clean_menus (\'test\' or \'confirmed\') is '.(GETPOST('clean_menus', 'alpha')?GETPOST('clean_menus', 'alpha'):'undefined').'
'."\n"; print 'Option clean_orphelin_dir (\'test\' or \'confirmed\') is '.(GETPOST('clean_orphelin_dir', 'alpha')?GETPOST('clean_orphelin_dir', 'alpha'):'undefined').'
'."\n"; @@ -492,70 +493,183 @@ if ($ok && GETPOST('restore_thirdparties_logos')) $ext=''; print '
*** Restore thirdparties logo
'; - //foreach($exts as $ext) - //{ - $sql="SELECT s.rowid, s.nom as name, s.logo FROM ".MAIN_DB_PREFIX."societe as s ORDER BY s.nom"; - $resql=$db->query($sql); - if ($resql) + + $sql="SELECT s.rowid, s.nom as name, s.logo FROM ".MAIN_DB_PREFIX."societe as s ORDER BY s.nom"; + $resql=$db->query($sql); + if ($resql) + { + $num=$db->num_rows($resql); + $i=0; + + while($i < $num) { - $num=$db->num_rows($resql); - $i=0; + $obj=$db->fetch_object($resql); - while($i < $num) + /* + $name=preg_replace('/é/','',$obj->name); + $name=preg_replace('/ /','_',$name); + $name=preg_replace('/\'/','',$name); + */ + + $tmp=explode('.', $obj->logo); + $name=$tmp[0]; + if (isset($tmp[1])) $ext='.'.$tmp[1]; + + if (! empty($name)) { - $obj=$db->fetch_object($resql); - - /* - $name=preg_replace('/é/','',$obj->name); - $name=preg_replace('/ /','_',$name); - $name=preg_replace('/\'/','',$name); - */ - - $tmp=explode('.', $obj->logo); - $name=$tmp[0]; - if (isset($tmp[1])) $ext='.'.$tmp[1]; - - if (! empty($name)) + $filetotest=$dolibarr_main_data_root.'/societe/logos/'.$name.$ext; + $filetotestsmall=$dolibarr_main_data_root.'/societe/logos/thumbs/'.$name.'_small'.$ext; + $exists=dol_is_file($filetotest); + print 'Check thirdparty '.$obj->rowid.' name='.$obj->name.' logo='.$obj->logo.' file '.$filetotest." exists=".$exists."
\n"; + if ($exists) { - $filetotest=$dolibarr_main_data_root.'/societe/logos/'.$name.$ext; - $filetotestsmall=$dolibarr_main_data_root.'/societe/logos/thumbs/'.$name.$ext; - $exists=dol_is_file($filetotest); - print 'Check thirdparty '.$obj->rowid.' name='.$obj->name.' logo='.$obj->logo.' file '.$filetotest." exists=".$exists."
\n"; - if ($exists) + $filetarget=$dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos/'.$name.$ext; + $filetargetsmall=$dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos/thumbs/'.$name.'_small'.$ext; + $existt=dol_is_file($filetarget); + if (! $existt) { - $filetarget=$dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos/'.$name.$ext; - $filetargetsmall=$dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos/thumbs/'.$name.'_small'.$ext; - $existt=dol_is_file($filetarget); - if (! $existt) + if (GETPOST('restore_thirdparties_logos', 'alpha') == 'confirmed') { dol_mkdir($dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos'); - - print "       -> Copy file ".$filetotest." -> ".$filetarget."
\n"; - dol_copy($filetotest, $filetarget, '', 0); } - $existtt=dol_is_file($filetargetsmall); - if (! $existtt) + print "       -> Copy file ".$filetotest." -> ".$filetarget."
\n"; + if (GETPOST('restore_thirdparties_logos', 'alpha') == 'confirmed') + { + dol_copy($filetotest, $filetarget, '', 0); + } + } + + $existtt=dol_is_file($filetargetsmall); + if (! $existtt) + { + if (GETPOST('restore_thirdparties_logos', 'alpha') == 'confirmed') { dol_mkdir($dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos/thumbs'); - - print "       -> Copy file ".$filetotestsmall." -> ".$filetargetsmall."
\n"; + } + print "       -> Copy file ".$filetotestsmall." -> ".$filetargetsmall."
\n"; + if (GETPOST('restore_thirdparties_logos', 'alpha') == 'confirmed') + { dol_copy($filetotestsmall, $filetargetsmall, '', 0); } } } - - $i++; } + + $i++; } - else - { - $ok=0; - dol_print_error($db); - } + } + else + { + $ok=0; + dol_print_error($db); + } + + print ''; +} + + + +// restore_user_pictures: Move pictures to correct new directory. +if ($ok && GETPOST('restore_user_pictures', 'alpha')) +{ + //$exts=array('gif','png','jpg'); + + $ext=''; + + print '
*** Restore user pictures
'; + + $sql="SELECT s.rowid, s.firstname, s.lastname, s.login, s.photo FROM ".MAIN_DB_PREFIX."user as s ORDER BY s.rowid"; + $resql=$db->query($sql); + if ($resql) + { + $num=$db->num_rows($resql); + $i=0; + + while($i < $num) + { + $obj=$db->fetch_object($resql); + + /* + $name=preg_replace('/é/','',$obj->name); + $name=preg_replace('/ /','_',$name); + $name=preg_replace('/\'/','',$name); + */ + + $tmp=explode('.', $obj->photo); + $name=$tmp[0]; + if (isset($tmp[1])) $ext='.'.$tmp[1]; + + if (! empty($name)) + { + $filetotest=$dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/'.$name.$ext; + $filetotestsmall=$dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_small'.$ext; + $filetotestmini=$dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_mini'.$ext; + $exists=dol_is_file($filetotest); + print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' fistname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
\n"; + if ($exists) + { + $filetarget=$dolibarr_main_data_root.'/users/'.$obj->rowid.'/'.$name.$ext; + $filetargetsmall=$dolibarr_main_data_root.'/users/'.$obj->rowid.'/thumbs/'.$name.'_small'.$ext; + $filetargetmini=$dolibarr_main_data_root.'/users/'.$obj->rowid.'/thumbs/'.$name.'_mini'.$ext; + + $existt=dol_is_file($filetarget); + if (! $existt) + { + if (GETPOST('restore_user_pictures', 'alpha') == 'confirmed') + { + dol_mkdir($dolibarr_main_data_root.'/users/'.$obj->rowid); + } + + print "       -> Copy file ".$filetotest." -> ".$filetarget."
\n"; + if (GETPOST('restore_user_pictures', 'alpha') == 'confirmed') + { + dol_copy($filetotest, $filetarget, '', 0); + } + } + + $existtt=dol_is_file($filetargetsmall); + if (! $existtt) + { + if (GETPOST('restore_user_pictures', 'alpha') == 'confirmed') + { + dol_mkdir($dolibarr_main_data_root.'/users/'.$obj->rowid.'/thumbs'); + } + + print "       -> Copy file ".$filetotestsmall." -> ".$filetargetsmall."
\n"; + if (GETPOST('restore_user_pictures', 'alpha') == 'confirmed') + { + dol_copy($filetotestsmall, $filetargetsmall, '', 0); + } + } + + $existtt=dol_is_file($filetargetmini); + if (! $existtt) + { + if (GETPOST('restore_user_pictures', 'alpha') == 'confirmed') + { + dol_mkdir($dolibarr_main_data_root.'/users/'.$obj->rowid.'/thumbs'); + } + + print "       -> Copy file ".$filetotestmini." -> ".$filetargetmini."
\n"; + if (GETPOST('restore_user_pictures', 'alpha') == 'confirmed') + { + dol_copy($filetotestmini, $filetargetmini, '', 0); + } + } + } + } + + $i++; + } + } + else + { + $ok=0; + dol_print_error($db); + } print ''; - //} } From db900cb5ea8062c0f880dde0ae2be3b6f7aba412 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Sep 2019 17:51:50 +0200 Subject: [PATCH 029/233] FIX EDB-ID:47370 --- htdocs/comm/action/card.php | 42 +++++++++---------- .../comm/action/class/cactioncomm.class.php | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index af54186e255..4e5abac75d3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -221,7 +221,7 @@ if ($action == 'add') } // Initialisation objet cactioncomm - if (! GETPOST('actioncode') > 0) // actioncode is id + if (GETPOSTISSET('actioncode') && ! GETPOST('actioncode', 'aZ09')) // actioncode is '0' { $error++; $donotclearsession=1; $action = 'create'; @@ -229,7 +229,7 @@ if ($action == 'add') } else { - $object->type_code = GETPOST('actioncode'); + $object->type_code = GETPOST('actioncode', 'aZ09'); } if (! $error) @@ -243,7 +243,7 @@ if ($action == 'add') $object->elementtype = GETPOST("elementtype", 'alpha'); if (! GETPOST('label')) { - if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) + if (GETPOST('actioncode', 'aZ09') == 'AC_RDV' && $contact->getFullName($langs)) { $object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs)); } @@ -426,15 +426,15 @@ if ($action == 'update') $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); - $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm'); - $object->label = GETPOST("label"); + $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + $object->label = GETPOST("label", "alphanohtml"); $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->priority = GETPOST("priority"); + $object->priority = GETPOST("priority", "alphanohtml"); $object->fulldayevent= GETPOST("fullday")?1:0; - $object->location = GETPOST('location'); - $object->socid = GETPOST("socid"); + $object->location = GETPOST('location', "alphanohtml"); + $object->socid = GETPOST("socid", "int"); $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); $object->socpeopleassigned = array(); foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid); @@ -446,8 +446,8 @@ if ($action == 'update') $object->fk_project = GETPOST("projectid", 'int'); $object->note = GETPOST("note", "none"); // deprecated $object->note_private= GETPOST("note", "none"); - $object->fk_element = GETPOST("fk_element"); - $object->elementtype = GETPOST("elementtype"); + $object->fk_element = GETPOST("fk_element", "int"); + $object->elementtype = GETPOST("elementtype", "alphanohtml"); if (! $datef && $percentage == 100) { @@ -491,7 +491,7 @@ if ($action == 'update') } // Check parameters - if (! GETPOST('actioncode') > 0) + if (GETPOSTISSET('actioncode') && ! GETPOST('actioncode', 'aZ09')) // actioncode is '0' { $error++; $donotclearsession=1; $action = 'edit'; @@ -499,7 +499,7 @@ if ($action == 'update') } else { - $result=$cactioncomm->fetch(GETPOST('actioncode')); + $result=$cactioncomm->fetch(GETPOST('actioncode', 'aZ09')); } if (empty($object->userownerid)) { @@ -689,7 +689,7 @@ if ($action == 'create') if ($backtopage) print ''; if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print ''; - if (GETPOST("actioncode") == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); + if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); else print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda'); dol_fiche_head(); @@ -701,7 +701,7 @@ if ($action == 'create') { print ''.$langs->trans("Type").''; $default=(empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)?'':$conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); - $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode", "systemauto", 0, -1); + $formactions->select_type_actions(GETPOST("actioncode", 'aZ09')?GETPOST("actioncode", 'aZ09'):($object->type_code?$object->type_code:$default), "actioncode", "systemauto", 0, -1); print ''; } @@ -731,7 +731,7 @@ if ($action == 'create') { $datef=dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h'); } - print ''.$langs->trans("DateActionEnd").''; + print ''.$langs->trans("DateActionEnd").''; if (GETPOST("afaire") == 1) { print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend'); } elseif (GETPOST("afaire") == 2) { @@ -1010,15 +1010,15 @@ if ($id > 0) $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); - $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm'); - $object->label = GETPOST("label"); + $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + $object->label = GETPOST("label", "alphanohtml"); $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->priority = GETPOST("priority"); + $object->priority = GETPOST("priority", "alphanohtml"); $object->fulldayevent= GETPOST("fullday")?1:0; - $object->location = GETPOST('location'); - $object->socid = GETPOST("socid"); + $object->location = GETPOST('location', "alpanohtml"); + $object->socid = GETPOST("socid", "int"); $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); foreach ($socpeopleassigned as $tmpid) $object->socpeopleassigned[$id] = array('id' => $tmpid); $object->contactid = GETPOST("contactid", 'int'); @@ -1101,7 +1101,7 @@ if ($id > 0) print ''.$langs->trans("Type").''; if ($object->type_code != 'AC_OTH_AUTO') { - $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode", "systemauto"); + $formactions->select_type_actions(GETPOST("actioncode", 'aZ09')?GETPOST("actioncode", 'aZ09'):$object->type_code, "actioncode", "systemauto"); } else { diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index eb7fb885d8d..5d3290599b9 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -84,7 +84,7 @@ class CActionComm $sql = "SELECT id, code, type, libelle as label, color, active, picto"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; if (is_numeric($id)) $sql.= " WHERE id=".$id; - else $sql.= " WHERE code='".$id."'"; + else $sql.= " WHERE code='".$this->db->escape($id)."'"; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); From 797bab47417ad3f1673b09a0470a25ce6e870f79 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Wed, 11 Sep 2019 18:42:46 +0100 Subject: [PATCH 030/233] fix: repetition --- htdocs/core/class/ldap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 1d1a6122288..266b41867e8 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -609,7 +609,7 @@ class Ldap } if ($result <= 0) { - $this->error = ldap_errno($this->connection)." ".ldap_error($this->connection)." ".$this->error; + $this->error = ldap_errno($this->connection)." ".$this->error; dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); //print_r($info); return -1; From ee11da1075a21aebb1939550b890bbe3194ee651 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Sep 2019 21:08:49 +0200 Subject: [PATCH 031/233] Update ChangeLog --- ChangeLog | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/ChangeLog b/ChangeLog index c78ad8674eb..ee409bb7588 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,105 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 10.0.2 compared to 10.0.1 ***** + +FIX: #10460 compatibility with MariaDB 10.4 +FIX: #11401 Adherent unknown language key +FIX: #11422 Can't edit his own events with standard rights +FIX: #11427 require product class (fixes POST /supplierinvoices REST API endpoint) +FIX: #11570 +FIX: #11591 FIX: #11592 +FIX: #11671 CVE-2019-15062 +FIX: #11672 +FIX: #11685 +FIX: #11702 +FIX: #11711 +FIX: #11720 +FIX: #11746 Unable to modify amount of insurance of a loan +FIX: #11752 +FIX: #11789 FIX: #11790 +FIX: #11804 list of tickets from a customer card display ALL tickets +FIX: #11834 +FIX: Add char $ and ; in sanitizing of filenames. +FIX: Add comment before protected functions +FIX: Add log and type of content in dolWebsiteOutput and +FIX: Add repair.php option 'restore' to restore user picture after v10 +FIX: amount opened on thirdparty card dont care of credit note not converted +FIX: Api of documents work with value 'thirdparty' +FIX: author in message / ticket API +FIX: avoid sql error if fk_project is empty during update +FIX: avoid Warning: A non-numeric value encountered +FIX: bad consistency in list of invoice for direct debit order. +FIX: Bad error management in zip compress and web site export +FIX: bad substitution for extrafields type checkbox +FIX: better help message with multicompany +FIX: calculation of $products_dispatched +FIX: Can't add a new chart of account +FIX: Can't delete a draft leave even if it should +FIX: Can't save setup of mailman module +FIX: column jabberid missing +FIX: Confirmation of deletion +FIX: Consistency in direct debit order lists. +FIX: Content send before header warning +FIX: credit note can be split +FIX: credit note used on list +FIX: Css was saved on wrong website. +FIX: delivery extrafields +FIX: Disabling a website does not put it offline +FIX: display only stripe sources for customer +FIX: display payment intent in stripe's charge list +FIX: document list for products in API +FIX: dol_thirdparty_id for stripe PI +FIX: Do not show tooltip if tooltip is empty +FIX: duplicate css tag, decrease padding-bottom for boxes in eldy theme +FIX: duration when creating service +FIX: EDB-ID:47370 +FIX: Enable web site +FIX: error management when adding a property with type real +FIX: Fatal situation if payment removed on expense report. Action +FIX: filepath of generated documents doesn't handle products with special characters +FIX: for MAIN_MAXTABS_IN_CARD = $i card +FIX: gzip and bzip2 must use option -f +FIX: It was possible to create cashfence without entering data. +FIX: javascript error when using dol_use_jmobile=1 +FIX: logout redirect to takepos.php +FIX: Look and feel v10 +FIX: Make protected all pfd models functions +FIX: management of extrafields in modulebuilder +FIX: Missing div for buttons in tax, loan, various payment modules +FIX: missing include (dol_convert_file not found) +FIX: Missing some replacements in website module +FIX: missing test on permission on button to delete ledger record +FIX: Missing the filter fields in export of expense report and leaves +FIX: Missing ticket icon on md theme +FIX: Missing transaction +FIX: Mode smartphone was not triggered when there is too loo menu +FIX: Must escape shell +FIX: Must exclude logs and some dirs for compressed backup +FIX: name and position of hook FIX: #11710 +FIX: Not showing MAIN_INVERT_SENDER_RECIPIENT when edit field +FIX: Nowrap missing on amount in boxes +FIX: Option to use ZipArchive instead of PclZip bugged with large files. +FIX: order or proposals billed if both workflow conf activated +FIX: permission check on API intervention +FIX: phpcs +FIX: placement function +FIX: qty in invoice list on product's stats +FIX: remove disabled product type from product list +FIX: Return code of pdf_einstein.modules.php and proformat +FIX: round for application fee in stripe +FIX: Sens of the balance (Debit - Credit in accountancy not contrary) +FIX: Several pb in export of documents +FIX: SQL syntax error and CSRF check on vat reports +FIX: takepos layout clear or focus search +FIX: too many record in sql request. Whena criteria is a filter, we must +FIX: Translation of month +FIX: USEDOLIBARREDITOR not always set +FIX: VAT number for Monaco (it uses FR) +FIX: vulenrability in uploading file found by 美创科技安全实验室 +FIX: wrong display (and hidden input) for already dispatched quantity +FIX: wrong parameters (same error in branch 9, 10, develop) +FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** FIX: #10930 From 5183a1ec7a19cd553fd9fa728a911df3310174b9 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Wed, 11 Sep 2019 22:45:02 +0100 Subject: [PATCH 032/233] New : Use of posixAccount and posixGroup objectclass for users and groups in LDAP --- htdocs/admin/ldap_groups.php | 8 +++++++ htdocs/admin/ldap_users.php | 33 +++++++++++++++++++++++++++ htdocs/langs/en_US/admin.lang | 7 ++++++ htdocs/langs/fr_FR/admin.lang | 7 ++++++ htdocs/user/class/user.class.php | 18 +++++++++++++-- htdocs/user/class/usergroup.class.php | 5 +++- 6 files changed, 75 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 450fec88ad0..6dcc26a23e0 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -58,6 +58,7 @@ if ($action == 'setvalue' && $user->admin) //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; @@ -170,6 +171,13 @@ print ''.$langs->trans("LDAPFieldGroupMembersExample").''; print 'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'').">"; print ''; +// Group id +print ''.$langs->trans("LDAPFieldGroupid").''; +print ''; +print ''.$langs->trans("LDAPFieldGroupidExample").''; +print ' '; +print ''; + print ''; print info_admin($langs->trans("LDAPDescValues")); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 4148d81f438..394451c9472 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -5,6 +5,7 @@ * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2011-2016 Juanjo Menent + * Copyright (C) 2019 Abbes Bahfir * * 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 @@ -73,6 +74,10 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_SID', GETPOST("fieldsid"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE', GETPOST("fieldtitle"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_USERID', GETPOST("fielduserid"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_HOMEDIRECTORY', GETPOST("fieldhomedirectory"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_HOMEDIRECTORYPREFIX', GETPOST("fieldhomedirectoryprefix"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; @@ -301,6 +306,34 @@ print ''.$langs->trans("LDAPFieldSidExample").''; print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'').">"; print ''; +// Group id +print ''.$langs->trans("LDAPFieldGroupid").''; +print ''; +print ''.$langs->trans("LDAPFieldGroupidExample").''; +print ' '; +print ''; + +// Userid +print ''.$langs->trans("LDAPFieldUserid").''; +print ''; +print ''.$langs->trans("LDAPFieldUseridExample").''; +print ' '; +print ''; + +// Home Directory +print ''.$langs->trans("LDAPFieldHomedirectory").''; +print ''; +print ''.$langs->trans("LDAPFieldHomedirectoryExample").''; +print ' '; +print ''; + +// Home Directory Prefix +print ''.$langs->trans("LDAPFieldHomedirectoryprefix").''; +print ''; +print ''; +print ' '; +print ''; + print ''; print info_admin($langs->trans("LDAPDescValues")); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a8f7f9643ce..3eb9f24112d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1458,6 +1458,13 @@ LDAPFieldSidExample=Example: objectsid LDAPFieldEndLastSubscription=Date of subscription end LDAPFieldTitle=Job position LDAPFieldTitleExample=Example: title +LDAPFieldGroupid=Group id +LDAPFieldGroupidExample=Exemple : gidnumber +LDAPFieldUserid=User id +LDAPFieldUseridExample=Exemple : uidnumber +LDAPFieldHomedirectory=Home directory prefix +LDAPFieldHomedirectoryExample=Exemple : homedirectory +LDAPFieldHomedirectoryprefix=Home directory prefix LDAPSetupNotComplete=LDAP setup not complete (go on others tabs) LDAPNoUserOrPasswordProvidedAccessIsReadOnly=No administrator or password provided. LDAP access will be anonymous and in read only mode. LDAPDescContact=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr contacts. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 20cdc9175d6..ff684f01cb9 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1458,6 +1458,13 @@ LDAPFieldSidExample=Exemple : objectsid LDAPFieldEndLastSubscription=Date de fin de validité adhésion LDAPFieldTitle=Poste/fonction LDAPFieldTitleExample=Exemple: title +LDAPFieldGroupid=Groupe id +LDAPFieldGroupidExample=Exemple : gidnumber +LDAPFieldUserid=User id +LDAPFieldUseridExample=Exemple : uidnumber +LDAPFieldHomedirectory=Répertoire d'accueil +LDAPFieldHomedirectoryExample=Exemple : homedirectory +LDAPFieldHomedirectoryprefix=Préfixe du répertoire d'accueil LDAPSetupNotComplete=Configuration LDAP incomplète (à compléter sur les autres onglets) LDAPNoUserOrPasswordProvidedAccessIsReadOnly=Administrateur ou mot de passe non renseigné. Les accès LDAP seront donc anonymes et en lecture seule. LDAPDescContact=Cette page permet de définir le nom des attributs de l'arbre LDAP pour chaque information des contacts Dolibarr. diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4d78aa1b892..aa4aec74251 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2018 charlene Benke * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Abbes Bahfir * * 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 @@ -35,6 +36,7 @@ */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT .'/user/class/usergroup.class.php'; /** * Class to manage Dolibarr users @@ -2655,8 +2657,20 @@ class User extends CommonObject if ($this->phone_mobile) $info["phpgwCellTelephoneNumber"] = $this->phone_mobile; } - return $info; - } + $info[$conf->global->LDAP_FIELD_USERID] = $this->id; + $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + $usergroup = new UserGroup($this->db); + $groupslist = $usergroup->listGroupsForUser($this->id); + if(!empty($groupslist)){ + foreach ($groupslist as $groupforuser) { + $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id;//Select first group in list + break; + } + } + $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY]="{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + + return $info; + } /** diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index d51d82c8d13..c0cd4d9227f 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Alexis Algoud * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2019 Abbes Bahfir * * 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 @@ -978,7 +979,9 @@ class UserGroup extends CommonObject $valueofldapfield[] = $muser->_load_ldap_dn($info2); } $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:''); - } + + } + $info[$conf->global->LDAP_FIELD_GROUPID]=$this->id; return $info; } From e5878c105a001d1215a31c121b10caee5452da02 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Sep 2019 21:48:17 +0000 Subject: [PATCH 033/233] Fixing style errors. --- htdocs/user/class/usergroup.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index c0cd4d9227f..4e8cdf5824b 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -979,7 +979,6 @@ class UserGroup extends CommonObject $valueofldapfield[] = $muser->_load_ldap_dn($info2); } $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:''); - } $info[$conf->global->LDAP_FIELD_GROUPID]=$this->id; return $info; From 5f23ba5467d686371763a39c8276b81538197284 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Sep 2019 08:04:53 +0200 Subject: [PATCH 034/233] FIX avoid non numeric warning --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0fd061ac7ed..24af2adce15 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -659,7 +659,7 @@ if (empty($reshook)) } $qty = GETPOST('qty' . $predef); - $remise_percent = GETPOST('remise_percent' . $predef); + $remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0); // Extrafields $extrafieldsline = new ExtraFields($db); From 60e85136df9703e824945111a6e96425c83ebd8b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Sep 2019 08:48:55 +0200 Subject: [PATCH 035/233] FIX an admin can not access his own permissions after enabling advanced permissions --- htdocs/user/perms.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 2560ccc7f04..209e68048c7 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -58,7 +58,8 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $socid=0; if (isset($user->societe_id) && $user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms))) // A user can always read its own card if not advanced perms enabled, or if he has advanced perms +// A user can always read its own card if not advanced perms enabled, or if he has advanced perms, except for admin +if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms)) && empty($user->admin)) { accessforbidden(); } From decddd21572fb9b4fe5418738d1275f1daf62b7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Sep 2019 11:23:10 +0200 Subject: [PATCH 036/233] Doc --- ChangeLog | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index b14ce527677..584b7c1ee0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,28 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 11.0.0 compared to 10.0.0 ***** +For Users: + + +For Developers: + + +WARNING: + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Properties ->libelle_incoterms were renamed into ->label_incoterms +* Removed the method liste_array() of project class. It was not used by core code. +* The function show_theme() hase been renamed into showSkins() +* Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. +* The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. +* The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). +* Removed deprecated method actioncomm->add(), use create() instead +* If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...) + + + ***** ChangeLog for 10.0.2 compared to 10.0.1 ***** FIX: #10460 compatibility with MariaDB 10.4 @@ -102,26 +124,6 @@ FIX: wrong display (and hidden input) for already dispatched quantity FIX: wrong parameters (same error in branch 9, 10, develop) FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES -***** ChangeLog for 11.0.0 compared to 10.0.0 ***** -For Users: - - -For Developers: - - -WARNING: - -Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* Properties ->libelle_incoterms were renamed into ->label_incoterms -* Removed the method liste_array() of project class. It was not used by core code. -* The function show_theme() hase been renamed into showSkins() -* Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. -* The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. -* The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). -* Removed deprecated method actioncomm->add(), use create() instead -* If you develop your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...) - - ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** FIX: #10930 FIX: #10984 From ca997a41723fce5c9f3c000075cb22a4ef32b4a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Sep 2019 11:56:42 +0200 Subject: [PATCH 037/233] Comment --- htdocs/main.inc.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9183cbb5f00..014ca843236 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -360,7 +360,7 @@ if (! defined('NOTOKENRENEWAL')) if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set { - if ($_SERVER['REQUEST_METHOD'] == 'POST' && ! GETPOSTISSET('token')) // Note, offender can still send request by GET + if ($_SERVER['REQUEST_METHOD'] == 'POST' && ! GETPOSTISSET('token')) // Note: offender can still send request by GET { dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused by CSRFCHECK_WITH_TOKEN protection. Token not provided."); print "Access by POST method refused by CSRF protection in main.inc.php. Token not provided.\n"; @@ -368,17 +368,14 @@ if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf-> die; } - //if ($_SERVER['REQUEST_METHOD'] === 'POST') // This test must be after loading $_SESSION['token']. - //{ if (GETPOSTISSET('token') && GETPOST('token', 'alpha') != $_SESSION['token']) { dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused due to invalid token, so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. - if ($conf->global->MAIN_FEATURES_LEVEL>1) setEventMessages('Unset POST by CSRF protection in main.inc.php (POST was already done or was done by a not allowed web page).'."
\n".'$_SERVER[REQUEST_URI] = '.$_SERVER['REQUEST_URI'].' $_SERVER[REQUEST_METHOD] = '.$_SERVER['REQUEST_METHOD'].' GETPOST(token) = '.GETPOST('token', 'alpha').' $_SESSION[token] = '.$_SESSION['token'], null, 'warnings'); + if ($conf->global->MAIN_FEATURES_LEVEL>1) setEventMessages('Unset POST by CSRF protection in main.inc.php (POST for this token was already done or was done by a not allowed web page with a wrong token).'."
\n".'$_SERVER[REQUEST_URI] = '.$_SERVER['REQUEST_URI'].' $_SERVER[REQUEST_METHOD] = '.$_SERVER['REQUEST_METHOD'].' GETPOST(token) = '.GETPOST('token', 'alpha').' $_SESSION[token] = '.$_SESSION['token'], null, 'warnings'); unset($_POST); unset($_GET['confirm']); } - //} } // Disable modules (this must be after session_start and after conf has been loaded) From 195ac8e8f6d70b60495cc6c2b99d4af2465dfab0 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Thu, 12 Sep 2019 11:18:22 +0100 Subject: [PATCH 038/233] fix : Tests for attributes exsitence in Use of posixAccount and posixGroup objectclass for users and groups in LDAP --- htdocs/user/class/user.class.php | 20 +++++++++++--------- htdocs/user/class/usergroup.class.php | 4 +++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index aa4aec74251..ae1d9afa062 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2657,17 +2657,19 @@ class User extends CommonObject if ($this->phone_mobile) $info["phpgwCellTelephoneNumber"] = $this->phone_mobile; } - $info[$conf->global->LDAP_FIELD_USERID] = $this->id; - $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; - $usergroup = new UserGroup($this->db); - $groupslist = $usergroup->listGroupsForUser($this->id); - if(!empty($groupslist)){ - foreach ($groupslist as $groupforuser) { - $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id;//Select first group in list - break; + if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; + if(!empty($info[$conf->global->LDAP_FIELD_GROUPID])){ + $usergroup = new UserGroup($this->db); + $groupslist = $usergroup->listGroupsForUser($this->id); + $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + if(!empty($groupslist)){ + foreach ($groupslist as $groupforuser) { + $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id;//Select first group in list + break; + } } } - $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY]="{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY]="{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; return $info; } diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index c0cd4d9227f..f2194b1d8b7 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -981,7 +981,9 @@ class UserGroup extends CommonObject $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:''); } - $info[$conf->global->LDAP_FIELD_GROUPID]=$this->id; + if(!empty($info[$conf->global->LDAP_FIELD_GROUPID])){ + $info[$conf->global->LDAP_FIELD_GROUPID]=$this->id; + } return $info; } From a12bd6aec8ed782c38a5a7aced80473f37921652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Sep 2019 18:55:07 +0200 Subject: [PATCH 039/233] better translation --- htdocs/langs/en_US/orders.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 256bd2a7d4d..c170e4c1248 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -152,7 +152,7 @@ OrderCreated=Your orders have been created OrderFail=An error happened during your orders creation CreateOrders=Create orders ToBillSeveralOrderSelectCustomer=To create an invoice for several orders, click first onto customer, then choose "%s". -OptionToSetOrderBilledNotEnabled=Option (from module Workflow) to set order to 'Billed' automatically when invoice is validated is off, so you will have to set status of order to 'Billed' manually. +OptionToSetOrderBilledNotEnabled=Option from module Workflow, to set order to 'Billed' automatically when invoice is validated, is not enabled, so you will have to set the status of orders to 'Billed' manually after the invoice has been generated. IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. SetShippingMode=Set shipping mode From 1439310a15197dc0383f27749744cc35c9b503f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Sep 2019 21:08:46 +0200 Subject: [PATCH 040/233] Fix margin --- htdocs/includes/ckeditor/ckeditor/contents.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/ckeditor/ckeditor/contents.css b/htdocs/includes/ckeditor/ckeditor/contents.css index 7bd09d5552a..933afb9c6f3 100644 --- a/htdocs/includes/ckeditor/ckeditor/contents.css +++ b/htdocs/includes/ckeditor/ckeditor/contents.css @@ -16,7 +16,7 @@ body /* Remove the background color to make it transparent. */ background-color: #fff; - margin: 20px; + margin: 5px; } .cke_editable From 0d3a2f800bb3fdeba33c3fcde651c92920534db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Sep 2019 21:39:57 +0200 Subject: [PATCH 041/233] fix colspan in show_project --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index db6ef2de6cb..3ce3ae7b515 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -739,7 +739,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } $db->free($result); } From 6db7414f88f717e8d16e9ba9be66f758f31c49cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Sep 2019 21:45:04 +0200 Subject: [PATCH 042/233] Create .stickler.yml --- .stickler.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .stickler.yml diff --git a/.stickler.yml b/.stickler.yml new file mode 100644 index 00000000000..b68804448b2 --- /dev/null +++ b/.stickler.yml @@ -0,0 +1,10 @@ +--- +linters: + phpcs: + standard: 'dev/setup/codesniffer/ruleset.xml' + extensions: 'php' + tab_width: 4 + fixer: true + +fixers: + enable: true From 165ee28823dd8eb741d185d58be2a7c9e4eb2a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Sep 2019 21:48:00 +0200 Subject: [PATCH 043/233] Update .editorconfig editorconfig control the github online editor --- .editorconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 2df455f0d4f..3e3bd16bb34 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,14 +1,21 @@ -# EditorConfig is awesome: http://EditorConfig.org +# EditorConfig is awesome: https://editorconfig.org # top-most EditorConfig file root = true + # Unix-style newlines with a newline ending every file [*] charset = utf-8 end_of_line = lf insert_final_newline = true + +# PHP PSR-2 Coding Standards +# http://www.php-fig.org/psr/psr-2/ [*.php] indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true [*.js] indent_style = tab [*.css] From 00394493eb2e818ce2ce06259f1cc1d0f60157fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 12 Sep 2019 22:02:39 +0200 Subject: [PATCH 044/233] Update index.php --- htdocs/accountancy/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index cad9547ec4c..7a6eb96cf6f 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -1,6 +1,7 @@ - * Copyright (C) 2016 Alexandre Spangaro +/* Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2019 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 @@ -60,6 +61,7 @@ $langs->load("loans"); llxHeader('', $langs->trans("AccountancyArea")); print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy'); +dol_fiche_head(); $step = 0; @@ -175,6 +177,7 @@ else { print $langs->trans("Module10Desc")."
\n"; } +dol_fiche_end(); llxFooter(); $db->close(); From 48e03e1ab5be55bb47158582ba37b77a44ffc4de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 01:38:41 +0200 Subject: [PATCH 045/233] Fix responsive --- htdocs/theme/eldy/global.inc.php | 9 ++++++--- htdocs/theme/md/style.css.php | 13 +++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 86b4fa82c12..cbb69df74f9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5789,10 +5789,13 @@ div.tabsElem a.tab { } .titlefield { - width: auto !important; /* We want to ignor the 30%, try to use more if you can */ + width: auto !important; /* We want to ignore the 30%, try to use more if you can */ } - .tableforfield>tr>td:first-child { - max-width: 100px; /* but no more than 100px */ + .tableforfield>tr>td:first-child, .tableforfield>tbody>tr>td:first-child, div.tableforfield div.tagtr>div.tagtd:first-of-type { + /* max-width: 100px; */ /* but no more than 100px */ + } + .tableforfield>tr>td:nth-child(2), .tableforfield>tbody>tr>td:nth-child(2), div.tableforfield div.tagtr>div.tagtd:nth-child(2) { + word-break: break-word; } .badge { line-height: 1.2em; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 205ed21bdcf..ebf6b1df23d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1137,11 +1137,17 @@ select.selectarrowonleft option { } } .linkobject { cursor: pointer; } + +table.tableforfield tr>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type { + color: #666; +} + .hideonprint { display: none; } + /* ============================================================================== */ /* Styles for dragging lines */ /* ============================================================================== */ @@ -5716,8 +5722,11 @@ border-top-right-radius: 6px; .titlefield { width: auto !important; /* We want to ignor the 30%, try to use more if you can */ } - .tableforfield>tr>td:first-child, div.tableforfield div.tagtr>div.tagtd:first-of-type { - max-width: 100px; /* but no more than 100px */ + .tableforfield>tr>td:first-child, .tableforfield>tbody>tr>td:first-child, div.tableforfield div.tagtr>div.tagtd:first-of-type { + /* max-width: 100px; */ /* but no more than 100px */ + } + .tableforfield>tr>td:nth-child(2), .tableforfield>tbody>tr>td:nth-child(2), div.tableforfield div.tagtr>div.tagtd:nth-child(2) { + word-break: break-word; } } From 5137104b927e045c9650a3e35423c6012ad8bf11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 01:38:41 +0200 Subject: [PATCH 046/233] Fix responsive --- htdocs/theme/eldy/global.inc.php | 9 ++++++--- htdocs/theme/md/style.css.php | 13 +++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a63ce37fdfe..82001a31a41 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5734,10 +5734,13 @@ div.tabsElem a.tab { } .titlefield { - width: auto !important; /* We want to ignor the 30%, try to use more if you can */ + width: auto !important; /* We want to ignore the 30%, try to use more if you can */ } - .tableforfield>tr>td:first-child { - max-width: 100px; /* but no more than 100px */ + .tableforfield>tr>td:first-child, .tableforfield>tbody>tr>td:first-child, div.tableforfield div.tagtr>div.tagtd:first-of-type { + /* max-width: 100px; */ /* but no more than 100px */ + } + .tableforfield>tr>td:nth-child(2), .tableforfield>tbody>tr>td:nth-child(2), div.tableforfield div.tagtr>div.tagtd:nth-child(2) { + word-break: break-word; } .badge { line-height: 1.2em; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c621e909095..3b9064e51a1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1133,11 +1133,17 @@ select.selectarrowonleft option { } } .linkobject { cursor: pointer; } + +table.tableforfield tr>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type { + color: #666; +} + .hideonprint { display: none; } + /* ============================================================================== */ /* Styles for dragging lines */ /* ============================================================================== */ @@ -5835,8 +5841,11 @@ border-top-right-radius: 6px; .titlefield { width: auto !important; /* We want to ignor the 30%, try to use more if you can */ } - .tableforfield>tr>td:first-child, div.tableforfield div.tagtr>div.tagtd:first-of-type { - max-width: 100px; /* but no more than 100px */ + .tableforfield>tr>td:first-child, .tableforfield>tbody>tr>td:first-child, div.tableforfield div.tagtr>div.tagtd:first-of-type { + /* max-width: 100px; */ /* but no more than 100px */ + } + .tableforfield>tr>td:nth-child(2), .tableforfield>tbody>tr>td:nth-child(2), div.tableforfield div.tagtr>div.tagtd:nth-child(2) { + word-break: break-word; } } From 9eb736b110f63345d6baeb4d961be970e7782650 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 10:12:43 +0200 Subject: [PATCH 047/233] FIX stripe payment when there is a quote into address --- htdocs/public/payment/newpayment.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index a9e712c92db..3227664e3e3 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2109,13 +2109,13 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment payment_method_data: { billing_details: { name: cardholderName.value - , email: '' - thirdparty) && is_object($object->thirdparty->phone)) { ?>, phone: 'thirdparty->phone; ?>' + , email: '' + thirdparty) && is_object($object->thirdparty->phone)) { ?>, phone: 'thirdparty->phone); ?>' thirdparty)) { ?>, address: { - city: 'thirdparty->town; ?>', - country: 'thirdparty->country_code; ?>', - line1: 'thirdparty->address; ?>', - postal_code: 'thirdparty->zip; ?>'} + city: 'thirdparty->town); ?>', + country: 'thirdparty->country_code); ?>', + line1: 'thirdparty->address); ?>', + postal_code: 'thirdparty->zip); ?>'} } /* TODO Add all other known data like emails, ... to be SCA compliant */ }, save_payment_method: /* true when a customer was provided when creating payment intent. true ask to save the card */ From 7b73e2d57a66f1472619c6d67b1730d8a7116536 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 11:05:50 +0200 Subject: [PATCH 048/233] FIX label of thirdparty is wrong on open project list --- htdocs/projet/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 75cdff186d7..08181ed9a66 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -246,6 +246,9 @@ if ($resql) else dol_print_error($db); +$companystatic=new Societe($db); // We need a clean new object for next loop because current one has some properties set. + + // Open project per thirdparty print '
'; print ''; From 166d56f7a374ff6379bd09078062ebe802859c14 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 11:15:49 +0200 Subject: [PATCH 049/233] Removed function dol_micro_time. Use native PHP microtime instead. --- htdocs/core/lib/functions.lib.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 03c13a9c230..12b5f63d7e1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5753,20 +5753,6 @@ function dol_nboflines_bis($text, $maxlinesize = 0, $charset = 'UTF-8') return $nblines; } -/** - * Same function than microtime in PHP 5 but compatible with PHP4 - * - * @return float Time (millisecondes) with microsecondes in decimal part - * @deprecated Dolibarr does not support PHP4, you should use native function - * @see microtime() - */ -function dol_microtime_float() -{ - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); - - return microtime(true); -} - /** * Return if a text is a html content * From 9e851eaa78cc267d66c28cc7f75ecb5175009728 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 11:16:03 +0200 Subject: [PATCH 050/233] Removed function dol_micro_time. Use native PHP microtime instead. --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 584b7c1ee0c..b8a3fea2ce9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,7 @@ Following changes may create regressions for some external modules, but were nec * The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). * Removed deprecated method actioncomm->add(), use create() instead * If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...) - +* Removed function dol_micro_time. Use native PHP microtime instead. ***** ChangeLog for 10.0.2 compared to 10.0.1 ***** From 9df4f0601d0ed4ea39b8a68b5bd65a96c0bace1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 11:18:08 +0200 Subject: [PATCH 051/233] Clean address line to be on 1 line --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 3227664e3e3..dbceb483f97 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2114,7 +2114,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment thirdparty)) { ?>, address: { city: 'thirdparty->town); ?>', country: 'thirdparty->country_code); ?>', - line1: 'thirdparty->address); ?>', + line1: 'thirdparty->address)); ?>', postal_code: 'thirdparty->zip); ?>'} } /* TODO Add all other known data like emails, ... to be SCA compliant */ }, From 44fa2e4cd115605654a5ec9a5d82a691a748fae3 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 13 Sep 2019 12:23:34 +0200 Subject: [PATCH 052/233] NEW multiselect with checkbox in categories/tags search for product list --- htdocs/product/list.php | 50 ++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index e7e8f1e4999..d8d9686ae4a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -57,7 +57,8 @@ $search_label=GETPOST("search_label", 'alpha'); $search_type = GETPOST("search_type", 'int'); $search_sale = GETPOST("search_sale", 'int'); $search_vatrate=GETPOST("search_vatrate", 'alpha'); -$search_categ = GETPOST("search_categ", 'int'); +$searchCategoryProductOperator = (GETPOST('search_category_product_operator', 'int') ? GETPOST('search_category_product_operator', 'int') : 0); +$searchCategoryProductList = GETPOST('search_category_product_list', 'array'); $search_tosell = GETPOST("search_tosell", 'int'); $search_tobuy = GETPOST("search_tobuy", 'int'); $fourn_id = GETPOST("fourn_id", 'int'); @@ -231,7 +232,8 @@ if (empty($reshook)) $search_ref=""; $search_label=""; $search_barcode=""; - $search_categ=0; + $searchCategoryProductOperator = 0; + $searchCategoryProductList = array(); $search_tosell=""; $search_tobuy=""; $search_vatrate=""; @@ -301,7 +303,7 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // $sql.=$hookmanager->resPrint; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)"; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ +if (!empty($searchCategoryProductList) || !empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'"; @@ -333,8 +335,30 @@ if ($search_vatrate) $sql .= natural_search('p.tva_tx', $search_vatrate); if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'"; if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ); -if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL"; +$searchCategoryProductSqlList = array(); +if ($searchCategoryProductOperator == 1) { + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL"; + } elseif (intval($searchCategoryProduct) > 0) { + $searchCategoryProductSqlList[] = "cp.fk_categorie = " . $db->escape($searchCategoryProduct); + } + } + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (" . implode(' OR ', $searchCategoryProductSqlList) . ")"; + } +} else { + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL"; + } elseif (intval($searchCategoryProduct) > 0) { + $searchCategoryProductSqlList[] = "p.rowid IN (SELECT fk_product FROM " . MAIN_DB_PREFIX . "categorie_product WHERE fk_categorie = " . $searchCategoryProduct . ")"; + } + } + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (" . implode(' AND ', $searchCategoryProductSqlList) . ")"; + } +} if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); @@ -421,7 +445,10 @@ if ($resql) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.="&sall=".urlencode($sall); - if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); + if ($searchCategoryProductOperator == 1) $param .= "&search_category_product_operator=" . urlencode($searchCategoryProductOperator); + foreach ($searchCategoryProductList as $searchCategoryProduct) { + $param .= "&search_category_product_list[]=" . urlencode($searchCategoryProduct); + } if ($search_ref) $param="&search_ref=".urlencode($search_ref); if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):""); @@ -430,7 +457,7 @@ if ($resql) if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy); if ($search_vatrate) $sql .= natural_search('p.tva_tx', $search_vatrate); if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); + //if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); if ($show_childproducts) $param.=($show_childproducts?"&search_show_childproducts=".urlencode($show_childproducts):""); if ($type != '') $param.='&type='.urlencode($type); if ($search_type != '') $param.='&search_type='.urlencode($search_type); @@ -465,7 +492,7 @@ if ($resql) $label='NewProduct'; if($type == Product::TYPE_SERVICE) $label='NewService'; $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type); - } + } print '
'; if ($optioncss != '') print ''; @@ -507,8 +534,11 @@ if ($resql) { $moreforfilter.='
'; $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); - $moreforfilter.='
'; + $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1); + $categoriesProductArr[-2] = '- ' . $langs->trans('NotCategorized') . ' -'; + $moreforfilter.=Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300'); + $moreforfilter.=' ' . $langs->trans('or'); + $moreforfilter.=''; } //Show/hide child products. Hidden by default From 84544b6bdc664aca71816f324280970f85da362b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 13:50:17 +0200 Subject: [PATCH 053/233] More details in log for CSRF error. --- htdocs/public/test/test_csrf.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 htdocs/public/test/test_csrf.php diff --git a/htdocs/public/test/test_csrf.php b/htdocs/public/test/test_csrf.php new file mode 100644 index 00000000000..8c242cade64 --- /dev/null +++ b/htdocs/public/test/test_csrf.php @@ -0,0 +1,22 @@ + + +This is a form to test a CSRF.
+
+Open this form into a Virtual server A.
+Change url to send request to into file to send request to virtual server B.
+ +
+
'; +?> + + + + + + + \ No newline at end of file From 70ffd6270fe5a7a91215b7c1c0eba5b22807cbce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 13:51:26 +0200 Subject: [PATCH 054/233] More details in log for CSRF error. --- htdocs/filefunc.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c035adbcd60..a4ae8c15542 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -152,7 +152,7 @@ if (empty($dolibarr_strict_mode)) $dolibarr_strict_mode=0; // For debug in php s // See also option $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN for a stronger CSRF protection. if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) { - if (! empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'GET' && ! empty($_SERVER['HTTP_HOST'])) + if (! empty($_SERVER['REQUEST_METHOD']) && ! in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) && ! empty($_SERVER['HTTP_HOST'])) { $csrfattack=false; if (empty($_SERVER['HTTP_REFERER'])) $csrfattack=true; // An evil browser was used @@ -165,8 +165,8 @@ if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) if ($csrfattack) { //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; - print "Access refused by CSRF protection in main.inc.php. Referer of form is outside server that serve the POST.\n"; - print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file).\n"; + print "Access refused by CSRF protection in main.inc.php. Referer of form (".$_SERVER['HTTP_REFERER'].") is outside the server that serve this page (with method = ".$_SERVER['REQUEST_METHOD'].").\n"; + print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n"; die; } } From 7966bfc2df727ec3c8ad9a0a143baa98160628a9 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 13 Sep 2019 15:25:16 +0200 Subject: [PATCH 055/233] fix: fill id for links (document tab) --- htdocs/core/class/link.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 283b296b3e3..e934f26324d 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -334,6 +334,7 @@ class Link extends CommonObject if($this->db->num_rows($resql) > 0) { $obj = $this->db->fetch_object($resql); + $this->id=$obj->rowid; $this->entity = $obj->entity; $this->datea = $this->db->jdate($obj->datea); $this->url = $obj->url; From b4831f9670f79fc8ea2b441f1e44451744c58610 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 17:26:07 +0200 Subject: [PATCH 056/233] Code comment --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 4b6364ea3be..93f5765c432 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1834,7 +1834,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print '
'; - print ''."\n"; + print ''."\n"; print '
'."\n"; print ''."\n"; From 7e923f6c1f68c63a0ab00de4c20cac13d7596626 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 18:51:03 +0200 Subject: [PATCH 057/233] Fix remove test code and chen paymentintent is not null --- htdocs/public/payment/newpayment.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 93f5765c432..9b3234aef29 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1909,7 +1909,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
'; - print ''; + print ''; print ''; print ' @@ -1943,7 +1943,6 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { print ''; print ''."\n"; - $urllogofull = 'http://home.destailleur.fr:805/dolibarr_dev/htdocs/viewimage.php?modulepart=mycompany&entity=1&file=logos%2Fthumbs%2Ffbm+logo_small.png'; print ''."\n"; // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code. From 8e836155338a47e6831760724e9d33141627b8dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2019 18:52:35 +0200 Subject: [PATCH 058/233] Add method getSetupIntent --- htdocs/stripe/class/stripe.class.php | 148 ++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9defab81a73..9c0bc9ebae3 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -293,7 +293,7 @@ class Stripe extends CommonObject } /** - * Get the Stripe payment intent. Create it with confirm=false + * Get the Stripe payment intent. Create it with confirmnow=false * Warning. If a payment was tried and failed, a payment intent was created. * But if we change something on object to pay (amount or other), reusing same payment intent is not allowed. * Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), @@ -312,7 +312,7 @@ class Stripe extends CommonObject * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt * @param int $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) - * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found + * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false) { @@ -503,6 +503,149 @@ class Stripe extends CommonObject } } + + /** + * Get the Stripe payment intent. Create it with confirmnow=false + * Warning. If a payment was tried and failed, a payment intent was created. + * But if we change something on object to pay (amount or other), reusing same payment intent is not allowed. + * Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), + * that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used) + * Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page + * but not when using the STRIPE_USE_NEW_CHECKOUT. + * + * @param string $description Description + * @param Societe $object Object to pay with Stripe + * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() + * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int $status Status (0=test, 1=live) + * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt + * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) + * @return \Stripe\SetupIntent|null Stripe SetupIntent or null if not found and failed to create + */ + public function getSetupIntent($description, $object, $customer, $key, $status, $usethirdpartyemailforreceiptemail = 0, $confirmnow = false) + { + global $conf; + + dol_syslog("getSetupIntent", LOG_INFO, 1); + + $error = 0; + + if (empty($status)) $service = 'StripeTest'; + else $service = 'StripeLive'; + + $setupintent = null; + + if (empty($setupintent)) + { + $ipaddress=getUserRemoteIP(); + $metadata = array('dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress); + if (is_object($object)) + { + $metadata['dol_type'] = $object->element; + $metadata['dol_id'] = $object->id; + if (is_object($object->thirdparty) && $object->thirdparty->id > 0) $metadata['dol_thirdparty_id'] = $object->thirdparty->id; + } + + $dataforintent = array( + "confirm" => $confirmnow, // Do not confirm immediatly during creation of intent + "payment_method_types" => array("card"), + "description" => $description, + "usage" => "off_session", + "metadata" => $metadata + ); + if (! is_null($customer)) $dataforintent["customer"]=$customer; + // payment_method = + // payment_method_types = array('card') + //var_dump($dataforintent); + + if ($usethirdpartyemailforreceiptemail && is_object($object) && $object->thirdparty->email) + { + $dataforintent["receipt_email"] = $object->thirdparty->email; + } + + try { + // Force to use the correct API key + global $stripearrayofkeysbyenv; + \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$status]['secret_key']); + + // Note: If all data for payment intent are same than a previous on, even if we use 'create', Stripe will return ID of the old existing payment intent. + if (empty($key)) { // If the Stripe connect account not set, we use common API usage + //$setupintent = \Stripe\SetupIntent::create($dataforintent, array("idempotency_key" => "$description")); + $setupintent = \Stripe\SetupIntent::create($dataforintent, array()); + } else { + //$setupintent = \Stripe\SetupIntent::create($dataforintent, array("idempotency_key" => "$description", "stripe_account" => $key)); + $setupintent = \Stripe\SetupIntent::create($dataforintent, array("stripe_account" => $key)); + } + //var_dump($setupintent->id); + + // Store the setup intent + /*if (is_object($object)) + { + $setupintentalreadyexists = 0; + // Check that payment intent $setupintent->id is not already recorded. + $sql = "SELECT pi.rowid"; + $sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi"; + $sql.= " WHERE pi.entity IN (".getEntity('societe').")"; + $sql.= " AND pi.ext_payment_site = '" . $service . "'"; + $sql.= " AND pi.ext_payment_id = '".$this->db->escape($setupintent->id)."'"; + + dol_syslog(get_class($this) . "::getPaymentIntent search if payment intent already in prelevement_facture_demande", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num) + { + $obj = $this->db->fetch_object($resql); + if ($obj) $setupintentalreadyexists++; + } + } + else dol_print_error($this->db); + + // If not, we create it. + if (! $setupintentalreadyexists) + { + $now=dol_now(); + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; + $sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($setupintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', " . $conf->entity . ", '" . $service . "')"; + $resql = $this->db->query($sql); + if (! $resql) + { + $error++; + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this) . "::PaymentIntent failed to insert paymentintent with id=".$setupintent->id." into database."); + } + } + } + else + { + $_SESSION["stripe_setup_intent"] = $setupintent; + }*/ + } + catch(Exception $e) + { + /*var_dump($dataforintent); + var_dump($description); + var_dump($key); + var_dump($setupintent); + var_dump($e->getMessage());*/ + $error++; + $this->error = $e->getMessage(); + } + } + + dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); + + if (! $error) + { + return $setupintent; + } + else + { + return null; + } + } + + /** * Get the Stripe card of a company payment mode (with option to create it on Stripe if not linked yet) * @@ -609,6 +752,7 @@ class Stripe extends CommonObject /** * Create charge with public/payment/newpayment.php, stripe/card.php, cronjobs or REST API + * This is using old Stripe API charge. * * @param int $amount Amount to pay * @param string $currency EUR, GPB... From aad6b003fb13ff1fd708450276d858b8bccecdff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 00:02:48 +0200 Subject: [PATCH 059/233] Add cache in fetch_optionnals() to avoid duplicate call to fetch_name_optionals_label --- htdocs/core/class/commonobject.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ebfe7f1abee..26102b9b42a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4517,7 +4517,7 @@ abstract class CommonObject $parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams); $reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - + if(empty($reshook)) { dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null')); @@ -4902,13 +4902,12 @@ abstract class CommonObject if (! is_array($optionsArray)) { // If $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page. - // TODO Use of existing $extrafield is not yet ready (must mutualize code that use extrafields in form first) - // global $extrafields; - //if (! is_object($extrafields)) - //{ + global $extrafields; + if (! isset($extrafields) || ! is_object($extrafields)) + { require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - //} + } // Load array of extrafields for elementype = $this->table_element if (empty($extrafields->attributes[$this->table_element]['loaded'])) From 4420af683d206ae06a1956f4ada932efcbec39e2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 14 Sep 2019 05:44:28 +0200 Subject: [PATCH 060/233] Fix Bank entries - nowrap on amount --- htdocs/compta/bank/bankentries_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 5609bb6b598..0a63e70d992 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1356,7 +1356,7 @@ if ($resql) // Debit if (! empty($arrayfields['b.debit']['checked'])) { - print '
'; + if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) { + $backgroundcolor = "class='oddeven'"; + } else { + if ($objp->amount < 0) + { + if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) { + $color = '#fca955'; + } else { + $color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR1; + } + $backgroundcolor = 'style="background-color: ' . $color . ';"'; + } else { + if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) { + $color = '#7fdb86'; + } else { + $color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR2; + } + $backgroundcolor = 'style="background-color: ' . $color . ';"'; + } + } + print ''; // Ref if (! empty($arrayfields['b.rowid']['checked'])) diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 47295ec7e31..44f80c7c3b7 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -169,3 +169,7 @@ FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make d AutoReportLastAccountStatement=Automatically fill the field 'number of bank statement' with last statement number when making reconciliation CashControl=POS cash fence NewCashFence=New cash fence +BankColorizeMovement=Colorize movements +BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements +BankColorizeMovementName1=Background color for debit movement +BankColorizeMovementName2=Background color for credit movement From 5ba6a90acc48905c95ed371d915edb025f257573 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:49:40 +0200 Subject: [PATCH 074/233] Fix responsive --- htdocs/societe/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 4657a3e3f64..2010edeb217 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -288,7 +288,7 @@ if ($result) print ''; // Name - print '\n"; // Type From 6c078bdcb07112798a1620e4b1437cb6751df459 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:53:41 +0200 Subject: [PATCH 075/233] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3eb9f24112d..9202e31308b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1059,7 +1059,7 @@ BackgroundImageLogin=Background image PermanentLeftSearchForm=Permanent search form on left menu DefaultLanguage=Default language EnableMultilangInterface=Enable multilanguage support -EnableShowLogo=Show logo on left menu +EnableShowLogo=Show the company logo in the menu CompanyInfo=Company/Organization CompanyIds=Company/Organization identities CompanyName=Name From 7019e69ee2d5825da1174220041b6ca596770ef7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:09:36 +0200 Subject: [PATCH 076/233] FIX regression with option to hide picto on top menu --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/theme/eldy/global.inc.php | 51 ++++++++++++++++++++++++++----- htdocs/theme/md/style.css.php | 46 +++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 12b5f63d7e1..86d02bcf22c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7265,7 +7265,7 @@ function printCommonFooter($zone = 'private') { print "\n"; print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n"; - print 'jQuery(".menuhider").click(function(event) {'; + print 'jQuery("li.menuhider").click(function(event) {'; print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n"; print ' console.log("We click on .menuhider");'."\n"; print ' $("body").toggleClass("sidebar-collapse")'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index cbb69df74f9..5a12e50eaef 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1058,6 +1058,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 6px; + margin-right: 8px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after, #mainmenutd_menu::after { + content: unset !important; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { border-top: none !important; border-left: none !important; @@ -1504,9 +1539,6 @@ li.tmenu, li.tmenusel { li.menuhider:hover { background-image: none !important; } -li.tmenusel, li.tmenu:hover { - /* background: rgba(0, 0, 0, 0.1); */ -} li.tmenusel::after, li.tmenu:hover::after{ content: ""; @@ -1559,7 +1591,7 @@ div.tmenucenter padding-top: 2px; height: px; - width: 100%; + /* width: 100%; */ } #menu_titre_logo { padding-top: 0; @@ -1965,8 +1997,8 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: 50px; - height: 50px; + line-height: px; + height: px; } .atoplogin, .atoplogin:hover { color: # !important; @@ -2003,8 +2035,8 @@ img.login, img.printer, img.entity { font-weight: bold; } .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */ - width: 32px; - height: 32px; + width: px; + height: px; border-radius: 50%; background-size: contain; background-size: contain; @@ -5676,6 +5708,9 @@ div.tabsElem a.tab { /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ @media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { + li.tmenucompanylogo { + display: none; + } div.mainmenu { height: 23px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ebf6b1df23d..8c78e8be88b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1948,6 +1948,11 @@ foreach($mainmenuusedarray as $val) display: none; } +.topmenuimage { + + display: none; + +} a.tmenuimage { display: block; } @@ -2232,6 +2237,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 12px; + margin-right: 6px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after { + content: unset; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { font-family: ; @@ -5624,7 +5664,7 @@ border-top-right-radius: 6px; } .menuhider { - width: 40px; + width: px; } /* nboftopmenuentries = , fontsize= */ @@ -5659,6 +5699,10 @@ border-top-right-radius: 6px; /* rule to reduce top menu - 2nd reduction */ @media only screen and (max-width: px) { + li.tmenucompanylogo { + display: none; + } + div.tmenucenter { max-width: px; /* size of viewport */ text-overflow: clip; From 544a1237bc0cc0d65cf3150d536e8f23a0d9cced Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:09:36 +0200 Subject: [PATCH 077/233] FIX regression with option to hide picto on top menu --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/theme/eldy/global.inc.php | 51 ++++++++++++++++++++++++++----- htdocs/theme/md/style.css.php | 46 +++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3d7c9ad0ae2..b6b691117a5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7226,7 +7226,7 @@ function printCommonFooter($zone = 'private') { print "\n"; print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n"; - print 'jQuery(".menuhider").click(function(event) {'; + print 'jQuery("li.menuhider").click(function(event) {'; print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n"; print ' console.log("We click on .menuhider");'."\n"; print ' $("body").toggleClass("sidebar-collapse")'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 82001a31a41..c3ddd4ff7e2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1026,6 +1026,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 6px; + margin-right: 8px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after, #mainmenutd_menu::after { + content: unset !important; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { border-top: none !important; border-left: none !important; @@ -1469,9 +1504,6 @@ li.tmenu, li.tmenusel { li.menuhider:hover { background-image: none !important; } -li.tmenusel, li.tmenu:hover { - /* background: rgba(0, 0, 0, 0.1); */ -} li.tmenusel::after, li.tmenu:hover::after{ content: ""; @@ -1524,7 +1556,7 @@ div.tmenucenter padding-top: 2px; height: px; - width: 100%; + /* width: 100%; */ } #menu_titre_logo { padding-top: 0; @@ -1930,8 +1962,8 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: 50px; - height: 50px; + line-height: px; + height: px; } .atoplogin, .atoplogin:hover { color: # !important; @@ -1968,8 +2000,8 @@ img.login, img.printer, img.entity { font-weight: bold; } .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */ - width: 32px; - height: 32px; + width: px; + height: px; border-radius: 50%; background-size: contain; background-size: contain; @@ -5621,6 +5653,9 @@ div.tabsElem a.tab { /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ @media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { + li.tmenucompanylogo { + display: none; + } div.mainmenu { height: 23px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3b9064e51a1..ee0515da6fe 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1938,6 +1938,11 @@ foreach($mainmenuusedarray as $val) display: none; } +.topmenuimage { + + display: none; + +} a.tmenuimage { display: block; } @@ -2222,6 +2227,41 @@ div.blockvmenulogo { border-bottom: 0 !important; } +.backgroundforcompanylogo { + margin: px; + margin-left: 12px; + margin-right: 6px; + background-color: rgba(255,255,255,0.7); + padding: 0; + border-radius: 5px; + height: px; + /* width: 100px; */ + max-width: 100px; + vertical-align: middle; +} +.backgroundforcompanylogo img.mycompany { + object-fit: contain; + width: inherit; + height: inherit; +} +#mainmenutd_companylogo::after { + content: unset; +} +li#mainmenutd_companylogo .tmenucenter { + width: unset; +} +li#mainmenutd_companylogo { + min-width: unset !important; +} + + li#mainmenutd_home { + min-width: unset !important; + } + li#mainmenutd_home .tmenucenter { + width: unset; + } + + div.blockvmenupair, div.blockvmenuimpair { font-family: ; @@ -5743,7 +5783,7 @@ border-top-right-radius: 6px; } .menuhider { - width: 40px; + width: px; } /* nboftopmenuentries = , fontsize= */ @@ -5778,6 +5818,10 @@ border-top-right-radius: 6px; /* rule to reduce top menu - 2nd reduction */ @media only screen and (max-width: px) { + li.tmenucompanylogo { + display: none; + } + div.tmenucenter { max-width: px; /* size of viewport */ text-overflow: clip; From 755057c99f6110ee30a622cb488f55ab8e956c07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:15:46 +0200 Subject: [PATCH 078/233] FIX regression with option to hide picto on top menu --- htdocs/core/menus/standard/eldy.lib.php | 55 ++++++++++++------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a4eb2d57053..ba4fd896cd6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -55,22 +55,23 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $usemenuhider = 1; - // Show/Hide vertical menu + // Show/Hide vertical menu. The hamburger icon for .menuhider action. if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); + $menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } $menu_arr = array(); + // Home $menu_arr[] = array( 'name' => 'Home', 'link' => '/index.php?mainmenu=home&leftmenu=home', - 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)? '   ' : "Home") , + 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : "Home") , 'level' => 0, 'enabled' => $showmode = 1, 'target' => $atarget, @@ -473,8 +474,30 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu->liste = dol_sort_array($menu->liste, 'position'); // Output menu entries + // Show logo company + if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); + } + else + { + $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + } + $title=$langs->trans("GoIntoSetupToChangeLogo"); + + print "\n".''."\n"; + print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); + + print ''."\n"; + + print_end_menu_entry(4); + } + if (empty($noout)) { - foreach($menu->liste as $menkey => $menuval) { + foreach($menu->liste as $menuval) { print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']); print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url']!='#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget)); print_end_menu_entry($menuval['enabled']); @@ -615,30 +638,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $usemenuhider = 0; - // Show logo company - if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; - if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) - { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); - } - else - { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; - } - $title=$langs->trans("GoIntoSetupToChangeLogo"); - print "\n".''."\n"; - print ''."\n"; - } - if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page { print "\n"; From 76b366836877de877796f9bf99cac21488c241ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:15:59 +0200 Subject: [PATCH 079/233] FIX regression with option to hide picto on top menu --- htdocs/core/menus/standard/eldy.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b1c3111034f..dbf3ede88f9 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -55,14 +55,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $usemenuhider = 1; - // Show/Hide vertical menu - if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + // Show/Hide vertical menu. The hamburger icon for .menuhider action. + if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); + $menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); } $menu_arr = array(); @@ -70,7 +70,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu_arr[] = array( 'name' => 'Home', 'link' => '/index.php?mainmenu=home&leftmenu=home', - 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)? '   ' : "Home") , + 'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '' : "Home") , 'level' => 0, 'enabled' => $showmode = 1, 'target' => $atarget, From f5771e49d8c45ae98e821277dd96abb187ed7e42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:21:52 +0200 Subject: [PATCH 080/233] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5a12e50eaef..5beebb89a36 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1060,7 +1060,7 @@ div.blockvmenulogo } .backgroundforcompanylogo { margin: px; - margin-left: 6px; + margin-left: 8px; margin-right: 8px; background-color: rgba(255,255,255,0.7); padding: 0; From 27e3a2cb1d4db962246298b2a6940b71ce43e103 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:32:43 +0200 Subject: [PATCH 081/233] Update perms.php --- htdocs/user/perms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 209e68048c7..137ac659fd7 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -59,7 +59,7 @@ $socid=0; if (isset($user->societe_id) && $user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); // A user can always read its own card if not advanced perms enabled, or if he has advanced perms, except for admin -if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms)) && empty($user->admin)) +if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms) && empty($user->admin))) { accessforbidden(); } From 4d0ef334713b80f7010d86770be2933d6d252f13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:43:03 +0200 Subject: [PATCH 082/233] FIX #11857 --- htdocs/comm/action/index.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 48165361d7c..d42b1b7d134 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -607,9 +607,7 @@ if ($resql) $event->fk_element=$obj->fk_element; $event->elementtype=$obj->elementtype; - $event->societe->id=$obj->fk_soc; $event->thirdparty_id=$obj->fk_soc; - $event->contact->id=$obj->fk_contact; $event->contact_id=$obj->fk_contact; // Defined date_start_in_calendar and date_end_in_calendar property @@ -1569,28 +1567,31 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->type_code == 'ICALEVENT') print '
('.dol_trunc($event->icalname, $maxnbofchar).')'; + $thirdparty_id = ($event->thirdparty_id > 0 ? $event->thirdparty_id : ((is_object($event->societe) && $event->societe->id > 0) ? $event->societe->id : 0)); + $contact_id = ($event->contact_id > 0 ? $event->contact_id : ((is_object($event->contact) && $event->cotact->id > 0) ? $event->contact->id : 0)); + // If action related to company / contact $linerelatedto=''; - if (! empty($event->societe->id) && $event->societe->id > 0) + if ($thirdparty_id > 0) { - if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id])) + if (! isset($cachethirdparties[$thirdparty_id]) || ! is_object($cachethirdparties[$thirdparty_id])) { $thirdparty=new Societe($db); - $thirdparty->fetch($event->societe->id); - $cachethirdparties[$event->societe->id]=$thirdparty; + $thirdparty->fetch($thirdparty_id); + $cachethirdparties[$thirdparty_id]=$thirdparty; } - else $thirdparty=$cachethirdparties[$event->societe->id]; + else $thirdparty=$cachethirdparties[$thirdparty_id]; if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1, '', 0); } - if (! empty($event->contact->id) && $event->contact->id > 0) + if (! empty($contact_id) && $contact_id > 0) { - if (! is_object($cachecontacts[$event->contact->id])) + if (! is_object($cachecontacts[$contact_id])) { $contact=new Contact($db); - $contact->fetch($event->contact->id); - $cachecontacts[$event->contact->id]=$contact; + $contact->fetch($contact_id); + $cachecontacts[$contact_id]=$contact; } - else $contact=$cachecontacts[$event->contact->id]; + else $contact=$cachecontacts[$contact_id]; if ($linerelatedto) $linerelatedto.=' '; if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1, '', 0); } From ab07da02c4cabdfecb9220d36bac3304ed6270c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 15:53:04 +0200 Subject: [PATCH 083/233] Fix scrutinizer --- htdocs/stripe/admin/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 02039f3edc2..c3c008a5874 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -221,7 +221,7 @@ if (empty($conf->stripeconnect->enabled)) $endpoint = \Stripe\WebhookEndpoint::retrieve($conf->global->STRIPE_TEST_WEBHOOK_ID); $endpoint->enabled_events = $stripearrayofwebhookevents; if (GETPOST('webhook', 'alpha') == $conf->global->STRIPE_TEST_WEBHOOK_ID) { - if (empty(GETPOST('status', 'alpha'))) { + if (! GETPOST('status', 'alpha')) { $endpoint->disabled = true; } else { $endpoint->disabled = false; From 23860b15ee9b09ee146696eec9d235c875a5097a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 16:00:01 +0200 Subject: [PATCH 084/233] Try a fix for #11852 --- htdocs/societe/class/societe.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 26ad0c6bed9..0172d67e5c7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3914,17 +3914,17 @@ class Societe extends CommonObject while($obj=$this->db->fetch_object($resql)) { $tmpobject->id=$obj->rowid; - if ($obj->fk_statut != Facture::STATUS_DRAFT // Not a draft - && ! ($obj->fk_statut == Facture::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice + if ($obj->fk_statut != $tmpobject::STATUS_DRAFT // Not a draft + && ! ($obj->fk_statut == $tmpobject::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice ) { $outstandingTotal+= $obj->total_ht; $outstandingTotalIncTax+= $obj->total_ttc; } if ($obj->paye == 0 - && $obj->fk_statut != Facture::STATUS_DRAFT // Not a draft - && $obj->fk_statut != Facture::STATUS_ABANDONED // Not abandonned - && $obj->fk_statut != Facture::STATUS_CLOSED) // Not classified as paid + && $obj->fk_statut != $tmpobject::STATUS_DRAFT // Not a draft + && $obj->fk_statut != $tmpobject::STATUS_ABANDONED // Not abandonned + && $obj->fk_statut != $tmpobject::STATUS_CLOSED) // Not classified as paid //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason { $paiement = $tmpobject->getSommePaiement(); @@ -3935,7 +3935,11 @@ class Societe extends CommonObject } //if credit note is converted but not used - if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed())$outstandingOpened-=$tmpobject->getSumFromThisCreditNotesNotUsed(); + // TODO Do this also for customer ? + if($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed()) + { + $outstandingOpened-=$tmpobject->getSumFromThisCreditNotesNotUsed(); + } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } From 5d4f7029209ab1d2daf0c49b417d3f34014b3956 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 15 Sep 2019 16:38:03 +0200 Subject: [PATCH 085/233] Remove bas copy / paste --- htdocs/societe/paymentmodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 4a34a2b360f..922fea064ec 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -481,7 +481,7 @@ if (empty($reshook)) $_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid', 'int'), 'alpha'); $_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid', 'int'), 'alpha'); } - https://dashboard.stripe.com/search?query=risk_level%3Ahighest&account=acct_1CVGWQLYhjvFj9Sz + $id = $socid; $upload_dir = $conf->societe->multidir_output[$object->entity]; $permissioncreate=$user->rights->societe->creer; From 5d0ba10f34a24d2f288b6150ad4c4d49402a0d79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 17:04:08 +0200 Subject: [PATCH 086/233] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 89dd7ff823a..524e36fda6e 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -194,7 +194,7 @@ class Products extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" * @return array Array of product objects * - * @url GET supplier + * @url GET supplier_prices */ public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') { From 48cbcdc7571922af74a829c11e5253b24a28e567 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 15 Sep 2019 17:08:21 +0200 Subject: [PATCH 087/233] Fix #11876 --- htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index 70750494a10..737fe66f9da 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -70,7 +70,7 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1); -INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12, 8, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-24DEC', 0, 41, '', 0, 12, 24, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1); From 12d67c5f855de196a56823d2c844ec3c589ad5d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 17:18:10 +0200 Subject: [PATCH 088/233] Rename api to get all purchase prices --- htdocs/product/class/api_products.class.php | 177 ++++++++++---------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 524e36fda6e..812c2df7459 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -178,93 +178,6 @@ class Products extends DolibarrApi } return $obj_ret; } - - /** - * List supplier's products - * - * Get a list of supplier's products - * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit for list - * @param int $page Page number - * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) - * @param int $category Use this param to filter list by category - * @param int $supplier Use this param to filter list by supplier - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" - * @return array Array of product objects - * - * @url GET supplier_prices - */ - public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') - { - global $db, $conf; - $obj_ret = array(); - $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; - $sql = "SELECT t.rowid, t.ref, t.ref_ext"; - $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; - if ($category > 0) { - $sql.= ", ".MAIN_DB_PREFIX."categorie_product as c"; - } - $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; - - $sql.= ' WHERE t.entity IN ('.getEntity('product').')'; - - if ($supplier > 0) { - $sql.= " AND s.fk_soc = ".$db->escape($supplier); - } - $sql.= " AND s.fk_product = t.rowid "; - // Select products of given category - if ($category > 0) { - $sql.= " AND c.fk_categorie = ".$db->escape($category); - $sql.= " AND c.fk_product = t.rowid "; - } - if ($mode == 1) { - // Show only products - $sql.= " AND t.fk_product_type = 0"; - } elseif ($mode == 2) { - // Show only services - $sql.= " AND t.fk_product_type = 1"; - } - // Add sql filters - if ($sqlfilters) { - if (! DolibarrApi::_checkFilters($sqlfilters)) { - throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); - } - $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; - $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; - } - $sql.= $db->order($sortfield, $sortorder); - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - $sql.= $db->plimit($limit + 1, $offset); - } - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - $i = 0; - while ($i < $min) - { - $obj = $db->fetch_object($result); - $product_static = new Product($db); - if($product_static->fetch($obj->rowid)) { - $obj_ret[] = $this->_cleanObjectDatas($product_static); - } - $i++; - } - } - else { - throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); - } - if(! count($obj_ret)) { - throw new RestException(404, 'No product found'); - } - return $obj_ret; - } /** * Create product object @@ -554,6 +467,94 @@ class Products extends DolibarrApi ); } + + /** + * List purchase prices + * + * Get a list of all purchase prices of products + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service) + * @param int $category Use this param to filter list by category of product + * @param int $supplier Use this param to filter list by supplier + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" + * @return array Array of product objects + * + * @url GET purchase_prices + */ + public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') + { + global $db, $conf; + $obj_ret = array(); + $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; + $sql.= " FROM ".MAIN_DB_PREFIX."product as t"; + if ($category > 0) { + $sql.= ", ".MAIN_DB_PREFIX."categorie_product as c"; + } + $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; + + $sql.= ' WHERE t.entity IN ('.getEntity('product').')'; + + if ($supplier > 0) { + $sql.= " AND s.fk_soc = ".$db->escape($supplier); + } + $sql.= " AND s.fk_product = t.rowid "; + // Select products of given category + if ($category > 0) { + $sql.= " AND c.fk_categorie = ".$db->escape($category); + $sql.= " AND c.fk_product = t.rowid "; + } + if ($mode == 1) { + // Show only products + $sql.= " AND t.fk_product_type = 0"; + } elseif ($mode == 2) { + // Show only services + $sql.= " AND t.fk_product_type = 1"; + } + // Add sql filters + if ($sqlfilters) { + if (! DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + $sql.= $db->plimit($limit + 1, $offset); + } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; + while ($i < $min) + { + $obj = $db->fetch_object($result); + $product_static = new Product($db); + if($product_static->fetch($obj->rowid)) { + $obj_ret[] = $this->_cleanObjectDatas($product_static); + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); + } + if(! count($obj_ret)) { + throw new RestException(404, 'No product found'); + } + return $obj_ret; + } + /** * Get purchase prices for a product * @@ -602,7 +603,7 @@ class Products extends DolibarrApi if($result) { $this->product = new ProductFournisseur($this->db); $this->product->fetch($id, $ref); - $this->product->list_product_fournisseur_price($id, $sortfield, $sortorder, 0, 0); + $this->product->list_product_fournisseur_price($id, '', '', 0, 0); } return $this->_cleanObjectDatas($this->product); From 4db6badfc2bd954ff11a918601d6fb4ce41a650f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 10:24:41 +0200 Subject: [PATCH 089/233] Fix link when no title in search of website content --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 5d4c259bf9c..6394428bd42 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3308,7 +3308,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print '
'; print ''; print ''; print ''; From 6e806a5aed63476c464c5e58c0aad80388c44e59 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 16 Sep 2019 10:37:55 +0200 Subject: [PATCH 090/233] FIX empty cache when we want to load specific warehouses in select --- htdocs/product/class/html.formproduct.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index e356226dd2f..56d5b4bea74 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -243,6 +243,7 @@ class FormProduct $out=''; if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; + if (!empty($fk_product)) $this->cache_warehouses = array(); $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); $nbofwarehouses=count($this->cache_warehouses); From eb70411ae0d7fd2faeccad56a50d5ab3d303d597 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:01:09 +0200 Subject: [PATCH 091/233] Css demo --- htdocs/public/demo/demo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index d137b7be456..e84b67f4b7d 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -99,7 +99,7 @@ img.demothumb { width: 110px; } .demobackground { - background-image: url('dolibarr_demo_ban.jpg'); + background-image: linear-gradient(to bottom, rgba(200,200,255,0.8), rgba(210,220,255,0.5)), url('dolibarr_demo_ban.jpg'); background-size: cover; object-fit: contain; height: 140px; From f5dd4f4f9e9252d22de40542df2370ddea47f6ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:08:34 +0200 Subject: [PATCH 092/233] css --- htdocs/public/demo/demo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index e84b67f4b7d..99cda615b48 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -99,7 +99,7 @@ img.demothumb { width: 110px; } .demobackground { - background-image: linear-gradient(to bottom, rgba(200,200,255,0.8), rgba(210,220,255,0.5)), url('dolibarr_demo_ban.jpg'); + background-image: linear-gradient(to bottom, rgba(250,250,255,0.7), rgba(250,250,255,0.4)), url('dolibarr_demo_ban.jpg'); background-size: cover; object-fit: contain; height: 140px; From abee6dceaa872333fc50b4afdb73a68da2c53fb5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:16:58 +0200 Subject: [PATCH 093/233] Fix css demo --- htdocs/public/demo/demo.css | 5 +++-- htdocs/public/demo/index.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index 99cda615b48..f84aa4ab14c 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -28,8 +28,9 @@ a:hover { /*border: 1px solid #bbb; border-radius: 8px; -moz-border-radius: 8px;*/ - background: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,255) 100%); + + max-width: 346px; } .csscolumns { margin-top: 6px; @@ -99,7 +100,7 @@ img.demothumb { width: 110px; } .demobackground { - background-image: linear-gradient(to bottom, rgba(250,250,255,0.7), rgba(250,250,255,0.4)), url('dolibarr_demo_ban.jpg'); + background-image: linear-gradient(to bottom, rgba(250,250,255,0.5), rgba(250,250,255,0.4)), url('dolibarr_demo_ban.jpg'); background-size: cover; object-fit: contain; height: 140px; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 62de885eac6..d2633d9c708 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -336,7 +336,7 @@ foreach ($demoprofiles as $profilearray) print ''."\n"; print ''."\n"; - print '
'."\n"; + print '
'."\n"; print '
'; From 23777fd5ff4ca3ed7748f49dea6461555f2ee463 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 11:19:02 +0200 Subject: [PATCH 094/233] Fix css --- htdocs/public/demo/demo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index f84aa4ab14c..7f482367eba 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -23,7 +23,7 @@ a:hover { font-weight: normal; color: #444444 !important; - margin: 8px 0px 8px 2px; + margin: 8px 2px 8px 2px; /*border: 1px solid #bbb; border-radius: 8px; From 1c5a5eb5938aef26e2143a40b119d0fe99e8b140 Mon Sep 17 00:00:00 2001 From: Daniel Seichter Date: Mon, 16 Sep 2019 13:24:21 +0200 Subject: [PATCH 095/233] Added hint for setting up database (issue #11815) --- build/docker/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/docker/README.md b/build/docker/README.md index 5a0997cf121..616cbd8fa78 100644 --- a/build/docker/README.md +++ b/build/docker/README.md @@ -23,3 +23,6 @@ The URL to go to the Dolibarr is : The URL to go to PhpMyAdmin is (login/password is root/root) : http://0.0.0.0:8080 + +Setup the database connection during the installation process, please use mariad +b (name of the database container) as database host. From 36326fa5c04e498a0b0b73c3df4e38908bfd7553 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 15:18:35 +0200 Subject: [PATCH 096/233] Add squarre logo --- htdocs/theme/dolibarr_512x512.png | Bin 0 -> 9520 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/theme/dolibarr_512x512.png diff --git a/htdocs/theme/dolibarr_512x512.png b/htdocs/theme/dolibarr_512x512.png new file mode 100644 index 0000000000000000000000000000000000000000..bd8d7ac3bfd32616c1231e0fc626ae9d5a7d5cae GIT binary patch literal 9520 zcma)i2|Sfu*Y|adWvE1vOm`(Rm3hjLArvwbnWK>Tn5RP-O1P1dp+qRNP%@qjDKcd$ z!imHo6pnfL)}{M-zx#cj`~BX}?}zK`v#zz*UVE+o8uq@eqpe0y!%Bl72)%~7iXMWH z!6O;6hYJ2J`Sz~EKMGGJ4TC-K6S(JU6nx(6rheHILCy}KzZi$4Drp!zf>kxa>bu%w zeXKp~5FZ~OAqN*HPg`p@J0Vw(YpHW*SrLQ_(NH;O;F~r(?1vq;OKGc?{MG6 zp+}Hdr$0zWS*632Z$hc6^Y#b}^;>5hcOBg(h6fCky41ZGU4uWBF4LA%R-N;yDkhHn zS+12>{(0rwh-?UxO!-r1m&7lVE7hGFULEsp1ygHjBOBj>7q*5+7k!KB0xVPz1kY#D zgFz6*A8Xv`+CIJQoK!%NOL4doC$xd{y>%SKRnv-C?beJ69rJvmL56- zbT*(bT(}f1IwB1G@k&haD4_E1k3T5(09`VC_tykA{8szQw=^tETZpyHc%9t%)a(6{I1Iq7)?CFaef8k!Ga zrxikeKAsS#=PP#6;r+0mhHGS1iyAo~`-Y-EY;SP3*F}TTf?n?}*M|70*8HOeMux>N z^8AyGdY>2MS+u}_o^I~AA&Kw#GyRz(iF=Wb^BBZU+agX)uF6M0Zf;m?L10IlmrYkg zwJ`S4v%YRd@!YL4f=PCYsgiIz9bpr+Ci7vE^vu<0IzT`CN6&V(j#TE@f@!UpUN*TJ zKbCMke3?^l;On?Jji(dlOavK{adEANV`53&P&>}RTwZ3f_pxNfE$oy@_A=-5uF$c> zW~=$H9(4tKn)Xm4IELGp$LE(iKSpg|&fQvr*$0E4X$IWUzCQFsZ&vn7@boEaBs~%= zNOz<@$*ukA6%9Re+cNLEfGgEBu}+iKc7xs}1|%)P2z|0SH4H+y{{9Vx){zlo{fL#M z6XA^vv$A?c^a0To)~=;5IRp$Z@>_~fWU2xopGC1+v zAK8QcB`U72{JkIBDeqxSIysIbYwNydSeRC*MYiQ>sgYMPfkTfZ#vkm}5V+AsLbP$BVCeo9DT`Ul;a`=9|@Qd!V+y`^Lv0)-T zrMP`r@TTl)4Tlz|q)tx@eebezw!g=(eT5^2CnVT!nV~MK;_!oDQML0jADdCBbm{c) z6G=%9J>Cy16a*m@UGaqrFGR7O?Z%FC`-=v=jPL3w;jhUY>~aB2oXYr7z!bDm_F(tB zwC9cA78kM(b+j1akuDAYY@Qj}$EkU#_ILYji=F!y3Mm8Ckl5x22qq(ueyY!0;k8%9 zKDNRx#$wmL7lM>I$1$7@ml32(bz$9pisw~F*W21=|J4c7U_j*;>HUguJeyOl8P2+NtXJQqV&zqgRmkLL1mpL&C3LxI^mbYM@E8hGR56d6t9 zyToEk`7%>}AEuO8is&;C0UBR?Ou+6qmn|ilUE?b>%OpybP{8i7jpgmVx%6%LasMG( zs^nNQTG$x;xfdU+h|D_@7kxsuJ-DgKbH=%1L0G)?Sq|dh#YkfD=vMi8`fnN-EIkVE zk*yt?-ShLwg`=IL8P^`ni?CC>M*tE^nc(MpB#Y`*6n0+a-y4i+q3rep5Fn7DJIXk^ zcJF+d-vOE1l9`E@9(qczkRck=i4QZ?=8_99X|vmJP9A))arz|CAH&pN8m%UJ1g+#e zU+`OFh^1}O#vueHSm~7@5xu2Gp8L;VKKYDgt2{trK(0(D#BVLNxCSeIet0S;3m=Y7 zY4iH?k@ZFM#~*Li$itW&I_5E)$VeJ0HqZL39|0?8egZbfwr4e{YVx~7)kM~~mRjgV z&<2;b@7a&D0~Q6YLCbo6XLEY+L^M{7eW33-e~LRf_Gw193WSZ4Xvn5m+-8|a6te^Dv2a#C0xv4bOLY2`?ItWhNzxB$zkfM$e zL3f8QF>A>u#{){KF;EPPuE!yc1q#5kX#6?6n0+8Yipr9!%i*?h>x`S z)p88`w9(NMA2`U+*u3LcZJJo3MXHQmSt-`9uf*|+it{ciELPgMqdACr!ur*msnFsp zSyo}ASf(ZfY|gFq9Y$`c@w7JcCF-{d3gq?(p4!~2+X~P#ZM)7lmB>4_8|66{CZrR^ z{wR(kvP_|=3_fzT#$woKMl(B?LQCx&x?#v*FTdPnh4o3|4Q94nP%N&j>V`o`(68g; znk|aVR{U0y1aUH}u6j#Z4O!aOa_dgr9^J0npZ2^v#Ec}5ll+$~cSMwlr*4bvEdH5a zCgcJlcjT+BxU6rt_W%bT&=WFfH&_{(A}&0DrNbTs56l>ztNP_(_w?k$*ida$)#YaX z7j%3^+#Z6U6dyjL0j7*mEKzgy0iA9U>xWi(G0 zeUN0Q)EyIm*&+kII+z4MV|Dtxv~sezXg)Y22z$c)v}Ymda@|-umD?b}R7qz$OCh}6 zBYc1oT|;A_MRA>1qrtyE>uVnAzNCMCNtB&@7R?y3DMLl+S7pcsci$Ep_XrTBblZ!* zsXyGogg>--gB-YO+Ij{!wZ3C3Y*V-)L(>t8CWz^C%a^Vcc&(}C*b>;#ly3?PR5JroUlj99~WhcKAUv(Du z-JbUE(RHJuLAtadA&TWgx@lHxFI>`)xx7a&Q9J48BjWq%)TF#01qP(q_?)}7(Goq~+IMtjB{eo|e+GhFe*hu3@bl%T;LaN`X2+?nI{18b@6r9q0mdhz%FEV&f2*b3Zbx|Q>x7S3 ziBFZi)`y-x=1E8OdV!u_1cbBxsuU&uoD|)jD6*OCEt(5_q}7HP|G=;3K@nX%LhL!x z`f9w#x!+^OSQfh9D=(!^4)8L4Z^LQhjqr+MCa0Odb#>FoZ8pfr$%Nd@xy16cvy(Nq z^kzV6Y&c7srq;)MU$@HbnIkErF|QD$Nz>Cw-PJ`ZLsF8h>(iH!^@alXDo2|lh?m6c zQSqN2&}Ac15W#Q^L;LSf&E0f$bbCxUEV6Md=*EJMUoBIpucWO~Q5AQQPLO^yk+**w zJmoyQjL{R$ExYIPJ3W5>0cN2@sVN(c+re5#72aX#z)|sk?Bfs|cokBwZW%OnXjayv z0n3Jc0`Vaw7KK=;59@MjOU;kvibv1BGL303%o)$1y&}S=cI5e4dK*>{X8cxzwOoa7 zs!PrMk;2iSCU{-s@j(7Ad^Y-zBzB6sOK*gUCI@qV@?n>=C@kLcuH#5~m2&gy*oXII zR@-v+i_K7)WT_tesBr&A--F<_usf}Jnl0yeUf;lmP;LfNJZu`3M~vT{7U)sf*^~z3 zxGqB@bI#+;x$(spS}i505Kg@kVl%060$rAtqu`Y?ZzgQ1Qev&di^*M--O}g7Jd=Y@ zyPaaYGxe3ZfBMZe<5LamZWa7*_la!>zgQbP!^K5Yz&z>e|6andPhwi_)rWhXZD)F7 zs7M;d+QoBxd=u5|CrccW%Kk8~08*pEXD!oKj%`Nz`pR?>$8hz-SZj6~ z1XsBf`Cx!(CA^X}Y{T{nV*}Y2mrzA{1Znh=;I$Cs0l_Nc)8b;bJu^YvW1j`B@#mUX zCdCCE18Hq)DY0RTEGdc2>vx196B;CLiHZ?~>Vtw~?9J11zgdM5d8HzsY`rkC6n-lR z34Y;=m%5kgUiV??($vm7CWz=KYPOWnP{LvY7TN{*iX9-xP6~_hv|%aoePcM)KlF9b zc37bhEIk?bPMDqY+Eijvt4uTlz*51|zBqCjz4^OL%VbduATod9 zkRckC2rGVlqH>?Hbo{7vr*?)#ppZ%d)+Nk}H+F}Z_Br`jLqxu=yz(uBxW@?0t)#yw zOs|Kbi;CtqO*9!n)8YN?oZ}_{@px0}=r%1i#iPkc6O|c;yxXd_Daj|!kndpp*|T2X zc^%%L>o=u?Y|N@KBIhua#W0)bQ&CLRUIlU5D5@Fm5vKb_c|P`ch%BqP#8He@p_e$i z0`G#Fw^)j_(0QaO;&CixIp+-b_B}URygR`DWhY@gxO?9P{%O$E5r}GF!jMr|RWSCE za*h+|LUEl~irpm^=G46hHgD#~vrZjeHKVc;r@<{!@FK!*Mn#Z(T_lZ%uu>|mPlv9( zu^3 zvs$aiI8(^)P74B=Dr+KX@8&1RpXdLQq{BOYJyUNd6W`g^qHjFz%7W|j{r=^lsp;#T z(LUcvasVCt!%FcU((ll~y}ind#P%MfDI2L`nGZyaXjlD4zT8emuyU}0`4GR8V{xJ? z$Ml?{<`JwoI+m@2u<%j{vAgvvDHD;}N696DTJ?F1+oNe2 z8btwANrJNcedru}f7?RaBq`4_POL}REg}W%W0xe~vQz9OnKu`>)f;O?MJAKezw8tN zp%}U%Qr1uY%Nm|Y%V~ny`hjY}FIOE7X;E$D14 zJ1u}QI4=mf0;eqzx2LufOgNKWm%JOjfV$|t1xkD}I&i@z%<@4DhZVrd*t=hjV2xkn zewJ`|X)}~sd~sdB_2$9_x@15LDTBZ;ufxYtF((rB)nK7zd(@8c2|O2LZ)8OUc&9m& z^BfI3p=G@C7KLxW8v$&;`JD$8NnD#&UklnC88@J8;WM!nZn}V2Q5Fwm9W7>cg_*zV zxW5L6MdfMeW8QCA|7cjN1uxCSWSksph2j=};I9<$TEbZxC`)Z1LFJm$Vi(mJkGu*< zwn#Xvcms^6skYd{=OKVt+_<3^Uw(lodm|r6=I%VW`iAvEi|dZ|t3{pL0A#-wKTsZ^ z?~hKU*pv_2$Z>!G!Typ{;P4FpOW3t2vz?{x+pKBn4l-1OU@SjS*4Y+EPE`eUK;e{; z?tMrHv1#wbH?R4|q}?27kejQWaO9?Dgz7<-?Nt75>xQM@`Zrn{uYOo6O_7j?Qlh*k zR++m%kQ_2(uA(K#J$E)YA^05#H~+FD83t=|IYG6#P8v{ne(%Kj9hVn=qYQt=H_5u4 z=6o@KH&>K;{q13A1>X+ebw#`MqfG0n8n8POpFtkNY9I9@NxP%@I` zWD&@EdnFxwte+EE`WI56N6l>W4R7K9qgwJ=fJYaW=}HD^O_e5cZFZCiwrJp?)LFIt zA&Wg1X78gJ3L$;-7)%KTB!Q1JT|`r%KIr8^^37F`>ZGCl4hL z?uezfkIFtDx(Pot(IW4@^PsCt7zx~i?frPXysT|nUBDt8$6~Z-_MwVF_o&$rEod{j zrKMR6lX`~ab2J(~VM=C`Du?=GcXwiJf9KOhOg}fU;|0H}#zl?u%>Eo*AMZ<`-)J%w ziGvP@TBYOIfniekk?B$XVUXqtz(V0@`{E8-7FzYL{t-kf>@(jYA z(z{73VapNc>@JS>=64h;^_N%hvR%d%SP3 zGV)iwJ^&Z?b@{i9?^lE`NQPWJwz4X?ywI8+xG{PT)>)+j4VPZwn@jK8)ExSol|gh( zwXk#XQA@3P={dFpawxtaQca`<$`_xc@9h3@QElpYV&wAx8a2|`Q^AecXFp9KLt90l z(>{3WnEcLA!hN>hL*rBq-&K{d&6VdaT>P%g$+`ToHNAi{^6Oy)_w4Bj?x`_`Epa=Q z5G{_+mdB}<6FS?7fl}4r@wIg>P`XQz%VNlMOPy-Lz3AJCPfA~ZW=$PXv-K!T8j_6O zAE+|X*H>+zKYATJ9}R|j2?u-YjjO1ZI&>`R1?b-sp8&u@IT8Uv6MfxY=Z<_r697=~ zn8}$p#dGh^d0o=bgKWy*?&-5@>l?-|)|b`wcSeYEw*+x-(ggI|>@NF_fF~&|-#=bRnUNo9f%j+P4+Idu*CITy6_D6_W7>BQJ-91Z4q; z&<4vO!U@TQ0eaDv)L2Z@hp#XAYHKHOus&LsISf+OlvwO)zBvZ{>A)9CMAznY8ugw2{!NAVOL!T z)k0vs-okgiULWy2xQwY2<*RtedJ+(GVv`6ZZ4fd!+8gTH+(1|^g#`Wl59@P z^ayup@6MSFFju66GBtq%gYBk&efl(BT-PYMV-7ubWa`g^JEmJ}6+Qr1_rQp7`~0RJ zzUuAjwUMF9L^}ajO3W#_{k{5xU@4eg3p$EHa@XeT1$C1dcdpz<19TUHTM;y^Haoh) z1Pi2Xf@D{*7dqifgf9~SlH@4gXIq_~{9aEBTA_`CT*Dx`R<+2-xdy#0=WeS0n{DXY z%guP1`sLz;44in;!Ub)eTz|!LxM-k5xdp`IfgBDQoKU}<#NlV11kIKc=qjtfY^)yh z-i$sDAMk$dW-kr%Uois!YNNuZ>04`r&xLpZYE4~*!=!REIBMB5R36b#H50!E=O@tT zO23O@%g?p_ZJYjc9?nCSkWE)1P=g}QrnR+-A?76`ATpYL5|mr>XGpaQHF<8gx(#bG zfkd0}wz|UVC?!M~adt{`RAj04ti^%rYu~qE<P{H~*7Z=|b3dPOaDo;7jRw-`W zxd44HI#g3_auOjihl|=J|LV#`3l5cEs!w0JPh>fRgN$!^j2CHoI7@xUYjWPgh_@-V z=R5>!yiz##q4kB+j}4X4qWBDIsrOG67Y#Vq`x^1&%|OfZ9B8pb-Bv%kZUOJjlp3}IM+qlIbAH%RqZ@L7@oW&Z5O<-2@xcoZB$qx84FR{C ztH;l#Qk0vi_0#gxpHw;aF(|~(e8<-_i^%K70@?9_++z&H+>oG~`$NjnMw9#Wo7Zhi z-)4?#w&0W@pmFWnf-OPUN@Q_613k)2$RXS+)m8in#O(E+%?jwJe%;K0R+NkyFI#sU zr{&XY_isqBQwo7PaZ+7h4t_L``!H}UmZT~R?C=xQM^i~8>c<0lvysq9jRri$H}gTc zxUtoFeP%lg*zNX)_0-~wiT#h|3d3ynEuUN33>5!NkB0Xagg`g6%-LtmnVkEg)wD;K zpogl}?r_ojf#HxqReCK!V9~s}sZCbSS-;cx6eRtTB<}x{n0@DGgc3Enb)4s@NH&@*BwO;xShIe*`}kr59(bXn1J0;zYh)imht>p7^#5P73KVPoBp^V?D4 z-eeS+4cf?5U^7o1sdltJQ(RW+19d4B)d-zwrG({*{CY~>G%IW$stYT{%XWoxK{rD0 z-}vMtLn8p?B#y;wm+YmYVFf*`*9KTe#Y37^wNgrHS`!>c%MpA|tA(5>$Rkx<5yRo@zs94>t4n&ZOa!qsN&;2Q`HnYxkXZwx%lVda6$Ynk zYh$tkzN*8rGZ@2_tmQ~=&&!GVymmaAqS=D!xC3fSzxr#v7FF(G$Z92#7w@-Q)68KA zjS{oc1=QQ6Dl?0;T56cV7zox^GHO+`{a0TfGOe_KK;%{IM8V^i&bu;FSBjyo+ zIJ`d(SZ&Ip_*`&7n|PCQ7hvhRio{;sD!>SJ-HaK&PYivyG+zW-8$fI5YNB`5(tf0ZR>LW)+K8r9>&5JLs*cFkyjJ&@{C; z+{xQv{E-sJS8{nAq?ScB0R>muBxeUQz19YkE#GMe;V*+LRGNYh-LH+Tz>ZrK4tndz zvdojuLiixav}hYRHTRR7);ZK0xyWWzMcDVmBLh#sqG~b|Xq-VA^lRaRmAUF0cUm>o z$gadeJ*{i1Y(2}**SEf@RM>gCH)2z1w}_!^f}RUv3tt{$dfXLzvw6@x!vxIUY4VAU zxL8GUEL9WKi8!HwF9-F`{n~qojo%lrFq}kSsWxn|dPt z8_ECPprG&c=!Vs0-$o@xO4Jb#DBg^(qx23rv!KXU+%qFE24B}K=;>bf6H2k`=4*9{D-XQ>B&FH>JBI4 z|GG`{o9jQzisl!8-LYx Date: Mon, 16 Sep 2019 15:26:13 +0200 Subject: [PATCH 097/233] Introduce a logo squarred into setup (MAIN_INFO_SOCIETE_LOGO_SQUARRED, MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI, ...) --- htdocs/core/menus/standard/eldy.lib.php | 9 +++++++-- ...ibarr_512x512.png => dolibarr_logo_squarred.png} | Bin 2 files changed, 7 insertions(+), 2 deletions(-) rename htdocs/theme/{dolibarr_512x512.png => dolibarr_logo_squarred.png} (100%) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ba4fd896cd6..2eead6da81d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -478,13 +478,18 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; - if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + $mysoc->logo_squarred_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; + if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); + } + elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); } else { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png'; } $title=$langs->trans("GoIntoSetupToChangeLogo"); diff --git a/htdocs/theme/dolibarr_512x512.png b/htdocs/theme/dolibarr_logo_squarred.png similarity index 100% rename from htdocs/theme/dolibarr_512x512.png rename to htdocs/theme/dolibarr_logo_squarred.png From 555ea977c9e3a5758b94dcaa9088acd186264808 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 16 Sep 2019 15:32:31 +0200 Subject: [PATCH 098/233] NEW Add units in select products lines --- htdocs/core/class/html.form.class.php | 132 +++++++++++++++++++++----- 1 file changed, 106 insertions(+), 26 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c470231e5de..52be1cec2b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2064,6 +2064,11 @@ class Form $out=''; $outarray=array(); + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $langs->load('other'); + } + $warehouseStatusArray = array(); if (! empty($warehouseStatus)) { @@ -2114,7 +2119,7 @@ class Form } // Units if (! empty($conf->global->PRODUCT_USE_UNITS)) { - $sql .= ', u.label as unit_long, u.short_label as unit_short'; + $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; $selectFields .= ', unit_long, unit_short'; } @@ -2408,6 +2413,42 @@ class Form $outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration, 0, dol_strlen($objp->duration)-1):''; $outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration, -1):''; + // Units + $outvalUnits = ''; + if ($conf->global->PRODUCT_USE_UNITS) { + if (!empty($objp->unit_short)) { + $outvalUnits .= ' - ' . $objp->unit_short; + } + if (!empty($objp->weight)) { + $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->surface)) { + $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->volume)) { + $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if ($outdurationvalue && $outdurationunit) { + $da = array( + 'h' => $langs->trans('Hour'), + 'd' => $langs->trans('Day'), + 'w' => $langs->trans('Week'), + 'm' => $langs->trans('Month'), + 'y' => $langs->trans('Year') + ); + if (isset($da[$outdurationunit])) { + $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); + } + } + } + $opt = '\n"; $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); } @@ -2679,16 +2708,28 @@ class Form $outarray=array(); $langs->load('stocks'); + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $langs->load('other'); + } $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, p.fk_product_type,"; $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql.= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,"; $sql.= " pfp.supplier_reputation"; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; + } if (! empty($conf->barcode->enabled)) $sql.= " ,pfp.barcode"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; if ($socid) $sql.= " AND pfp.fk_soc = ".$socid; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_units u ON u.rowid = p.fk_unit"; + } $sql.= " WHERE p.entity IN (".getEntity('product').")"; $sql.= " AND p.tobuy = 1"; if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$this->db->escape($filtertype); @@ -2749,6 +2790,42 @@ class Form $outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration, 0, dol_strlen($objp->duration)-1):''; $outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration, -1):''; + // Units + $outvalUnits = ''; + if ($conf->global->PRODUCT_USE_UNITS) { + if (!empty($objp->unit_short)) { + $outvalUnits .= ' - ' . $objp->unit_short; + } + if (!empty($objp->weight)) { + $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->surface)) { + $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if (!empty($objp->volume)) { + $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); + $outvalUnits .= ' - ' . $unitToShow; + } + if ($outdurationvalue && $outdurationunit) { + $da = array( + 'h' => $langs->trans('Hour'), + 'd' => $langs->trans('Day'), + 'w' => $langs->trans('Week'), + 'm' => $langs->trans('Month'), + 'y' => $langs->trans('Year') + ); + if (isset($da[$outdurationunit])) { + $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); + } + } + } + $opt = '\n"; From 8d7d14c7305c74df7708c842d659e923614ff523 Mon Sep 17 00:00:00 2001 From: madx666 Date: Mon, 16 Sep 2019 15:39:58 +0200 Subject: [PATCH 099/233] Fix return to list on page 1 When are on page 1 on any list and we go on an object, when return to the list, we are back on page 0 --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 014ca843236..1c0b86dff88 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -748,7 +748,7 @@ if (! defined('NOLOGIN')) $_SESSION['lastsearch_contextpage_'.$relativepathstring]=$_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]; unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]); } - if (! empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1) + if (! empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 0) { $_SESSION['lastsearch_page_'.$relativepathstring]=$_SESSION['lastsearch_page_tmp_'.$relativepathstring]; unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]); @@ -2271,7 +2271,7 @@ if (! function_exists("llxFooter")) unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]); if (! empty($contextpage)) $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]=$contextpage; - if (! empty($page) && $page > 1) $_SESSION['lastsearch_page_tmp_'.$relativepathstring]=$page; + if (! empty($page) && $page > 0) $_SESSION['lastsearch_page_tmp_'.$relativepathstring]=$page; if (! empty($limit) && $limit != $conf->limit) $_SESSION['lastsearch_limit_tmp_'.$relativepathstring]=$limit; unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]); From 872f5ed85f8f0a298faaa49d33f856914c65de14 Mon Sep 17 00:00:00 2001 From: John Botella Date: Mon, 16 Sep 2019 16:49:08 +0200 Subject: [PATCH 100/233] fix_missing_expedition_table_line_tag --- htdocs/expedition/card.php | 53 ++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4202607cbd2..cab0ec3a189 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2036,27 +2036,28 @@ elseif ($id || $ref) print '
'; print '
'; - print '
'; + print ''; if ($objp->amount < 0) { print price($objp->amount * -1); @@ -1370,7 +1370,7 @@ if ($resql) // Credit if (! empty($arrayfields['b.credit']['checked'])) { - print ''; + print ''; if ($objp->amount > 0) { print price($objp->amount); From 08f056a0f44d3427494a666b193eeabe710a1b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 14 Sep 2019 09:09:41 +0200 Subject: [PATCH 061/233] Delete interface_50_modIFTTT_IFTTT.class.php IFTTT has been removed --- .../interface_50_modIFTTT_IFTTT.class.php | 147 ------------------ 1 file changed, 147 deletions(-) delete mode 100644 htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php diff --git a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php deleted file mode 100644 index c7ce8f121fc..00000000000 --- a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php +++ /dev/null @@ -1,147 +0,0 @@ - - * 2016 Christophe Battarel - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php - * \ingroup core - * \brief File of trigger for IFTTT module - */ -require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; - - -/** - * Class of triggers for IFTTT module - */ -class InterfaceIFTTT extends DolibarrTriggers -{ - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; - - $this->name = preg_replace('/^Interface/i', '', get_class($this)); - $this->family = "ifttt"; - $this->description = "Triggers of the module IFTTT"; - $this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version - $this->picto = 'ifttt'; - } - - /** - * Return name of trigger file - * - * @return string Name of trigger file - */ - public function getName() - { - return $this->name; - } - - /** - * Return description of trigger file - * - * @return string Description of trigger file - */ - public function getDesc() - { - return $this->description; - } - - /** - * Return version of trigger file - * - * @return string Version of trigger file - */ - public function getVersion() - { - global $langs; - $langs->load("admin"); - - if ($this->version == 'development') { - return $langs->trans("Development"); - } elseif ($this->version == 'experimental') { - return $langs->trans("Experimental"); - } elseif ($this->version == 'dolibarr') { - return DOL_VERSION; - } elseif ($this->version) { - return $this->version; - } else { - return $langs->trans("Unknown"); - } - } - - /** - * Function called when a Dolibarrr business event is done. - * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers - * - * @param string $action Event action code - * @param Object $object Object - * @param User $user Object user - * @param Translate $langs Object langs - * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK - */ - public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) - { - $ok = 0; - - if (empty($conf->ifttt->enabled)) return 0; // Module not active, we do nothing - - switch ($action) { - case 'THIRDPARTY_CREATED': - dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); - - include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - - // See https://platform.ifttt.com/docs/api_reference#realtime-api - - $arrayofdata=array(); - $arrayofdata['user_id']=$conf->global->IFTTT_USER_ID; - $arrayofdata['trigger_identity']=$conf->global->IFTTT_TRIGGER_IDENTITY; - $arrayofdata['name']='testabcdef'; - $arrayofdata['email']='testemailabcdef'; - - $url = 'https://realtime.ifttt.com/v1/notifications'; - - $addheaders=array( - 'IFTTT-Service-Key'=>'123', - 'Accept'=>'application/json', - 'Accept-Charset'=>'utf-8', - 'Accept-Encoding'=>'gzip, deflate', - 'Content-Type'=>'application/json', - 'X-Request-ID'=>getRandomPassword(true, null) - ); - - $result = getURLContent($url, 'POSTALREADYFORMATED', '', 1, $addheaders); - - $ok = 1; - break; - } - - return $ok; - } -} From 76f478dc4417c4d97e2c9c7b054fcfa494aa413c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 14:25:47 +0200 Subject: [PATCH 062/233] Fix look and feel --- htdocs/societe/paymentmodes.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 3731cfe07fa..90d90b388ac 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -600,7 +600,7 @@ if (empty($reshook)) $db->rollback(); } } - + if ($action == 'setkey_account_supplier') { $error = 0; @@ -819,7 +819,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '
'; print '
'; - print ''; + print '
'; if ($object->client) { @@ -872,7 +872,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; } } - + if ($object->fournisseur) { print ''; print ''; print ''; - + if (is_array($balance->available) && count($balance->available)) { foreach ($balance->available as $cpt) @@ -1322,7 +1322,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; } } - + if (is_array($balance->pending) && count($balance->pending)) { foreach ($balance->pending as $cpt) @@ -1598,7 +1598,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Edit BAN if ($socid && $action == 'edit' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1705,7 +1705,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) // Edit Card if ($socid && $action == 'editcard' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1753,7 +1753,7 @@ if ($socid && $action == 'editcard' && $user->rights->societe->creer) // Create BAN if ($socid && $action == 'create' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1854,7 +1854,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) // Create Card if ($socid && $action == 'createcard' && $user->rights->societe->creer) { - dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; From 7965804a34edf52bc8673a1b1975e1fc9d794f43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:35:00 +0200 Subject: [PATCH 063/233] Update ldap_groups.php --- htdocs/admin/ldap_groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 6dcc26a23e0..6412d2f6a59 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -58,7 +58,7 @@ if ($action == 'setvalue' && $user->admin) //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; From 9934f73574d32d8b51825a2407c674112f6e13a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:36:04 +0200 Subject: [PATCH 064/233] Update ldap_groups.php --- htdocs/admin/ldap_groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 6412d2f6a59..8ae918ce180 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -173,7 +173,7 @@ print ''; // Group id print ''; print ''; print ''; From d380ef1812535ea1adc2fdc571bf61a8d1d10e54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:37:07 +0200 Subject: [PATCH 065/233] Update usergroup.class.php --- htdocs/user/class/usergroup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 03c514f79f3..a89126b122f 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -980,8 +980,8 @@ class UserGroup extends CommonObject } $info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:''); } - if(!empty($info[$conf->global->LDAP_FIELD_GROUPID])){ - $info[$conf->global->LDAP_FIELD_GROUPID]=$this->id; + if(!empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID])){ + $info[$conf->global->LDAP_GROUP_FIELD_GROUPID]=$this->id; } return $info; } From c015bbda14b79b0046d3ddeef356c66e4aa70daa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:39:08 +0200 Subject: [PATCH 066/233] Update ldap.class.php --- htdocs/core/class/ldap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 266b41867e8..267949e2149 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -609,7 +609,7 @@ class Ldap } if ($result <= 0) { - $this->error = ldap_errno($this->connection)." ".$this->error; + $this->error = ldap_error($this->connection).' (Code '.ldap_errno($this->connection).") ".$this->error; dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); //print_r($info); return -1; From 54f0532073a3f72ef06ea7311a4bbabf4cf4a368 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 16:51:57 +0200 Subject: [PATCH 067/233] Work on #4432 --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 1 + htdocs/install/mysql/tables/llx_extrafields.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index cc375e72714..92dcdce1128 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -43,6 +43,7 @@ create table llx_entrepot_extrafields ALTER TABLE llx_entrepot_extrafields ADD INDEX idx_entrepot_extrafields (fk_object); +ALTER TABLE llx_extrafields ADD COLUMN printable boolean DEFAULT FALSE; ALTER TABLE llx_facture ADD COLUMN retained_warranty real DEFAULT NULL after situation_final; ALTER TABLE llx_facture ADD COLUMN retained_warranty_date_limit date DEFAULT NULL after retained_warranty; diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index e7ec325d428..49480479a79 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -36,6 +36,7 @@ create table llx_extrafields alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status param text, -- extra parameters to define possible values of field list varchar(255) DEFAULT '1', -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing + printable boolean DEFAULT FALSE, -- is the extrafield output on documents totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list langs varchar(64), -- example: fileofmymodule@mymodule help text, -- to store help tooltip From 844f0903da2f769ab240806381649eeac5b595df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 17:34:57 +0200 Subject: [PATCH 068/233] Fix missing fields --- htdocs/fourn/commande/list.php | 4 +++- htdocs/modulebuilder/template/myobject_list.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 18ba697bc20..db427c24c43 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1090,7 +1090,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1155,6 +1155,8 @@ if ($resql) elseif ($totalarray['totalttcfield'] == $i) print ''; else print ''; } + + print ''; } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 497f46919fd..a2bd9d39fe7 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -514,7 +514,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column From 3caa1bd43c88f180c432e8753f5693bde52381d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 18:21:37 +0200 Subject: [PATCH 069/233] FIX Debug feature orderstoinvoice for suppliers --- htdocs/fourn/card.php | 9 +-- htdocs/fourn/commande/card.php | 13 +++- htdocs/fourn/commande/orderstoinvoice.php | 76 +++++++++++++---------- htdocs/langs/en_US/orders.lang | 1 + 4 files changed, 60 insertions(+), 39 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index c65c1fde57f..90240e4cd2b 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -605,8 +605,9 @@ if ($object->id > 0) $sql2.= ' WHERE c.fk_soc = s.rowid'; $sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")"; $sql2.= ' AND s.rowid = '.$object->id; - // Show orders with status validated, shipping started and delivered (well any order we can bill) - $sql2.= " AND c.fk_statut IN (5)"; + // Show orders with status validated, shipping started and delivered (even if any order we can bill) + //$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; + $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; $sql2.= " AND c.billed = 0"; // Find order that are not already invoiced // just need to check received status because we have the billed status now @@ -826,7 +827,7 @@ if ($object->id > 0) { if (! empty($orders2invoice) && $orders2invoice > 0) { - if ($object->status == 1) + if ($object->status == 1) // Company is open { print ''; } @@ -835,7 +836,7 @@ if ($object->id > 0) print ''; } } - else print ''; + else print ''; } // Add action diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 1f6baa158da..829b82a6903 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2494,11 +2494,18 @@ elseif (! empty($object->id)) { print ''.$langs->trans("ClassifyBilled").''; } - elseif (!empty($object->linkedObjectsIds['invoice_supplier'])) + else { - if ($user->rights->fournisseur->facture->creer) + if (!empty($object->linkedObjectsIds['invoice_supplier'])) { - print ''.$langs->trans("ClassifyBilled").''; + if ($user->rights->fournisseur->facture->creer) + { + print ''.$langs->trans("ClassifyBilled").''; + } + } + else + { + print ''.$langs->trans("ClassifyBilled").''; } } } diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 093e0fd331b..75a78087366 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -73,18 +73,27 @@ $date_endy = dol_mktime(23, 59, 59, $_REQUEST["date_end_delymonth"], $_REQUEST[" $extrafields = new ExtraFields($db); + // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('facture_fourn'); if ($action == 'create') { - if (! is_array($selected)) + if (! GETPOST('createbill')) { - $error++; - setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors'); - } else { - $origin = GETPOST('origin'); - $originid = GETPOST('originid'); + $action = ''; + } + else + { + if (! is_array($selected)) + { + //$error++; + setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors'); + $action = ''; + } else { + $origin = GETPOST('origin', 'alpha'); + $originid = GETPOST('originid', 'int'); + } } } @@ -286,7 +295,6 @@ if (($action == 'create' || $action == 'add') && ! $error) { $html = new Form($db); $htmlother = new FormOther($db); $formfile = new FormFile($db); -$companystatic = new Societe($db); // Mode creation if ($action == 'create' && !$error) { @@ -324,6 +332,8 @@ if ($action == 'create' && !$error) { print ''; print ''; print ''; + print ''; + print '
'; @@ -891,12 +891,12 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices'); if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts'); } - + if (! empty($conf->stripe->enabled) && ! empty($conf->stripeconnect->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { $permissiontowrite = $user->rights->societe->creer; $stripesupplieracc = $stripe->getStripeAccount($service, $object->id); // Get Stripe OAuth connect account (no network access here) - + // Stripe customer key 'cu_....' stored into llx_societe_account print '
'; print $form->editfieldkey("StripeConnectAccount", 'key_account_supplier', $stripesupplieracc, $object, $permissiontowrite, 'string', '', 0, 2, 'socid'); @@ -905,7 +905,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (! empty($conf->stripe->enabled) && $stripesupplieracc && $action != 'editkey_account_supplier') { $connect=''; - + $url='https://dashboard.stripe.com/test/connect/accounts/'.$stripesupplieracc; if ($servicestatus) { @@ -1299,7 +1299,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ""; print '
'; } - + // List of Stripe payment modes if (! empty($conf->stripe->enabled) && ! empty($conf->stripeconnect->enabled) && $object->fournisseur && ! empty($stripesupplieracc)) { @@ -1311,7 +1311,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '
'.$langs->trans('Amount').''.$langs->trans('Currency').'
'.$langs->trans("Available").''.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' '.$langs->trans("Currency".strtoupper($cpt->currency)).'
'.$langs->trans("LDAPFieldGroupid").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldGroupidExample").' 
'.price($totalarray['totalttc']).'
'; // Ref @@ -333,13 +343,6 @@ if ($action == 'create' && !$error) { print ''; print ''; - // Third party - print ''; - print '' . "\n"; - // Date invoice print ''; - print ''; - print ''; + print ''; + // Private note if (empty($user->societe_id)) { print ''; - print ''; - print ''; + print ''; @@ -406,10 +410,10 @@ if ($action == 'create' && !$error) { print '
' . $langs->trans('RefSupplier') . '
' . $langs->trans('Customer') . ''; - print $soc->getNomUrl(1); - print ''; - print '
' . $langs->trans('Date') . ''; print $html->selectDate('', '', '', '', '', "add", 1, 1); @@ -387,18 +390,19 @@ if ($action == 'create' && !$error) { // Public note print '
' . $langs->trans('NotePublic') . ''; + print '' . $langs->trans('NotePublic') . ''; print '
' . $langs->trans('NotePrivate') . ''; + print '' . $langs->trans('NotePrivate') . ''; print '
'; - while ( $i < $n ) { + while ($i < $n) { print ''; - $i ++; + $i++; } // Button "Create Draft" @@ -465,10 +469,16 @@ if (($action != 'create' && $action != 'add') && !$error) { } // Date filter - if ($date_start && $date_end) - $sql .= " AND c.date_commande >= '" . $db->idate($date_start) . "' AND c.date_commande <= '" . $db->idate($date_end) . "'"; - if ($date_starty && $date_endy) - $sql .= " AND c.date_livraison >= '" . $db->idate($date_starty) . "' AND c.date_livraison <= '" . $db->idate($date_endy) . "'"; + //$sql.= dolSqlDateFilter("c.date_commande", GETPOST("date_startday", 'int'), GETPOST("date_startmonth", 'int'), GETPOST("date_startyear", 'int')); + //$sql.= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); + if ($date_start) + $sql .= " AND c.date_commande >= '" . $db->idate($date_start) . "'"; + if ($date_end) + $sql .= " AND c.date_commande <= '" . $db->idate($date_end) . "'"; + if ($date_starty) + $sql .= " AND c.date_livraison >= '" . $db->idate($date_starty) . "'"; + if ($date_endy) + $sql .= " AND c.date_livraison <= '" . $db->idate($date_endy) . "'"; if (! empty($sref_client)) { $sql .= natural_search('c.ref_supplier', $sref_client); @@ -484,21 +494,21 @@ if (($action != 'create' && $action != 'add') && !$error) { } $title = $langs->trans('ListOfSupplierOrders'); $title .= ' - ' . $langs->trans('StatusOrderReceivedAllShort'); + $title .= ' - ' . $soc->getNomUrl(1, 'supplier'); + $num = $db->num_rows($resql); + print load_fiche_titre($title); + $i = 0; $period = $html->selectDate($date_start, 'date_start', 0, 0, 1, '', 1, 0) . ' - ' . $html->selectDate($date_end, 'date_end', 0, 0, 1, '', 1, 0); $periodely = $html->selectDate($date_starty, 'date_start_dely', 0, 0, 1, '', 1, 0) . ' - ' . $html->selectDate($date_endy, 'date_end_dely', 0, 0, 1, '', 1, 0); - if (! empty($socid)) { - // Company - $companystatic->id = $socid; - $companystatic->nom = $soc->nom; - print '

' . $companystatic->getNomUrl(1, 'customer') . '

'; - } - print ''; + print ''; print ''; + + print ''; print ''; print_liste_field_titre('Ref', 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder); @@ -511,10 +521,12 @@ if (($action != 'create' && $action != 'add') && !$error) { // Lignes des champs de filtre print ''; + print ''; + // print '
'; // REF print ''; print ''; print ''; print ''; @@ -604,7 +616,7 @@ if (($action != 'create' && $action != 'add') && !$error) { print ''; print '
'; // print ''.$langs->trans("GoBack").''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index c170e4c1248..66de42094a6 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -156,3 +156,4 @@ OptionToSetOrderBilledNotEnabled=Option from module Workflow, to set order to 'B IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. SetShippingMode=Set shipping mode +WithReceptionFinished=With reception finished \ No newline at end of file From f45abc1b2af6ec4abc8c63b2951bc68a22f58672 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 18:26:38 +0200 Subject: [PATCH 070/233] Removed useless header --- htdocs/accountancy/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 6982475b53a..0bede00d86d 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -51,7 +51,7 @@ $hookmanager->initHooks(array('accountancyindex')); llxHeader('', $langs->trans("AccountancyArea")); print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy'); -dol_fiche_head(); +//dol_fiche_head(); $step = 0; @@ -177,7 +177,7 @@ else { print $langs->trans("Module10Desc")."
\n"; } -dol_fiche_end(); +//dol_fiche_end(); // End of page llxFooter(); From e0238705cc89222c1ecce9b8319f09c1b21f1f91 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 14 Sep 2019 19:04:43 +0200 Subject: [PATCH 071/233] Check if childtablesoncascade is not empty --- htdocs/core/class/commonobject.class.php | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d20a8d2785b..f08be052e96 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7536,18 +7536,20 @@ abstract class CommonObject } // Delete cascade first - foreach($this->childtablesoncascade as $table) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id; - $resql = $this->db->query($sql); - if (! $resql) - { - $this->error=$this->db->lasterror(); - $this->errors[]=$this->error; - $this->db->rollback(); - return -1; - } - } + if (! empty($this->childtablesoncascade)) { + foreach($this->childtablesoncascade as $table) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id; + $resql = $this->db->query($sql); + if (! $resql) + { + $this->error=$this->db->lasterror(); + $this->errors[]=$this->error; + $this->db->rollback(); + return -1; + } + } + } if (! $error) { if (! $notrigger) { From bbb62f27c72271f71e7eb89bae2a52101b3ebf4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 19:25:09 +0200 Subject: [PATCH 072/233] Update doc --- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/orderstoinvoice.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 90240e4cd2b..5ebe8ffed56 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -605,9 +605,9 @@ if ($object->id > 0) $sql2.= ' WHERE c.fk_soc = s.rowid'; $sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")"; $sql2.= ' AND s.rowid = '.$object->id; - // Show orders with status validated, shipping started and delivered (even if any order we can bill) + // Show orders with status validated, shipping started and delivered (even if any order we can bill). //$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; - $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; + $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/orderstoinvoice.php $sql2.= " AND c.billed = 0"; // Find order that are not already invoiced // just need to check received status because we have the billed status now diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 75a78087366..39f33bebb73 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -450,7 +450,7 @@ if (($action != 'create' && $action != 'add') && !$error) { $sql .= ' AND c.fk_soc = s.rowid'; // Show orders with status validated, shipping started and delivered (well any order we can bill) - $sql .= " AND c.fk_statut IN (5)"; + $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/card.php $sql .= " AND c.billed = 0"; // Find order that are not already invoiced From 21e27389d411b3fc9ba3556282ca25f095038c9b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 14 Sep 2019 20:58:12 +0200 Subject: [PATCH 073/233] NEW Bank Add an option for colorize background color of debit or credit movement --- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/bank.php | 120 +++++++++++++++++++++++- htdocs/compta/bank/bankentries_list.php | 24 ++++- htdocs/langs/en_US/banks.lang | 4 + 4 files changed, 143 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 6979c49aabc..b59c311eb2f 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -44,7 +44,7 @@ $actionsave=GETPOST('save', 'alpha'); if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=$conf->global->AGENDA_EXT_NB; -// List of aviable colors +// List of available colors $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 2a0a66fe269..44cdd5e611b 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,5 +1,4 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand @@ -28,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; @@ -38,6 +38,7 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); +$actionsave=GETPOST('save', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); @@ -60,7 +61,7 @@ if ($action == 'setbankorder') { } } -//Auto report last num releve on conciliate +// Auto report last num releve on conciliate if ($action == 'setreportlastnumreleve') { if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) { @@ -82,6 +83,58 @@ elseif ($action == 'unsetreportlastnumreleve') { } } +// Colorize movements +if ($action == 'setbankcolorizemovement') { + if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } + else { + dol_print_error($db); + } +} +elseif ($action == 'unsetbankcolorizemovement') { + if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } + else { + dol_print_error($db); + } +} + +if ($actionsave) +{ + $db->begin(); + + $i=1; $errorsaved=0; + $error=0; + + // Save colors + while ($i <= 2) + { + $color=trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha')); + if ($color=='-1') $color=''; + + $res=dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + $i++; + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + if ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -157,10 +210,11 @@ elseif ($action == 'setdoc') { /* - * view + * View */ $form = new Form($db); +$formother=new FormOther($db); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -169,6 +223,10 @@ llxHeader("", $langs->trans("BankSetupModule")); $linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); +print ''; +print ''; +print ''; + $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); @@ -372,7 +430,56 @@ foreach ($dirmodels as $reldir) { print '
'; //} +print '

'; +print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); +print ''; +print "\n"; +print ''; +print ''."\n"; +print "\n"; + +print '"; +// Active +if ($conf->global->BANK_COLORIZE_MOVEMENT) { + print ''; +} +else +{ + print '"; +} + +print "\n"; + +if(! empty($conf->global->BANK_COLORIZE_MOVEMENT)) +{ + $i=1; + while ($i <= 2) + { + $key=$i; + $color='BANK_COLORIZE_MOVEMENT_COLOR'.$key; + + print ''; + + // Label + print '"; + // Color + print ''; + print ""; + $i++; + } +} +print '
' . $langs->trans("Name") . ''.$langs->trans("Value").'
'; +print $langs->trans('BankColorizeMovementDesc'); +print "' . "\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print '' . "\n"; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; + print "
'.$langs->trans("BankColorizeMovementName".$key)."'; + print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key)?GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key):$conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset'); + print '
'; print '

'; @@ -384,7 +491,6 @@ print '

'; //{ print load_fiche_titre($langs->trans("Other"), '', ''); - print "\n"; print "\n"; print ''; @@ -416,6 +522,12 @@ print "\n"; print '
' . $langs->trans("Name") . '
'; dol_fiche_end(); +print '
'; +print ''; +print '
'; + +print "\n"; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index a8002c179be..3522d8b6c9d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017-2019 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -1110,7 +1110,27 @@ if ($resql) $bankaccount = $cachebankaccount[$objp->bankid]; } - print '
'; + print ''; print $thirdparty_static->getNomUrl(1); print "
'.$langs->trans("Container").''; - print ''.$answerrecord->title.''; + print ''.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).''; print ''.$answerrecord->description; print '
'; + print '
'; + print ''; print ''; // Adds a line numbering column if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - print ''; + print ''; } // Product/Service - print ''; + print ''; // Qty - print ''; + print ''; if ($origin && $origin_id > 0) { - print ''; + print ''; } if ($action == 'editline') { $editColspan = 3; if (empty($conf->stock->enabled)) $editColspan--; if (empty($conf->productbatch->enabled)) $editColspan--; - print ''; + print ''; } else { - print ''; + print ''; } if (! empty($conf->stock->enabled)) { - print ''; + print ''; } if (! empty($conf->productbatch->enabled)) { - print ''; + print ''; } } - print ''; - print ''; + print ''; + print ''; //print ''; if ($object->statut == 0) { @@ -2104,7 +2105,7 @@ elseif ($id || $ref) print ''; } print "\n"; - + print ''; $var=false; if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) @@ -2164,6 +2165,7 @@ elseif ($id || $ref) //var_dump($alreadysent); } + print ''; // Loop on each product to send/sent for ($i = 0 ; $i < $num_prod ; $i++) { @@ -2174,12 +2176,12 @@ elseif ($id || $ref) if(empty($reshook)) { print ''; // id of order line - print ''; + print ''; // # if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - print ''; + print ''; } // Predefined product or service @@ -2195,7 +2197,7 @@ elseif ($id || $ref) else $label = (! empty($lines[$i]->label)?$lines[$i]->label:$lines[$i]->product_label); - print ''; + print ''; // Qty in other shipments (with shipment and warehouse used) if ($origin && $origin_id > 0) { - print ''; + print ''; // Warehouse source if (! empty($conf->stock->enabled)) { - print ''; } else { - print ''; + print ''; } } } // Weight - print ''; // Volume - print ''; @@ -2473,6 +2475,7 @@ elseif ($id || $ref) // TODO Show also lines ordered but not delivered print "
  '.$langs->trans("Products").''.$langs->trans("Products").''.$langs->trans("QtyOrdered").''.$langs->trans("QtyOrdered").''.$langs->trans("QtyInOtherShipments").''.$langs->trans("QtyInOtherShipments").''; + print ''; if ($object->statut <= 1) { print $langs->trans("QtyToShip").' - '; @@ -2079,24 +2080,24 @@ elseif ($id || $ref) { if ($object->statut <= 1) { - print ''.$langs->trans("QtyToShip").''.$langs->trans("QtyToShip").''.$langs->trans("QtyShipped").''.$langs->trans("QtyShipped").''.$langs->trans("WarehouseSource").''.$langs->trans("WarehouseSource").''.$langs->trans("Batch").''.$langs->trans("Batch").''.$langs->trans("CalculatedWeight").''.$langs->trans("CalculatedVolume").''.$langs->trans("CalculatedWeight").''.$langs->trans("CalculatedVolume").''.$langs->trans("Size").'
'.($i+1).''.($i+1).''; + print ''; // Show product and description $product_static->type=$lines[$i]->fk_product_type; @@ -2215,7 +2217,7 @@ elseif ($id || $ref) } else { - print ""; + print ''; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -2231,12 +2233,12 @@ elseif ($id || $ref) } // Qty ordered - print ''.$lines[$i]->qty_asked.''.$lines[$i]->qty_asked.''; + print ''; foreach ($alreadysent as $key => $val) { if ($lines[$i]->fk_origin_line == $key) @@ -2350,12 +2352,12 @@ elseif ($id || $ref) else { // Qty to ship or shipped - print ''.$lines[$i]->qty_shipped.''.$lines[$i]->qty_shipped.''; + print ''; if ($lines[$i]->entrepot_id > 0) { $entrepot = new Entrepot($db); @@ -2385,7 +2387,7 @@ elseif ($id || $ref) if (isset($lines[$i]->detail_batch)) { print ''; - print ''; + print ''; if ($lines[$i]->product_tobatch) { $detail = ''; @@ -2405,19 +2407,19 @@ elseif ($id || $ref) } print ''; + print ''; if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->weight_units, "weight"); else print ' '; print ''; + print ''; if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units, "volume"); else print ' '; print '
\n"; + print ''; print '
'; } From 5c00712c0a142d1a472c469845c872f67e1f1663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 17:57:40 +0200 Subject: [PATCH 101/233] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 86d02bcf22c..f018bdefe53 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3015,7 +3015,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow',, '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top' ) From e43f3a0f58d03864e3fd4dd47c1d9a4b4b77f7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 18:07:06 +0200 Subject: [PATCH 102/233] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f018bdefe53..ad72b8cf22e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3015,7 +3015,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow',, '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top' ) From 5233e7d8adcff6e95f5886a828a731050c9d63ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 18:29:04 +0200 Subject: [PATCH 103/233] FIX do not output return code on screen after a select of bank account --- htdocs/cashdesk/index.php | 6 +++--- htdocs/compta/bank/ligne.php | 2 +- htdocs/paybox/admin/paybox.php | 2 +- htdocs/paypal/admin/paypal.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 8bd64c76e2b..9efe1b8ed7f 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -157,7 +157,7 @@ print ''.$langs->trans("CashDeskBankAccountForSell").''; print ''; $defaultknown=0; if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) $defaultknown=1; // If a particular stock is defined, we disable choice -print $form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2)); +$form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2)); print ''; print "\n"; @@ -166,7 +166,7 @@ print ''.$langs->trans("CashDeskBankAccountForCheque").' print ''; $defaultknown=0; if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) $defaultknown=1; // If a particular stock is defined, we disable choice -print $form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2)); +$form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2)); print ''; print "\n"; @@ -175,7 +175,7 @@ print ''.$langs->trans("CashDeskBankAccountForCB").''; print ''; $defaultknown=0; if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) $defaultknown=1; // If a particular stock is defined, we disable choice -print $form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2)); +$form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2)); print ''; print "\n"; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 40906bfd455..7581b0c4985 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -323,7 +323,7 @@ if ($result) print ''; if (! $objp->rappro && ! $bankline->getVentilExportCompta()) { - print $form->select_comptes($acct->id, 'accountid', 0, '', 0); + $form->select_comptes($acct->id, 'accountid', 0, '', 0); } else { diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index abad76ce228..8f946a30001 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -197,7 +197,7 @@ if (! empty($conf->banque->enabled)) { print ''; print $langs->trans("BankAccount").''; - print $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print ''; } diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index aefcb50369a..545fe9c368c 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -214,7 +214,7 @@ if (! empty($conf->banque->enabled)) { print ''; print $langs->trans("BankAccount").''; - print $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print ''; } From e3480780cfd6a89bd06142ccc7d10e48aeea83da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 18:31:40 +0200 Subject: [PATCH 104/233] Fix label on "Connect" button on Simple POS module --- htdocs/cashdesk/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 9efe1b8ed7f..94b3e4445f7 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -191,7 +191,7 @@ print "\n";
-
+
From 8d794049148f49af4d9531922606752ee6a38288 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Sep 2019 18:40:58 +0200 Subject: [PATCH 105/233] Fix css for responsive --- htdocs/cashdesk/index.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 94b3e4445f7..57dc1cbb394 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -96,11 +96,11 @@ else trans("Login"); ?> - + trans("Password"); ?> - + Date: Mon, 16 Sep 2019 19:08:45 +0200 Subject: [PATCH 106/233] Fix css for company logo in top menu --- htdocs/theme/eldy/global.inc.php | 6 +++--- htdocs/theme/md/style.css.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5beebb89a36..2ee73a7889b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5673,7 +5673,7 @@ div.tabsElem a.tab { /* nboftopmenuentries = , fontsize= */ /* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */ -@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1) ? round($nbtopmenuentries * 90, 0) + 240 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1; ?>px) /* reduction 1 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1) ? round($nbtopmenuentries * 90, 0) + 340 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1; ?>px) /* reduction 1 */ { div.tmenucenter { width: px; /* size of viewport */ @@ -5706,7 +5706,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ -@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { li.tmenucompanylogo { display: none; @@ -5733,7 +5733,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 3rd reduction: The menu for user is on left */ -@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ { .side-nav { z-index: 200; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8c78e8be88b..ab965b1d3d3 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5670,7 +5670,7 @@ border-top-right-radius: 6px; /* nboftopmenuentries = , fontsize= */ /* disableimages = */ /* rule to reduce top menu - 1st reduction */ -@media only screen and (max-width: px) +@media only screen and (max-width: px) { div.tmenucenter { max-width: px; /* size of viewport */ @@ -5697,7 +5697,7 @@ border-top-right-radius: 6px; } } /* rule to reduce top menu - 2nd reduction */ -@media only screen and (max-width: px) +@media only screen and (max-width: px) { li.tmenucompanylogo { display: none; From 67b73cf0e6a6f731f340c0c5141615b966019028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 20:57:20 +0200 Subject: [PATCH 107/233] Update actioncomm.class.php --- htdocs/comm/action/class/actioncomm.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 12926f9b360..7e8bd88e5bc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -772,6 +772,7 @@ class ActionComm extends CommonObject $error=0; $this->db->begin(); + $this->oldcopy = clone $this; $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; $sql.= " WHERE id=".$this->id; From f369c1a80a41dfa032dd875add059edd7a87dcb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 20:59:13 +0200 Subject: [PATCH 108/233] Update card.php --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 173770d725c..b2438175123 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -608,6 +608,7 @@ if ($action == 'update') if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { $object->fetch($id); + $object->fetch_optionals(); if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) From fb7ef3cefc6ca9765e0e4db5f8058ea390d6c63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Sep 2019 23:12:11 +0200 Subject: [PATCH 109/233] Update card.php --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b2438175123..1df5c06f51f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -421,6 +421,7 @@ if ($action == 'update') if ($p2min == -1) $p2min='0'; $object->fetch($id); + $object->fetch_optionals(); $object->fetch_userassigned(); $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); From 78386871f37daa2fab0c5da8acaff4e70777710f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 03:33:58 +0200 Subject: [PATCH 110/233] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2ee73a7889b..533608aa132 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2650,7 +2650,7 @@ table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.nobor } table.liste td, table.noborder td, div.noborder form div, table.tableforservicepart1 td, table.tableforservicepart2 td { padding: 7px 8px 7px 8px; /* t r b l */ - line-height: 22px; + /* line-height: 22px; This create trouble on cell login on list of last events of a contract*/ height: 22px; } div.liste_titre_bydiv .divsearchfield { From a2d3cde2915aee620e791a5472420e3a0c75cd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 07:59:46 +0200 Subject: [PATCH 111/233] some update after night --- htdocs/comm/action/card.php | 6 +++++- htdocs/comm/action/class/actioncomm.class.php | 1 - htdocs/comm/action/class/api_agendaevents.class.php | 12 +++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 1df5c06f51f..4eeb87a5b61 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -422,7 +422,9 @@ if ($action == 'update') $object->fetch($id); $object->fetch_optionals(); - $object->fetch_userassigned(); + $object->fetch_userassigned(); + $object->oldcopy = clone $object; + $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); @@ -610,6 +612,8 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { $object->fetch($id); $object->fetch_optionals(); + $object->fetch_userassigned(); + $object->oldcopy = clone $object; if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7e8bd88e5bc..12926f9b360 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -772,7 +772,6 @@ class ActionComm extends CommonObject $error=0; $this->db->begin(); - $this->oldcopy = clone $this; $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; $sql.= " WHERE id=".$this->id; diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 833f97b3b6b..53d0ad61b90 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -237,6 +237,11 @@ class AgendaEvents extends DolibarrApi } $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetch_userassigned(); + $this->actioncomm->oldcopy = clone $this->actioncomm; + } if ( ! $result ) { throw new RestException(404, 'actioncomm not found'); } @@ -269,7 +274,12 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to delete your Agenda Event"); } - $result = $this->actioncomm->fetch($id); + $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetch_userassigned(); + $this->actioncomm->oldcopy = clone $this->actioncomm; + } if(! DolibarrApiAccess::$user->rights->agenda->allactions->delete && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) { throw new RestException(401, "Insuffisant rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); From ecac1f9f404f5640ab502ff2fe43050c84d928e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 08:02:55 +0200 Subject: [PATCH 112/233] wip --- htdocs/comm/action/class/api_agendaevents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 53d0ad61b90..3f21e94f53d 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -274,7 +274,7 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to delete your Agenda Event"); } - $result = $this->actioncomm->fetch($id); + $result = $this->actioncomm->fetch($id); if ($result) { $this->actioncomm->fetch_optionals(); $this->actioncomm->fetch_userassigned(); From 0d63c43ccd239b116b9c0283ddd79ec29f911570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 08:15:01 +0200 Subject: [PATCH 113/233] add doaction to actioncommcard --- htdocs/comm/action/card.php | 49 +++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 003203940a8..31b2f22a194 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -86,6 +86,18 @@ $form = new Form($db); $formfile = new FormFile($db); $formactions = new FormActions($db); +// Load object +if ($id > 0 && $action!='add') { + $ret = $object->fetch($id); + if ($ret > 0) { + $ret = $object->fetch_optionals(); + $ret1 = $object->fetch_userassigned(); + } + if ($ret < 0 || $ret1 < 0) { + dol_print_error('', $object->error); + } +} + // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); @@ -94,6 +106,9 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('actioncard','globalcard')); +$parameters = array('socid' => $socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * Actions @@ -101,7 +116,7 @@ $hookmanager->initHooks(array('actioncard','globalcard')); $listUserAssignedUpdated = false; // Remove user to assigned list -if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') +if (empty($reshook) && (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')) { $idtoremove=GETPOST('removedassigned'); @@ -122,7 +137,7 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') } // Add user to assigned list -if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) +if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))) { // Add a new user if (GETPOST('assignedtouser') > 0) @@ -143,15 +158,15 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) } // Link to a project -if ($action == 'classin' && ($user->rights->agenda->allactions->create || +if (empty($reshook) && $action == 'classin' && ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) { - $object->fetch($id); + //$object->fetch($id); $object->setProject(GETPOST('projectid', 'int')); } // Action clone object -if ($action == 'confirm_clone' && $confirm == 'yes') +if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes') { if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) { @@ -160,7 +175,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') else { if ($id > 0) { - $object->fetch($id); + //$object->fetch($id); if (!empty($object->socpeopleassigned)) { reset($object->socpeopleassigned); $object->contactid = key($object->socpeopleassigned); @@ -178,7 +193,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') } // Add event -if ($action == 'add') +if (empty($reshook) && $action == 'add') { $error=0; @@ -403,7 +418,7 @@ if ($action == 'add') /* * Action update event */ -if ($action == 'update') +if (empty($reshook) && $action == 'update') { if (empty($cancel)) { @@ -420,8 +435,8 @@ if ($action == 'update') if ($p2hour == -1) $p2hour='0'; if ($p2min == -1) $p2min='0'; - $object->fetch($id); - $object->fetch_userassigned(); + //$object->fetch($id); + //$object->fetch_userassigned(); $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); @@ -546,9 +561,9 @@ if ($action == 'update') /* * delete event */ -if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') +if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes') { - $object->fetch($id); + //$object->fetch($id); if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) @@ -571,10 +586,10 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') * Action move update, used when user move an event in calendar by drag'n drop * TODO Move this into page comm/action/index that trigger this call by the drag and drop of event. */ -if (GETPOST('actionmove', 'alpha') == 'mupdate') +if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { - $object->fetch($id); - $object->fetch_userassigned(); + //$object->fetch($id); + //$object->fetch_userassigned(); $shour = dol_print_date($object->datep, "%H"); $smin = dol_print_date($object->datep, "%M"); @@ -614,7 +629,9 @@ if (GETPOST('actionmove', 'alpha') == 'mupdate') // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); $permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); -include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +if (empty($reshook) { + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +} /* From 155e8fb50083934adca79862db73d0de76d137b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 08:18:01 +0200 Subject: [PATCH 114/233] fix syntax --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 31b2f22a194..6418869bf1d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -629,7 +629,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); $permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); -if (empty($reshook) { +if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } From e4984492b3173a053362da42bd11f59b7d511ed4 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 17 Sep 2019 09:32:43 +0200 Subject: [PATCH 115/233] Dejarlo igual que develop --- htdocs/compta/facture/class/facture-rec.class.php | 6 +----- htdocs/compta/facture/class/facture.class.php | 1 - htdocs/install/mysql/tables/llx_facture_rec.sql | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 57ecc836acf..37a031198bc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -77,7 +77,6 @@ class FactureRec extends CommonInvoice public $total; public $db_table; public $propalid; - public $ref_client; public $date_last_gen; public $date_when; @@ -168,7 +167,6 @@ class FactureRec extends CommonInvoice $sql.= ", fk_account"; $sql.= ", fk_cond_reglement"; $sql.= ", fk_mode_reglement"; - $sql.= ", ref_client"; $sql.= ", usenewprice"; $sql.= ", frequency"; $sql.= ", unit_frequency"; @@ -197,7 +195,6 @@ class FactureRec extends CommonInvoice $sql.= ", ".(! empty($facsrc->fk_account)?"'".$facsrc->fk_account."'":"null"); $sql.= ", ".($facsrc->cond_reglement_id > 0 ? $this->db->escape($facsrc->cond_reglement_id) : "null"); $sql.= ", ".($facsrc->mode_reglement_id > 0 ? $this->db->escape($facsrc->mode_reglement_id) : "null"); - $sql.= ",'".$this->db->escape($this->ref_client)."'"; $sql.= ", ".$this->usenewprice; $sql.= ", ".$this->frequency; $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; @@ -386,7 +383,7 @@ class FactureRec extends CommonInvoice $sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.modelpdf'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project'; - $sql.= ', f.fk_account, f.ref_client'; + $sql.= ', f.fk_account'; $sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.usenewprice, f.auto_validate'; $sql.= ', f.generate_pdf'; $sql.= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; @@ -1147,7 +1144,6 @@ class FactureRec extends CommonInvoice $facture->brouillon = 1; $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; - $facture->ref_client = $facturerec->ref_client; $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 70ecf6500f5..131f0ee90fd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -372,7 +372,6 @@ class Facture extends CommonInvoice $this->socid = $_facrec->socid; // Invoice created on same thirdparty than template $this->entity = $_facrec->entity; // Invoice created in same entity than template - $this->ref_client = $_facrec->ref_client; // Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_project; diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index 2c1c2514488..1add07c6e8c 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -29,7 +29,6 @@ create table llx_facture_rec tms timestamp, -- date creation/modification suspended integer DEFAULT 0, -- 1=suspended - ref_client varchar(255), -- reference for customer amount double(24,8) DEFAULT 0 NOT NULL, remise real DEFAULT 0, From 3f25a8d8d57d38792f46ac736dd6ce75630075da Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 17 Sep 2019 09:38:08 +0200 Subject: [PATCH 116/233] New: Load invoices only if showed --- htdocs/compta/facture/card.php | 88 +++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ff5a280a118..6d0bf2f56bc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2018 Ferran Marcet + * Copyright (C) 2014-2019 Ferran Marcet * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018 Frédéric France * @@ -2862,49 +2862,6 @@ if ($action == 'create') } } - // Type de facture - $facids = $facturestatic->list_replacable_invoices($soc->id); - if ($facids < 0) { - dol_print_error($db, $facturestatic); - exit(); - } - $options = ""; - foreach ($facids as $facparam) - { - $options .= ''; - } - - // Show link for credit note - $facids=$facturestatic->list_qualified_avoir_invoices($soc->id); - if ($facids < 0) - { - dol_print_error($db, $facturestatic); - exit; - } - $optionsav = ""; - $newinvoice_static = new Facture($db); - foreach ($facids as $key => $valarray) - { - $newinvoice_static->id = $key; - $newinvoice_static->ref = $valarray ['ref']; - $newinvoice_static->statut = $valarray ['status']; - $newinvoice_static->type = $valarray ['type']; - $newinvoice_static->paye = $valarray ['paye']; - - $optionsav .= ''; - } - print '' . $langs->trans('Type') . ''; print '
' . "\n"; @@ -2981,6 +2938,23 @@ if ($action == 'create') // Replacement if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { + // Type de facture + $facids = $facturestatic->list_replacable_invoices($soc->id); + if ($facids < 0) { + dol_print_error($db, $facturestatic); + exit(); + } + $options = ""; + foreach ($facids as $facparam) + { + $options .= ''; + } + print ''; print '
'; $tmp='global->INVOICE_DISABLE_CREDIT_NOTE)) { + // Show link for credit note + $facids=$facturestatic->list_qualified_avoir_invoices($soc->id); + if ($facids < 0) + { + dol_print_error($db, $facturestatic); + exit; + } + $optionsav = ""; + $newinvoice_static = new Facture($db); + foreach ($facids as $key => $valarray) + { + $newinvoice_static->id = $key; + $newinvoice_static->ref = $valarray ['ref']; + $newinvoice_static->statut = $valarray ['status']; + $newinvoice_static->type = $valarray ['type']; + $newinvoice_static->paye = $valarray ['paye']; + + $optionsav .= ''; + } + print '
'; $tmp=' Date: Tue, 17 Sep 2019 09:43:15 +0200 Subject: [PATCH 117/233] New: Load invoices only if showed --- htdocs/fourn/facture/card.php | 87 ++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ae042b4c4b8..db5b87e590f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -10,6 +10,7 @@ * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2016-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Ferran Marcet * * 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 @@ -1765,49 +1766,6 @@ if ($action == 'create') print ''.$langs->trans('RefSupplier').''; print ''; - // Type invoice - $facids = $facturestatic->list_replacable_supplier_invoices($societe->id); - if ($facids < 0) { - dol_print_error($db, $facturestatic); - exit(); - } - $options = ""; - foreach ($facids as $facparam) - { - $options .= ''; - } - - // Show link for credit note - $facids=$facturestatic->list_qualified_avoir_supplier_invoices($societe->id); - if ($facids < 0) - { - dol_print_error($db, $facturestatic); - exit; - } - $optionsav = ""; - $newinvoice_static = new FactureFournisseur($db); - foreach ($facids as $key => $valarray) - { - $newinvoice_static->id = $key; - $newinvoice_static->ref = $valarray ['ref']; - $newinvoice_static->statut = $valarray ['status']; - $newinvoice_static->type = $valarray ['type']; - $newinvoice_static->paye = $valarray ['paye']; - - $optionsav .= ''; - } - print ''.$langs->trans('Type').''; print '
' . "\n"; @@ -1860,6 +1818,23 @@ if ($action == 'create') // Replacement if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { + // Type invoice + $facids = $facturestatic->list_replacable_supplier_invoices($societe->id); + if ($facids < 0) { + dol_print_error($db, $facturestatic); + exit(); + } + $options = ""; + foreach ($facids as $facparam) + { + $options .= ''; + } + print ''; print '
'; $tmp='global->INVOICE_DISABLE_CREDIT_NOTE)) { + // Show link for credit note + $facids=$facturestatic->list_qualified_avoir_supplier_invoices($societe->id); + if ($facids < 0) + { + dol_print_error($db, $facturestatic); + exit; + } + $optionsav = ""; + $newinvoice_static = new FactureFournisseur($db); + foreach ($facids as $key => $valarray) + { + $newinvoice_static->id = $key; + $newinvoice_static->ref = $valarray ['ref']; + $newinvoice_static->statut = $valarray ['status']; + $newinvoice_static->type = $valarray ['type']; + $newinvoice_static->paye = $valarray ['paye']; + + $optionsav .= ''; + } + print '
'; $tmp=' Date: Tue, 17 Sep 2019 10:05:35 +0200 Subject: [PATCH 118/233] FIX selectFields for GROUP BY and show only if units defined --- htdocs/core/class/html.form.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 52be1cec2b0..5c2d89cdf60 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2120,7 +2120,7 @@ class Form // Units if (! empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; - $selectFields .= ', unit_long, unit_short'; + $selectFields .= ', unit_long, unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units'; } // Multilang : we add translation @@ -2419,19 +2419,19 @@ class Form if (!empty($objp->unit_short)) { $outvalUnits .= ' - ' . $objp->unit_short; } - if (!empty($objp->weight)) { + if (!empty($objp->weight) && $objp->weight_units!==null) { $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units!==null) { $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->surface)) { + if (!empty($objp->surface) && $objp->surface_units!==null) { $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->volume)) { + if (!empty($objp->volume) && $objp->volume_units!==null) { $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); $outvalUnits .= ' - ' . $unitToShow; } @@ -2796,19 +2796,19 @@ class Form if (!empty($objp->unit_short)) { $outvalUnits .= ' - ' . $objp->unit_short; } - if (!empty($objp->weight)) { + if (!empty($objp->weight) && $objp->weight_units!==null) { $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) { + if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units!==null) { $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuring_units_string($objp->length_units, 'size'); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->surface)) { + if (!empty($objp->surface) && $objp->surface_units!==null) { $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); $outvalUnits .= ' - ' . $unitToShow; } - if (!empty($objp->volume)) { + if (!empty($objp->volume) && $objp->volume_units!==null) { $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); $outvalUnits .= ' - ' . $unitToShow; } From a44836ae406ac4feaf7fbdcf9e8b562d003e0574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 10:15:55 +0200 Subject: [PATCH 119/233] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 43ad52b5f47..864f2869b82 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -80,6 +80,18 @@ class CMailFile public $headers; public $message; + /** + * @var array fullfilenames list + */ + public $filename_list = array(); + /** + * @var array mimetypes of files list + */ + public $mimetype_list = array(); + /** + * @var array filenames list + */ + public $mimefilename_list = array(); // Image public $html; @@ -125,6 +137,9 @@ class CMailFile global $conf, $dolibarr_main_data_root; $this->sendcontext = $sendcontext; + $this->filename_list = $filename_list; + $this->mimetype_list = $mimetype_list; + $this->mimefilename_list = $mimefilename_list; if (empty($replyto)) $replyto=$from; From d3b17f4f2d4df244f0023fa3b683a122f1fb32d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 12:08:33 +0200 Subject: [PATCH 120/233] FIX form not closed. --- htdocs/projet/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c025fe91ab5..e1938fa05be 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -48,7 +48,6 @@ $sortorder = GETPOST("sortorder", 'alpha'); $max=3; - /* * View */ @@ -76,12 +75,14 @@ else $titleall=$langs->trans("AllAllowedProjects").'

'; $morehtml=''; -$morehtml.='
'; +$morehtml.=''; +$morehtml.=''; $morehtml.=''; $morehtml.=''; +$morehtml.='
'; print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'title_project.png', 0, $morehtml); From a91f39ea3e99501512dc5fb6a52dc67d4610f615 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 12:08:33 +0200 Subject: [PATCH 121/233] FIX selection of project i am contact of. --- htdocs/projet/index.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c025fe91ab5..22be3ab35db 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -48,19 +48,17 @@ $sortorder = GETPOST("sortorder", 'alpha'); $max=3; - /* * View */ $companystatic=new Societe($db); $projectstatic=new Project($db); -$userstatic=new User($db); $form=new Form($db); $formfile=new FormFile($db); $projectset = ($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projetset, 1); +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projectset, 1); //var_dump($projectsListId); llxHeader("", $langs->trans("Projects"), "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"); @@ -74,14 +72,15 @@ $titleall=$langs->trans("AllAllowedProjects"); if (! empty($user->rights->projet->all->lire) && ! $socid) $titleall=$langs->trans("AllProjects"); else $titleall=$langs->trans("AllAllowedProjects").'

'; - $morehtml=''; -$morehtml.='
'; +$morehtml.=''; +$morehtml.=''; $morehtml.=''; $morehtml.=''; +$morehtml.='
'; print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'title_project.png', 0, $morehtml); @@ -164,7 +163,6 @@ print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppst print '
'; - // Last modified projects $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.tms as datem,"; $sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas"; From 64c53e2e8556c0e2f28b645c223fb70c5235fc3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 12:19:33 +0200 Subject: [PATCH 122/233] Fix "project i am contact for" filter --- htdocs/projet/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 4c4ae4c71cf..3ca6296f81d 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -57,7 +57,7 @@ $form=new Form($db); $formfile=new FormFile($db); $projectset = ($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)); -$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projetset, 1); +$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projectset, 1); //var_dump($projectsListId); From 24cb1390e4e4327b84dcc5e58e42b153b72aa0cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 13:17:25 +0200 Subject: [PATCH 123/233] FIX Update of leave request when CSRF with token is on FIX Export of leave request show the number of open days --- htdocs/core/modules/modHoliday.class.php | 5 +++-- htdocs/exports/class/export.class.php | 9 ++++++++- htdocs/holiday/card.php | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index ba792ad28ad..61217d91686 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -202,13 +202,13 @@ class modHoliday extends DolibarrModules $this->export_permission[$r]=array(array("holiday","read_all")); $this->export_fields_array[$r]=array( 'd.rowid'=>"LeaveId",'d.fk_type'=>'TypeOfLeaveId','t.code'=>'TypeOfLeaveCode','t.label'=>'TypeOfLeaveLabel','d.fk_user'=>'UserID', - 'u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.halfday'=>'HalfDay', + 'u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.halfday'=>'HalfDay','none.num_open_days'=>'NbUseDaysCP', 'd.date_valid'=>'DateApprove','d.fk_validator'=>"UserForApprovalID",'ua.lastname'=>"UserForApprovalLastname",'ua.firstname'=>"UserForApprovalFirstname", 'ua.login'=>"UserForApprovalLogin",'d.description'=>'Description','d.statut'=>'Status' ); $this->export_TypeFields_array[$r]=array( 'd.rowid'=>"Numeric",'t.code'=>'Text', 't.label'=>'Text','d.fk_user'=>'Numeric', - 'u.lastname'=>'Text','u.firstname'=>'Text','u.login'=>"Text",'d.date_debut'=>'Date','d.date_fin'=>'Date', + 'u.lastname'=>'Text','u.firstname'=>'Text','u.login'=>"Text",'d.date_debut'=>'Date','d.date_fin'=>'Date','none.num_open_days'=>'NumericCompute', 'd.date_valid'=>'Date','d.fk_validator'=>"Numeric",'ua.lastname'=>"Text",'ua.firstname'=>"Text", 'ua.login'=>"Text",'d.description'=>'Text','d.statut'=>'Numeric' ); @@ -216,6 +216,7 @@ class modHoliday extends DolibarrModules 'u.lastname'=>'user','u.firstname'=>'user','u.login'=>'user','ua.lastname'=>'user','ua.firstname'=>'user','ua.login'=>'user' ); $this->export_alias_array[$r]=array('d.rowid'=>"idholiday"); + $this->export_special_array[$r] = array('none.num_open_days'=>'getNumOpenDays'); $this->export_dependencies_array[$r]=array(); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 51a16f717b2..f6ef6a27e2b 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -540,7 +540,7 @@ class Export public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '') { // phpcs:enable - global $conf,$langs; + global $conf,$langs,$mysoc; $indice=0; asort($array_selected); @@ -634,6 +634,13 @@ class Export $alias=str_replace(array('.', '-','(',')'), '_', $key); if ($obj->$alias < 0) $obj->$alias='0'; } + // Operation GETNUMOPENDAYS (for Holiday module) + elseif ($this->array_export_special[$indice][$key]=='getNumOpenDays') + { + //$alias=$this->array_export_alias[$indice][$key]; + $alias=str_replace(array('.', '-','(',')'), '_', $key); + $obj->$alias=num_open_day(dol_stringtotime($obj->d_date_debut, 1), dol_stringtotime($obj->d_date_fin, 1), 0, 1, $obj->d_halfday, $mysoc->country_code); + } // Operation INVOICEREMAINTOPAY elseif ($this->array_export_special[$indice][$key]=='getRemainToPay') { diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 204d832a94c..1f597f2ddc2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1134,6 +1134,7 @@ else if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) $edit = true; print '
'."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; } From 214bf4375eb9cfafa32723131e597ff01643e0ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 13:28:36 +0200 Subject: [PATCH 124/233] Fix missing include --- htdocs/exports/class/export.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index f6ef6a27e2b..da184f27574 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -637,6 +637,7 @@ class Export // Operation GETNUMOPENDAYS (for Holiday module) elseif ($this->array_export_special[$indice][$key]=='getNumOpenDays') { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; //$alias=$this->array_export_alias[$indice][$key]; $alias=str_replace(array('.', '-','(',')'), '_', $key); $obj->$alias=num_open_day(dol_stringtotime($obj->d_date_debut, 1), dol_stringtotime($obj->d_date_fin, 1), 0, 1, $obj->d_halfday, $mysoc->country_code); From 5e7b7bbc33c846f36768bb3dc8688d4b76879945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 13:31:45 +0200 Subject: [PATCH 125/233] Update eldy.lib.php --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2eead6da81d..e7764be3ceb 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; */ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '') { - global $user,$conf,$langs,$dolibarr_main_db_name; + global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]); $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]); From ea5ff59076935967ae95b80057c16d9523a420b0 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 17 Sep 2019 16:43:36 +0200 Subject: [PATCH 126/233] FIX check if a resource is in use after a drag and drop from events --- htdocs/comm/action/card.php | 76 +++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 173770d725c..3ef20a71a9c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -632,6 +632,8 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') */ if (GETPOST('actionmove', 'alpha') == 'mupdate') { + $error = 0; + $object->fetch($id); $object->fetch_userassigned(); @@ -653,10 +655,76 @@ if (GETPOST('actionmove', 'alpha') == 'mupdate') $object->datef+=$datep-$object->datep; } $object->datep=$datep; - $result=$object->update($user); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); + + if (!$error) { + // check if an event resource is already in use + if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE ac.id != " . $object->id; + $sql .= " AND er.resource_id IN ("; + $sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources"; + $sql .= " WHERE element_id = " . $object->id; + $sql .= " AND element_type = '" . $db->escape($object->element) . "'"; + $sql .= " AND busy = 1"; + $sql .= ")"; + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + } + $db->free($resql); + } + + if ($error) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } + + if (!$error) { + $db->begin(); + $result = $object->update($user); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + $db->rollback(); + } else { + $db->commit(); + } } } if (! empty($backtopage)) From 49b75e3f52d0c7393d3b4f3e257a0048f1ab56c9 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Tue, 17 Sep 2019 17:40:42 +0200 Subject: [PATCH 127/233] support referent in the beluga export. The beluga export of a project, now supports additional referents, coming from the hooks. When the element is present in the view of all elements of the project, the beluga export will also export this element. [see: X] --- .../project/doc/pdf_beluga.modules.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 32a2d10f72d..f7314476023 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -361,6 +361,11 @@ class pdf_beluga extends ModelePDFProjects 'lang'=>'agenda') ); + $hookmanager->initHooks(array('completeListOfReferent')); + $hookmanager->executeHooks('completeListOfReferent', ['listofreferent'=>$listofreferent], $object, $action); + if(!empty($hookmanager->resArray)) { + $listofreferent = array_merge($listofreferent, $hookmanager->resArray); + } foreach ($listofreferent as $key => $value) { @@ -370,17 +375,13 @@ class pdf_beluga extends ModelePDFProjects $datefieldname=$value['datefieldname']; $qualified=$value['test']; $langstoload=$value['lang']; + $projectField=isset($value['project_field']) ? $value['project_field'] : 'fk_projet'; $langs->load($langstoload); if (! $qualified) continue; //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); - - if ($key == 'agenda') - { -// var_dump($elementarray); - } + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, $projectField); $num = count($elementarray); if ($num >= 0) @@ -394,7 +395,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); - $selectList = $formproject->select_element($tablename, $project->thirdparty->id); + $selectList = $formproject->select_element($tablename, $project->thirdparty->id, '', -2, $projectField); $nexY = $pdf->GetY() + 1; $curY = $nexY; $pdf->SetXY($this->posxref, $curY); @@ -569,9 +570,9 @@ class pdf_beluga extends ModelePDFProjects // Amount without tax if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ''), 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ''), 1, 'R'); } else { $pdf->SetXY($this->posxamountht, $curY); if ($key == 'agenda') @@ -608,9 +609,9 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L'); $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ''), 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ' '), 1, 'R'); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ''), 1, 'R'); $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L'); } From 3f6afa810c7b7dc2cede1cb867dc9e47637fa315 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 17:55:30 +0200 Subject: [PATCH 128/233] Code comment --- htdocs/core/lib/date.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 6ed17305096..ea5027de1ee 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -323,6 +323,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date) * 0 =Input date is local date using PHP server timezone * @return int Date as a timestamp * 19700101020000 -> 7200 with gm=1 + * 19700101000000 -> 0 with gm=1 * * @see dol_print_date(), dol_mktime(), dol_getdate() */ From a43253eab844c8caecc148c23b4dd5025e5ee1a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Sep 2019 18:49:56 +0200 Subject: [PATCH 129/233] Fix for deposit not correctly closed --- htdocs/compta/facture/card.php | 2 +- htdocs/install/mysql/migration/repair.sql | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ff5a280a118..6b24807c007 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4982,7 +4982,7 @@ elseif ($id > 0 || ! empty($ref)) } // Classify paid - if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)) + if (($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))) || ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id)) ) { diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 51fe48dcda2..4d87203b068 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -468,6 +468,12 @@ UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS -- UPDATE llx_facturedet_rec set label = NULL WHERE label IS NOT NULL; +-- Note to make all deposit as payed when there is already a discount generated from it. +--drop table tmp_invoice_deposit_mark_as_available; +--create table tmp_invoice_deposit_mark_as_available as select * from llx_facture as f where f.type = 3 and f.paye = 0 and f.rowid in (select fk_facture_source from llx_societe_remise_except); +--update llx_facture set paye = 1 where rowid in (select rowid from tmp_invoice_deposit_mark_as_available); + + -- Note to migrate from old counter aquarium to new one -- drop table tmp; From 87d41256d456a3c68b6822458ce15bf1ee17e905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 22:59:23 +0200 Subject: [PATCH 130/233] Update box_contacts.php --- htdocs/core/boxes/box_contacts.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 667f892bc0a..fb5cf2db7fb 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -83,8 +83,8 @@ class box_contacts extends ModeleBoxes if ($user->rights->societe->lire && $user->rights->societe->contact->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; - $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile"; - $sql.= ", s.nom as socname, s.name_alias"; + $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail"; + $sql.= ", s.nom as socname, s.name_alias, s.email as semail"; $sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; @@ -117,12 +117,14 @@ class box_contacts extends ModeleBoxes $contactstatic->phone_pro = $objp->phone; $contactstatic->phone_perso = $objp->phone_perso; $contactstatic->phone_mobile = $objp->phone_mobile; + $contactstatic->email = $objp->spemail; $contactstatic->address = $objp->address; $contactstatic->zip = $objp->zip; $contactstatic->town = $objp->town; $societestatic->id = $objp->fk_soc; $societestatic->name = $objp->socname; + $societestatic->email = $objp->semail; $societestatic->name_alias = $objp->name_alias; $societestatic->code_client = $objp->code_client; $societestatic->code_fournisseur = $objp->code_fournisseur; From c38c0bec1c0932b976d060084371301e4c5d6851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 23:03:37 +0200 Subject: [PATCH 131/233] Update box_fournisseurs.php --- htdocs/core/boxes/box_fournisseurs.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 8d231cc472b..b80f9c27975 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic 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 @@ -85,7 +85,7 @@ class box_fournisseurs extends ModeleBoxes if ($user->rights->societe->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,"; - $sql.= " s.code_fournisseur,"; + $sql.= " s.code_fournisseur, s.email as semail,"; $sql.= " s.logo"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -109,6 +109,7 @@ class box_fournisseurs extends ModeleBoxes $datem=$db->jdate($objp->tms); $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; + $thirdpartytmp->email = $objp->email; $thirdpartytmp->code_client = $objp->code_client; $thirdpartytmp->logo = $objp->logo; From c01ab451cc21c4c90c4bfdc8579dbedc973fb307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 23:04:43 +0200 Subject: [PATCH 132/233] Update box_fournisseurs.php --- htdocs/core/boxes/box_fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index b80f9c27975..a90336753da 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -109,7 +109,7 @@ class box_fournisseurs extends ModeleBoxes $datem=$db->jdate($objp->tms); $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; - $thirdpartytmp->email = $objp->email; + $thirdpartytmp->email = $objp->semail; $thirdpartytmp->code_client = $objp->code_client; $thirdpartytmp->logo = $objp->logo; From ca18448b48f6a041ed13762ac56233a095c5c6c7 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 18 Sep 2019 10:36:13 +0200 Subject: [PATCH 133/233] NEW add units fields in buying price tab of product card --- htdocs/product/fournisseurs.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index cb56ff63cfc..d8cfcae0bb7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -491,6 +491,13 @@ if ($id > 0 || $ref) { print ''; } + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $unit = $object->getLabelOfUnit(); + if ($unit !== '') { + print '  ' . $langs->trans($unit); + } + } print ''; // Vat rate @@ -778,11 +785,11 @@ SCRIPT; $num = count($product_fourn_list); if (($num + ($offset * $limit)) < $nbtotalofrecords) $num++; - print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER ['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); + print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); // Suppliers list title print '
'; - print ''; + print '
'; $param="&id=".$object->id; @@ -851,6 +858,13 @@ SCRIPT; // Quantity print ''; // VAT rate From 7455d772a2cda7032e0201be030b96f4382f2d25 Mon Sep 17 00:00:00 2001 From: com4WEB <42214196+com4WEB@users.noreply.github.com> Date: Wed, 18 Sep 2019 10:50:07 +0200 Subject: [PATCH 134/233] Update README.md --- README.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8100cabddbe..0ae6d1b9de5 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING +- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). @@ -90,18 +91,19 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Main application/modules (all optional) -- Customers, Prospects and/or Suppliers directory +- Customers, Prospects (Leads) and/or Suppliers directory - Products and/or Services catalog - Commercial proposals management - Customer and Supplier Orders management - Invoices and payment management - Standing orders management (European SEPA) - Bank accounts management +- Accounting management - Shared calendar/agenda (with ical and vcal export for third party tools integration) - Opportunities and/or project management - Projects management - Contracts management -- Stock management +- Warehouse/Stock management - Shipping management - Interventions management - Employee's leave requests management @@ -111,7 +113,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Foundations members management - Mass emailing - Surveys -- Point of Sale +- Point of Sale (POS) - … ### Other application/modules @@ -131,15 +133,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Other general features -- Localization in most major languages. -- Multi-Users and groups with finely grained rights. -- Multi-currency. -- Multi-company by adding of an external module. -- Very user friendly and easy to use. +- Localization in most major languages +- Multi-Users and groups with finely grained rights +- Multi-currency +- Multi-company by adding of an external module +- Very user friendly and easy to use +- customizable Dashboard - Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) -- Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) -- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. -- APIs. + +- APIs - An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture) - Support a lot of country specific features: - Spanish Tax RE and ISPF @@ -153,6 +155,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - PDF or ODT generation for invoice, proposals, orders... - … +### System Environment / Requirements + +- Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) +- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. + + ### Extending Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com). From cf7193691f4d853ca45b4d95efe1b1f157a8a0ee Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 18 Sep 2019 11:22:32 +0200 Subject: [PATCH 135/233] FIX dol_print_date format in buying price tooltip --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 6847af5edf1..e18e02d4930 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -998,7 +998,7 @@ class ProductFournisseur extends Product //$out .= ''; $out .= ''; foreach ($productFournLogList as $productFournLog) { - $out.= ''; + $out.= ''; $out.= ''; //$out.= ''; $out.= ''; From 2da50716421b46fdeaa9a9b300d7754ab05a59bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Sep 2019 13:12:22 +0200 Subject: [PATCH 136/233] Fix VAT in New caledonia is now called TGC --- htdocs/langs/fr_NC/admin.lang | 6 ++--- htdocs/langs/fr_NC/companies.lang | 4 ++-- htdocs/langs/fr_NC/compta.lang | 40 +++++++++++++++---------------- htdocs/langs/fr_NC/main.lang | 8 +++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/langs/fr_NC/admin.lang b/htdocs/langs/fr_NC/admin.lang index d86b324fdc5..f7c25610e3f 100644 --- a/htdocs/langs/fr_NC/admin.lang +++ b/htdocs/langs/fr_NC/admin.lang @@ -1,4 +1,4 @@ # Dolibarr language file - Source file is en_US - admin -VATManagement=Gestion TSS -VATIsUsedDesc=Le taux de TSS proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :
Si vendeur non assujetti à TSS, TSS par défaut=0. Fin de règle.
Si le (pays vendeur= pays acheteur) alors TSS par défaut=TSS du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TSS par défaut=0 (La TSS doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TSS par défaut=TSS du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TSS par défaut=0. Fin de règle.
Sinon TSS proposée par défaut=0. Fin de règle.
-VATIsNotUsedDesc=Le taux de TSS proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. +VATManagement=Gestion TGC +VATIsUsedDesc=Le taux de TGC proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :
Si vendeur non assujetti à TGC, TGC par défaut=0. Fin de règle.
Si le (pays vendeur= pays acheteur) alors TGC par défaut=TGC du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TGC par défaut=0 (La TGC doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TGC par défaut=TGC du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TGC par défaut=0. Fin de règle.
Sinon TGC proposée par défaut=0. Fin de règle.
+VATIsNotUsedDesc=Le taux de TGC proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. diff --git a/htdocs/langs/fr_NC/companies.lang b/htdocs/langs/fr_NC/companies.lang index 9853f7e7e21..c3520226e42 100644 --- a/htdocs/langs/fr_NC/companies.lang +++ b/htdocs/langs/fr_NC/companies.lang @@ -1,3 +1,3 @@ # Dolibarr language file - Source file is en_US - companies -VATIsUsed=Assujetti à la TSS -VATIsNotUsed=Non assujetti à la TSS +VATIsUsed=Assujetti à la TGC +VATIsNotUsed=Non assujetti à la TGC diff --git a/htdocs/langs/fr_NC/compta.lang b/htdocs/langs/fr_NC/compta.lang index f22e834c4a5..2d7a5468f84 100644 --- a/htdocs/langs/fr_NC/compta.lang +++ b/htdocs/langs/fr_NC/compta.lang @@ -1,21 +1,21 @@ # Dolibarr language file - Source file is en_US - compta -VATToPay=TSS ventes -VATReceived=TSS collectée -VATToCollect=TSS achats -VATSummary=Balance de TSS -VATPaid=TSS payée -VATCollected=TSS récupérée -PaymentVat=Règlement TSS -VATPayment=Règlement TSS -VATPayments=Règlements TSS -ShowVatPayment=Affiche paiement TSS -RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TSS.
- Il se base sur la date de règlement de ces factures, charges et TSS. -VATReportByCustomersInInputOutputMode=Rapport par client des TSS collectées et payées (TSS sur encaissement) -VATReportByQuartersInInputOutputMode=Rapport par taux des TSS collectées et payées (TSS sur encaissement) -SeeVATReportInInputOutputMode=Voir le rapport %sTSS encaissement%s pour mode de calcul standard -SeeVATReportInDueDebtMode=Voir le rapport %sTSS sur débit%s pour mode de calcul avec option sur les débits -RulesVATInServices=- Pour les services, le rapport inclut les TSS des règlements effectivement reçus ou émis en se basant sur la date du règlement. -RulesVATInProducts=- Pour les biens matériels, il inclut les TSS des factures en se basant sur la date de facture. -RulesVATDueServices=- Pour les services, le rapport inclut les TSS des factures dues, payées ou non en se basant sur la date de facture. -RulesVATDueProducts=- Pour les biens matériels, il inclut les TSS des factures en se basant sur la date de facture. -CalculationRuleDesc=Pour calculer le total de TSS, il existe 2 modes:
Le mode 1 consiste à arrondir la TSS de chaque ligne et à sommer cet arrondi.
Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.
Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode %s. +VATToPay=TGC ventes +VATReceived=TGC collectée +VATToCollect=TGC achats +VATSummary=Balance de TGC +VATPaid=TGC payée +VATCollected=TGC récupérée +PaymentVat=Règlement TGC +VATPayment=Règlement TGC +VATPayments=Règlements TGC +ShowVatPayment=Affiche paiement TGC +RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TGC.
- Il se base sur la date de règlement de ces factures, charges et TGC. +VATReportByCustomersInInputOutputMode=Rapport par client des TGC collectées et payées (TGC sur encaissement) +VATReportByQuartersInInputOutputMode=Rapport par taux des TGC collectées et payées (TGC sur encaissement) +SeeVATReportInInputOutputMode=Voir le rapport %sTGC encaissement%s pour mode de calcul standard +SeeVATReportInDueDebtMode=Voir le rapport %sTGC sur débit%s pour mode de calcul avec option sur les débits +RulesVATInServices=- Pour les services, le rapport inclut les TGC des règlements effectivement reçus ou émis en se basant sur la date du règlement. +RulesVATInProducts=- Pour les biens matériels, il inclut les TGC des factures en se basant sur la date de facture. +RulesVATDueServices=- Pour les services, le rapport inclut les TGC des factures dues, payées ou non en se basant sur la date de facture. +RulesVATDueProducts=- Pour les biens matériels, il inclut les TGC des factures en se basant sur la date de facture. +CalculationRuleDesc=Pour calculer le total de TGC, il existe 2 modes:
Le mode 1 consiste à arrondir la TGC de chaque ligne et à sommer cet arrondi.
Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.
Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode %s. diff --git a/htdocs/langs/fr_NC/main.lang b/htdocs/langs/fr_NC/main.lang index 82c7a4ee746..23b739d83e5 100644 --- a/htdocs/langs/fr_NC/main.lang +++ b/htdocs/langs/fr_NC/main.lang @@ -20,7 +20,7 @@ FormatDateHourSecShort=%d/%m/%Y %H:%M:%S FormatDateHourTextShort=%d %b %Y %H:%M FormatDateHourText=%d %B %Y %H:%M ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux de taxe défini pour le pays '%s'. -AmountVAT=Montant TSS -TotalVAT=Total TSS -VAT=TSS -VATRate=Taux TSS +AmountVAT=Montant TGC +TotalVAT=Total TGC +VAT=TGC +VATRate=Taux TGC From 7b512587aadc3eca9e3565eed17f46c36498c643 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Sep 2019 14:15:20 +0200 Subject: [PATCH 137/233] FIX XSS --- htdocs/admin/mails_templates.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index e0dfcd75277..573d4c5fbaa 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -50,7 +50,7 @@ $confirm = GETPOST('confirm','alpha'); // Result of a confirmation $id = GETPOST('id','int'); $rowid = GETPOST('rowid','alpha'); -$search_label=GETPOST('search_label','alpha'); +$search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)' $search_type_template=GETPOST('search_type_template','alpha'); $search_lang=GETPOST('search_lang','alpha'); $search_fk_user=GETPOST('search_fk_user','intcomma'); @@ -262,6 +262,7 @@ if (empty($reshook)) { //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); $keycode=$listfieldvalue[$i]; + if ($value == 'label') $_POST[$keycode] = dol_escape_htmltag($_POST[$keycode]); if ($value == 'lang') $keycode='langcode'; if ($value == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; @@ -666,8 +667,6 @@ if ($resql) print '
'; foreach ($fieldlist as $field => $value) { - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees $showfield=1; // By defaut $align="left"; $sortable=1; @@ -694,7 +693,7 @@ if ($resql) if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;} if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; } - // Affiche nom du champ + // Show fields if ($showfield) { if (! empty($tabhelp[$id][$value])) @@ -812,6 +811,10 @@ if ($resql) $showfield=1; $align="left"; $valuetoshow=$obj->{$fieldlist[$field]}; + if ($value == 'label' || $value == 'topic') + { + $valuetoshow = dol_escape_htmltag($valuetoshow); + } if ($value == 'type_template') { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; From 345ac28c8999d53ed541fb14cd08f4692e21aec6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Aug 2019 16:22:24 +0200 Subject: [PATCH 138/233] Fix js injection Conflicts: htdocs/core/lib/functions.lib.php htdocs/user/group/card.php --- htdocs/core/lib/functions.lib.php | 8 ++++++-- htdocs/main.inc.php | 16 +++++++++------- htdocs/user/group/card.php | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20930ca52c4..bf79b2070d5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -966,11 +966,15 @@ function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0) * @param string $stringtoescape String to escape * @param int $keepb 1=Preserve b tags (otherwise, remove them) * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). Set to 1 when escaping for a '."\n"; - print ''."\n"; - print ''."\n"; // Country - print ''."\n"; - print ''."\n"; - print ''; print ''."\n"; - print ''; print ''."\n"; - print ''; print ''."\n"; // Web - print ''; print ''."\n"; // Code - print ''."\n"; // Note - print ''; print ''; @@ -189,24 +189,24 @@ else print '
'; print '
'; print $productfourn->fourn_qty; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $unit = $object->getLabelOfUnit(); + if ($unit !== '') { + print '  ' . $langs->trans($unit); + } + } print ''.$langs->trans("QtyMin").''.$langs->trans("User").'
'.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').'
'.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').''.price($productFournLog['price']).''.$productFournLog['quantity'].''.$productFournLog['lastname'].'
'; + print '
'; print '
'; + print '
'; print '
'; + print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; + print '
'; $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); print '
'; + print '
'; print '
'; + print '
'; print '
'; + print '
'; print '
'; + print '
'; print '
'; + print '
'; print '
'; + print '
'; print '
'; - print ''; + print ''; - print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; + print '
'.$langs->trans("CompanyName").''; print $conf->global->MAIN_INFO_ACCOUNTANT_NAME; print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '
'.$langs->trans("CompanyCountry").''; + print '
'.$langs->trans("CompanyCountry").''; if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY)) { $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); @@ -217,23 +217,23 @@ else print '
'.$langs->trans("Region-State").''; - else print '
'.$langs->trans("State").''; + if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '
'.$langs->trans("Region-State").''; + else print '
'.$langs->trans("State").''; if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); else print ' '; print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '
'.$langs->trans("AccountantFileNumber").'' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '
'.$langs->trans("AccountantFileNumber").'' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '
'; print "
"; From b30c55a2ee610bbe0176000b49ce9d10a06e6d1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Sep 2019 23:40:38 +0200 Subject: [PATCH 152/233] CSS --- htdocs/theme/eldy/global.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 17532380337..334fbe00ba1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -655,6 +655,14 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } +.divintdwithtwolinesmax { + width: 75px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + .tablelistofcalendars { margin-top: 25px !important; } From 278312f38f3bbdb528e6741efb946dd0e0678643 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 07:02:14 +0200 Subject: [PATCH 153/233] Translate --- htdocs/adherents/card.php | 8 ++++---- htdocs/adherents/subscription.php | 4 ++-- htdocs/admin/bank.php | 2 +- htdocs/admin/chequereceipts.php | 3 +-- htdocs/admin/delais.php | 2 +- htdocs/admin/dict.php | 14 ++++++------- htdocs/admin/emailcollector_card.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/expensereport.php | 2 +- htdocs/core/modules/action/rapport.pdf.php | 2 +- .../core/modules/bank/doc/pdf_ban.modules.php | 2 +- .../bank/doc/pdf_sepamandate.modules.php | 2 +- .../modules/cheque/doc/pdf_blochet.class.php | 6 +++--- .../commande/doc/pdf_einstein.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 2 +- .../contract/doc/pdf_strato.modules.php | 4 ++-- .../modules/dons/html_cerfafr.modules.php | 2 +- .../doc/doc_generic_shipment_odt.modules.php | 2 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../expedition/doc/pdf_merou.modules.php | 2 +- .../expedition/doc/pdf_rouget.modules.php | 2 +- .../doc/pdf_standard.modules.php | 4 ++-- .../modules/facture/doc/pdf_crabe.modules.php | 20 +++++++++---------- .../fichinter/doc/pdf_soleil.modules.php | 4 ++-- .../modules/member/doc/pdf_standard.class.php | 2 +- .../doc/pdf_standardlabel.class.php | 2 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 2 +- .../product/doc/pdf_standard.modules.php | 6 +++--- .../doc/doc_generic_project_odt.modules.php | 2 +- .../project/doc/pdf_baleine.modules.php | 2 +- .../project/doc/pdf_beluga.modules.php | 2 +- .../project/doc/pdf_timespent.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../societe/doc/doc_generic_odt.modules.php | 2 +- .../stock/doc/pdf_standard.modules.php | 6 +++--- .../stock/doc/pdf_stdmovement.modules.php | 6 +++--- .../doc/pdf_aurore.modules.php | 4 ++-- htdocs/core/tpl/card_presend.tpl.php | 2 +- htdocs/public/members/new.php | 2 +- htdocs/public/payment/paymentok.php | 2 +- 40 files changed, 72 insertions(+), 73 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5836bf48332..badf93b4e80 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -638,7 +638,7 @@ 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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -719,7 +719,7 @@ 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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -1483,7 +1483,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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; @@ -1544,7 +1544,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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0922ca4f572..49e1cbbc553 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -360,7 +360,7 @@ 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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template @@ -1093,7 +1093,7 @@ 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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 44cdd5e611b..a40448acdc8 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -49,7 +49,7 @@ $type = 'bankaccount'; * Actions */ -//Order display of bank account +// Order display of bank account if ($action == 'setbankorder') { if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) { diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index efc192e6de1..7e136bf6978 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -91,7 +91,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') } /* - * view + * View */ $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -233,7 +233,6 @@ print '
'; /* * Other options - * */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 1fe8b2285c3..6d6ebe13333 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -222,7 +222,7 @@ if ($action == 'edit') else { /* - * Affichage des parametres + * Show parameters */ print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ff4c3cc6a6b..28dd36b5442 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -251,7 +251,7 @@ $tabsqlsort[35]="c.label ASC"; $tabsqlsort[36]="r.fk_c_exp_tax_cat ASC, r.range_ik ASC"; $tabsqlsort[37]="r.unit_type ASC, r.scale ASC, r.code ASC"; -// Nom des champs en resultat de select pour affichage du dictionnaire +// Field names in select result for dictionary display $tabfield=array(); $tabfield[1] = "code,libelle,country"; $tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country" @@ -291,7 +291,7 @@ $tabfield[35]= "label"; $tabfield[36]= "range_ik,fk_c_exp_tax_cat"; $tabfield[37]= "code,label,short_label,unit_type,scale"; -// Nom des champs d'edition pour modification d'un enregistrement +// Edit field names for editing a record $tabfieldvalue=array(); $tabfieldvalue[1] = "code,libelle,country"; $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region" @@ -331,7 +331,7 @@ $tabfieldvalue[35]= "label"; $tabfieldvalue[36]= "range_ik,fk_c_exp_tax_cat"; $tabfieldvalue[37]= "code,label,short_label,unit_type,scale"; -// Nom des champs dans la table pour insertion d'un enregistrement +// Field names in the table for inserting a record $tabfieldinsert=array(); $tabfieldinsert[1] = "code,libelle,fk_pays"; $tabfieldinsert[2] = "code_departement,nom,fk_region"; @@ -1283,8 +1283,8 @@ if ($id) { if ($fieldlist[$field] == 'entity') continue; - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees + // Determines the name of the field in relation to the possible names + // in data dictionaries $showfield=1; // By defaut $align="left"; $cssprefix=''; @@ -1850,14 +1850,14 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print ''; } - // Le type de l'element (pour les type de contact) + // The type of the element (for contact types) elseif ($fieldlist[$field] == 'element') { print ''; } - // La source de l'element (pour les type de contact) + // The source of the element (for contact types) elseif ($fieldlist[$field] == 'source') { print ''."\n"; -//Use draft Watermark +// Use draft Watermark print ''."\n"; print ''."\n"; - // Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position + // For each possible position, an activation link is displayed if the box is not already active for that position print '
'; print $form->selectarray('element', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 6d1b640f45b..011f04b0882 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -36,7 +36,7 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; if (!$user->admin) accessforbidden(); if (empty($conf->emailcollector->enabled)) accessforbidden(); -// Load traductions files requiredby by page +// Load traductions files required by page $langs->loadLangs(array("admin", "mails", "other")); // Get parameters diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 14cb63cd923..a55f6ee962e 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -34,7 +34,7 @@ dol_include_once('/emailcollector/class/emailcollector.class.php'); if (!$user->admin) accessforbidden(); if (empty($conf->emailcollector->enabled)) accessforbidden(); -// Load traductions files requiredby by page +// Load traductions files required by page $langs->loadLangs(array("admin", "other")); $action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index da77c0e78d3..d0ba9c63a3c 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -496,7 +496,7 @@ else } print '
'; print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 52b70caf47f..b63b2785e44 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -117,7 +117,7 @@ class CommActionRapport // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products")); $dir = $conf->agenda->dir_temp."/"; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 23fef1ef2c5..eeee238ac80 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -106,7 +106,7 @@ class pdf_ban 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->bank->dir_output) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index e3990bc8ccc..e94af011b1e 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -109,7 +109,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "withdrawals", "companies", "projects", "bills")); if (! empty($conf->bank->dir_output)) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 71866464084..09148746fe9 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -49,7 +49,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "bills")); $this->db = $db; @@ -98,7 +98,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $sav_charset_output=$outputlangs->charset_output; if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "companies", "bills", "products", "compta")); $dir = $_dir . "/".get_exdir($number, 0, 1, 0, $object, 'cheque').$number; @@ -225,7 +225,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("compta", "banks")); $title = $outputlangs->transnoentities("CheckReceipt"); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f74291ecac9..4a81f94ed29 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1236,7 +1236,7 @@ class pdf_einstein extends ModelePDFCommandes // phpcs:enable global $conf,$langs,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required 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 124d51a33ad..7cff0c19e6b 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 @@ -217,7 +217,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 + // Load traductions files required 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 b04ce5890ab..f7ae9834a65 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -181,7 +181,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "contracts")); if ($conf->contrat->dir_output) @@ -602,7 +602,7 @@ class pdf_strato extends ModelePDFContract $default_font_size = pdf_getPDFFontSize($outputlangs); - // Load traductions files requiredby by page + // Load traductions files required 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 6ef76d21b78..f871cd3e2b0 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -83,7 +83,7 @@ class html_cerfafr extends ModeleDon if (! is_object($outputlangs)) $outputlangs=$langs; - // Load traductions files requiredby by page + // Load traductions files required 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 9f94dd86867..52c810fd965 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,7 +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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); if ($conf->expedition->dir_output."/sending") diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 996e8035316..8f3441c332c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -165,7 +165,7 @@ class pdf_espadon 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); $nblines = count($object->lines); diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 4293f29ed6d..dbdfd722168 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'; - // Load traductions files requiredby by page + // Load traductions files required 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 18ba0ef9d44..d3e254c6132 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -195,7 +195,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); $nblines = 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 fb977c19b63..5cfc6c3287e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -217,7 +217,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "trips", "projects", "dict", "bills", "banks")); $nblines = count($object->lines); @@ -635,7 +635,7 @@ class pdf_standard extends ModeleExpenseReport // global $conf, $langs, $hookmanager; global $user, $langs, $conf, $mysoc, $db, $hookmanager; - // Load traductions files requiredby by page + // Load traductions files required 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 8876137f877..7ec496d385b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -243,7 +243,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); $nblines = count($object->lines); @@ -1351,7 +1351,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); - + // Retained warranty if( !empty($object->situation_final) && ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) ) ) ) { @@ -1367,29 +1367,29 @@ class pdf_crabe extends ModelePDFFactures } } } - + if($displayWarranty){ $pdf->SetTextColor(40, 40, 40); $pdf->SetFillColor(255, 255, 255); - + $retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty ; - + // Billed - retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); - + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); - + // retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - + $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty") . ' ('.$object->retained_warranty.'%)'; $retainedWarrantyToPayOn.= !empty($object->retained_warranty_date_limit)?' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')):''; - + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); @@ -1591,7 +1591,7 @@ class pdf_crabe extends ModelePDFFactures { global $conf, $langs; - // Load traductions files requiredby by page + // Load traductions files required 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 847f1de7087..9d39eb5e858 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -173,7 +173,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "interventions", "dict", "companies")); if ($conf->ficheinter->dir_output) @@ -562,7 +562,7 @@ class pdf_soleil extends ModelePDFFicheinter global $conf,$langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "interventions")); pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index f3a105f99f1..13c28514211 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -329,7 +329,7 @@ class pdf_standard extends CommonStickerGenerator // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin", "members")); if (empty($mode) || $mode == 'member') diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index e178d16d5bc..f72ca14cc25 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -260,7 +260,7 @@ class pdf_standardlabel extends CommonStickerGenerator // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin")); $title=$outputlangs->transnoentities('Labels'); diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index f6bb3bc46a7..a2705adcb7d 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -301,7 +301,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin")); $title=$outputlangs->transnoentities('Labels'); diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 019d67518a4..88ec5204845 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -119,7 +119,7 @@ class pdf_standard extends ModelePDFProduct { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "companies")); $this->db = $db; @@ -169,7 +169,7 @@ class pdf_standard extends ModelePDFProduct // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); $nblines = count($object->lines); @@ -709,7 +709,7 @@ class pdf_standard extends ModelePDFProduct { global $conf,$langs,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index e682cfd9507..6d67a36c010 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -82,7 +82,7 @@ class doc_generic_project_odt extends ModelePDFProjects { global $conf, $langs, $mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("companies", "main")); $this->db = $db; diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 154c8e067b0..bc2019bfce8 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -183,7 +183,7 @@ class pdf_baleine extends ModelePDFProjects // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 05100fbe8eb..ba815810f28 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -155,7 +155,7 @@ class pdf_beluga extends ModelePDFProjects // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 061ae7a0b58..7685c07b480 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -115,7 +115,7 @@ class pdf_timespent extends ModelePDFProjects // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); if ($conf->projet->dir_output) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 77c41d01927..59267e25272 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -224,7 +224,7 @@ class pdf_azur extends ModelePDFPropales // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "propal", "products")); $nblines = count($object->lines); @@ -1438,7 +1438,7 @@ class pdf_azur extends ModelePDFPropales { global $conf,$langs; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index a6738ddcc90..f8bbf568d86 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -94,7 +94,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc { global $conf,$langs; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("companies", "errors")); $form = new Form($this->db); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index e0c831732ba..61bfa916fe2 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -119,7 +119,7 @@ class pdf_standard extends ModelePDFStock { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "companies")); $this->db = $db; @@ -198,7 +198,7 @@ class pdf_standard extends ModelePDFStock // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries")); $nblines = count($object->lines); @@ -875,7 +875,7 @@ class pdf_standard extends ModelePDFStock { global $conf,$langs,$db,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders", "stocks")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 380b9ceffa5..6a607de6d37 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -119,7 +119,7 @@ class pdf_stdmovement extends ModelePDFMovement { global $conf,$langs,$mysoc; - // Load traductions files requiredby by page + // Load traductions files required by page $langs->loadLangs(array("main", "companies")); $this->db = $db; @@ -200,7 +200,7 @@ class pdf_stdmovement extends ModelePDFMovement // 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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries")); /** @@ -954,7 +954,7 @@ class pdf_stdmovement extends ModelePDFMovement { global $conf,$langs,$db,$hookmanager; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders", "stocks")); $default_font_size = pdf_getPDFFontSize($outputlangs); 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 d243c209848..44fe533f0eb 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -215,7 +215,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'; - // Load traductions files requiredby by page + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal")); $nblines = count($object->lines); @@ -1278,7 +1278,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { global $conf, $langs; - // Load traductions files requiredby by page + // Load traductions files required 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 a8594ec1b62..06b2a8414c0 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -76,7 +76,7 @@ if ($action == 'presend') { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($newlang); - // Load traductions files requiredby by page + // Load traductions files required 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 873a6858a1a..81f46897cc6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -281,7 +281,7 @@ 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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 52413921f90..6c9711e4055 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -516,7 +516,7 @@ 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 + // Load traductions files required by page $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage=null; From bf6fd2a5e2f904aaade31cb6293885835ce0885c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 09:25:46 +0200 Subject: [PATCH 154/233] Translate & style --- htdocs/admin/agenda_reminder.php | 4 ++-- htdocs/admin/boxes.php | 14 ++++++++------ htdocs/admin/dict.php | 4 ++-- htdocs/admin/ihm.php | 6 ++++-- htdocs/admin/limits.php | 20 +++++++++++--------- htdocs/admin/payment.php | 10 ++++++---- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 3af179ba2e7..43e031a8ce9 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -148,8 +148,8 @@ elseif ($action == 'setdoc') { if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent + // The constant that has been read in front of the new set + // is therefore passed through a variable to have a coherent display $conf->global->ACTION_EVENT_ADDON_PDF = $value; } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 2e81a2c6dad..796d9c7a42b 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -63,7 +63,7 @@ if ($action == 'add') { { $pos = $boxid['pos']; - // Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") + // Initialize distinct fk_user with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") $distinctfkuser=array(); if (! $error) { @@ -225,8 +225,8 @@ print load_fiche_titre($langs->trans("Boxes"), '', 'title_setup'); print $langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; /* - * Recherche des boites actives par defaut pour chaque position possible - * On stocke les boites actives par defaut dans $boxes[position][id_boite]=1 + * Search for the default active boxes for each possible position + * We store the active boxes by default in $boxes[position][id_boite]=1 */ $actives = array(); @@ -257,7 +257,7 @@ if ($resql) array_push($actives, $obj->box_id); if ($obj->box_order == '' || $obj->box_order == '0' || $decalage) $decalage++; - // On renumerote l'ordre des boites si l'une d'elle est a '' + // We renumber the order of the boxes if one of them is in '' // This occurs just after an insert. if ($decalage) { @@ -268,7 +268,7 @@ if ($resql) if ($decalage) { - // Si on a renumerote, on corrige champ box_order + // If we have renumbered, we correct the field box_order // This occurs just after an insert. $sql = "SELECT box_order"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes"; @@ -366,7 +366,7 @@ foreach($boxtoadd as $box) print '
' . $box->sourcefile . ''; print $form->selectarray("boxid[".$box->box_id."][pos]", $pos_name, 0, 1, 0, 0, '', 1)."\n"; print ''."\n"; @@ -483,7 +483,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIV print '
'; +print '
'; print '
'; +print '
'; print ''; print "\n".''."\n"; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 28dd36b5442..9033819b540 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -979,7 +979,7 @@ if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from', 'alpha')); -// Confirmation de la suppression de la ligne +// Confirmation of the deletion of the line if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); @@ -991,7 +991,7 @@ if ($action == 'delete') */ if ($id) { - // Complete requete recherche valeurs avec critere de tri + // Complete search values request with sort criteria $sql=$tabsql[$id]; if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 37c997ee306..7b0a7983b5a 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -432,11 +432,13 @@ if ($action == 'edit') // Edit print ''."\n"; - print '
'; + print '
'; + print '
'; print ''; - print '   '; + print '   '; print ''; print '
'; + print '
'; print ''; } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index a43f86d0e28..5eb3532e47d 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -102,7 +102,7 @@ if ($action == 'edit') clearstatcache(); print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; - print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; @@ -110,23 +110,25 @@ if ($action == 'edit') print '
'; + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'; + print '
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; - print '
'; + print '
'; + print '
'; print ''; print '
'; + print '
'; print ''; print '
'; @@ -142,21 +144,21 @@ else print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.''; - print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.''; - print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.''; + print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.''; - print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.''; print ''; - print '
'; + print '
'; print ''.$langs->trans("Modify").''; print '
'; } diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 4e80fe55e25..eb3261f46c6 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -252,14 +252,16 @@ print "\n"; print ''; -print '
'; +dol_fiche_end(); + +print '
'; +print '
'; print ''; -print '
'; +print '
'; +print '
'; print ''; -dol_fiche_end(); - // End of page llxFooter(); $db->close(); From e32772fdc52befab1a903989e6a7fc9089bc7754 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 09:44:49 +0200 Subject: [PATCH 155/233] Translate --- htdocs/adherents/htpasswd.php | 3 +-- .../facture/class/paymentterm.class.php | 1 - .../compta/localtax/class/localtax.class.php | 1 - htdocs/compta/tva/class/tva.class.php | 1 - htdocs/core/class/antivir.class.php | 1 - htdocs/core/modules/action/rapport.pdf.php | 2 +- .../core/modules/bank/doc/pdf_ban.modules.php | 6 +++--- .../bank/doc/pdf_sepamandate.modules.php | 6 +++--- .../modules/cheque/doc/pdf_blochet.class.php | 6 +++--- .../doc/doc_generic_order_odt.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 2 +- .../contract/doc/pdf_strato.modules.php | 2 +- .../doc/doc_generic_shipment_odt.modules.php | 2 +- .../doc/pdf_standard.modules.php | 2 +- .../modules/export/export_csv.modules.php | 1 - .../modules/export/export_excel.modules.php | 1 - .../export/export_excel2007.modules.php | 1 - .../export/export_excel2007new.modules.php | 1 - .../modules/export/export_tsv.modules.php | 1 - .../doc/doc_generic_invoice_odt.modules.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 2 +- .../livraison/doc/pdf_typhon.modules.php | 3 +-- .../doc/doc_generic_product_odt.modules.php | 2 +- .../product/doc/pdf_standard.modules.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 2 +- .../project/doc/pdf_baleine.modules.php | 21 +++++++++---------- .../project/doc/pdf_beluga.modules.php | 11 +++++----- .../project/doc/pdf_timespent.modules.php | 11 +++++----- .../task/doc/doc_generic_task_odt.modules.php | 2 +- .../doc/doc_generic_proposal_odt.modules.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../doc/doc_generic_reception_odt.modules.php | 2 +- .../societe/doc/doc_generic_odt.modules.php | 4 ++-- .../doc/doc_generic_stock_odt.modules.php | 2 +- .../stock/doc/pdf_standard.modules.php | 2 +- .../stock/doc/pdf_stdmovement.modules.php | 2 +- .../pdf/pdf_canelle.modules.php | 4 ++-- ...doc_generic_supplier_order_odt.modules.php | 4 ++-- .../supplier_order/pdf/pdf_cornas.modules.php | 2 +- .../pdf/pdf_muscadet.modules.php | 2 +- .../doc/pdf_standard.modules.php | 4 ++-- ..._generic_supplier_proposal_odt.modules.php | 2 +- .../doc/pdf_aurore.modules.php | 2 +- .../user/doc/doc_generic_user_odt.modules.php | 2 +- .../doc/doc_generic_usergroup_odt.modules.php | 2 +- htdocs/ecm/dir_card.php | 1 - htdocs/public/agenda/index.php | 1 - htdocs/public/donations/index.php | 1 - htdocs/public/index.php | 1 - htdocs/public/members/index.php | 1 - htdocs/public/paybox/index.php | 1 - htdocs/public/paybox/newpayment.php | 1 - htdocs/public/payment/index.php | 1 - htdocs/public/paypal/index.php | 1 - htdocs/public/stripe/index.php | 1 - htdocs/public/theme/common/index.php | 1 - htdocs/public/theme/index.php | 1 - 57 files changed, 63 insertions(+), 89 deletions(-) diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 885e453c6f1..79de1971dbc 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -20,8 +20,7 @@ /** * \file htdocs/adherents/htpasswd.php * \ingroup member - * \brief Page d'export htpasswd du fichier des adherents - * \author Rodolphe Quiedeville + * \brief Export page htpasswd of the membership file */ require '../main.inc.php'; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index d3b4bd83743..f37c7046633 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -19,7 +19,6 @@ * \file compta/facture/class/paymentterm.class.php * \ingroup facture * \brief This file is an example for a CRUD class file (Create/Read/Update/Delete) - * \author Put author name here */ diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 247db26715a..1a8606054e6 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -18,7 +18,6 @@ /** * \file htdocs/compta/localtax/class/localtax.class.php * \ingroup tax - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 55a94d685cc..29194d21ec6 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -22,7 +22,6 @@ /** * \file htdocs/compta/tva/class/tva.class.php * \ingroup tax - * \author Laurent Destailleur */ // Put here all includes required by your class file diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index 4be4d175b47..df2dcd1f94a 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -22,7 +22,6 @@ /** * \file htdocs/core/class/antivir.class.php * \brief File of class to scan viruses - * \author Laurent Destailleur. */ /** diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b63b2785e44..2fcf6ef7c4f 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -84,7 +84,7 @@ class CommActionRapport $this->month = $month; $this->year = $year; - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index eeee238ac80..91fe828963c 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -61,7 +61,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->name = "ban"; $this->description = $langs->trans("DocumentModelBan").' (Volunteer wanted to finish)'; - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -76,11 +76,11 @@ class pdf_ban extends ModeleBankAccountDoc $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxworkload=$this->marge_gauche+100; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index e94af011b1e..f66d005e6c3 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -63,7 +63,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->name = "sepamandate"; $this->description = $langs->transnoentitiesnoconv("DocumentModelSepaMandate"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -78,11 +78,11 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche; } diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 09148746fe9..eaf4047e107 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -57,7 +57,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->tab_top = 60; - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -68,11 +68,11 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->line_height = 5; $this->line_per_page = 40; $this->tab_height = 200; //$this->line_height * $this->line_per_page; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index eced22d03d8..8f1b0f3a3c8 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -75,7 +75,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'COMMANDE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; 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 7cff0c19e6b..aaec1127963 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 @@ -74,7 +74,7 @@ class doc_generic_contract_odt extends ModelePDFContract $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'CONTRACT_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f7ae9834a65..d73ddd4297b 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -132,7 +132,7 @@ class pdf_strato extends ModelePDFContract $this->name = 'strato'; $this->description = $langs->trans("StandardContractsTemplate"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); 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 52c810fd965..e27eb9b7bf0 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 @@ -76,7 +76,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'EXPEDITION_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 5cfc6c3287e..2c24c4338c5 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -133,7 +133,7 @@ class pdf_standard extends ModeleExpenseReport $this->name = ""; $this->description = $langs->trans('PDFStandardExpenseReports'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 9d606aadc33..9dfe8efe28c 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -19,7 +19,6 @@ * \file htdocs/core/modules/export/export_csv.modules.php * \ingroup export * \brief File of class to build exports with CSV format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 0e7fd0f1169..2651762998d 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_excel.modules.php * \ingroup export * \brief File of class to generate export file with Excel format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 7460d71ff13..982b42b3ec5 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_excel2007.modules.php * \ingroup export * \brief File of class to generate export file with Excel format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 038446643a2..42ffd3b5fba 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_excelnew.modules.php * \ingroup export * \brief File of class to generate export file with Excel format - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index b40da3cd539..f87bcf4fbdb 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -20,7 +20,6 @@ * \file htdocs/core/modules/export/export_csv.modules.php * \ingroup export * \brief File of class to build export files with format TSV - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 642140e0ce8..8463f1449ed 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -75,7 +75,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'FACTURE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 9d39eb5e858..2b5158e6f48 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -125,7 +125,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->name = 'soleil'; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 963de1494a7..4c10b7c7864 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -25,7 +25,6 @@ * \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Typhon - * \author Laurent Destailleur */ require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; @@ -128,7 +127,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->name = "typhon"; $this->description = $langs->trans("DocumentModelTyphon"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; 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 f8861380b2f..9a3381319a7 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 @@ -73,7 +73,7 @@ class doc_generic_product_odt extends ModelePDFProduct $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PRODUCT_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 88ec5204845..119ce6ad632 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -126,7 +126,7 @@ class pdf_standard extends ModelePDFProduct $this->name = "standard"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 6d67a36c010..6c1aa5b418b 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -90,7 +90,7 @@ class doc_generic_project_odt extends ModelePDFProjects $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PROJECT_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index bc2019bfce8..67b530ef96c 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -20,8 +20,7 @@ /** * \file htdocs/core/modules/project/doc/pdf_baleine.modules.php * \ingroup project - * \brief File of class to generate project document Baleine - * \author Regis Houssin + * \brief File of the class allowing to generate projects with the baleine model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -128,7 +127,7 @@ class pdf_baleine extends ModelePDFProjects $this->name = "baleine"; $this->description = $langs->trans("DocumentModelBaleine"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -143,11 +142,11 @@ class pdf_baleine extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxworkload=$this->marge_gauche+120; @@ -295,7 +294,7 @@ class pdf_baleine extends ModelePDFProjects $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-2, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+2); @@ -410,7 +409,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font // Ref of task $pdf->SetXY($this->posxref, $curY); @@ -483,7 +482,7 @@ class pdf_baleine extends ModelePDFProjects $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - // Pied de page + // Footer of the page $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); @@ -507,7 +506,7 @@ class pdf_baleine extends ModelePDFProjects $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -545,10 +544,10 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); - // Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param + // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); - // line prend une position y en 3eme param + // line takes a position y in 3rd parameter $pdf->line($this->marge_gauche, $tab_top+$heightoftitleline, $this->page_largeur-$this->marge_droite, $tab_top+$heightoftitleline); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index ba815810f28..7721b29a1bf 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -21,8 +21,7 @@ /** * \file htdocs/core/modules/project/doc/pdf_beluga.modules.php * \ingroup project - * \brief Fichier de la classe permettant de generer les projets au modele beluga - * \author Charlie Benke + * \brief File of the class allowing to generate projects with the beluga model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -50,7 +49,7 @@ if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/com /** - * Class to manage generation of project document Baleine + * Class to manage generation of project document Beluga */ class pdf_beluga extends ModelePDFProjects @@ -83,7 +82,7 @@ class pdf_beluga extends ModelePDFProjects $this->name = "beluga"; $this->description = $langs->trans("DocumentModelBeluga"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->orientation = 'L'; @@ -104,11 +103,11 @@ class pdf_beluga extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position if ($this->orientation == 'L' || $this->orientation == 'Landscape') { $this->posxref=$this->marge_gauche+1; $this->posxdate=$this->marge_gauche+105; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 7685c07b480..e4a32541aa9 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -17,10 +17,9 @@ */ /** - * \file htdocs/core/modules/project/doc/pdf_baleine.modules.php + * \file htdocs/core/modules/project/doc/pdf_timespent.modules.php * \ingroup project * \brief File of class to generate project document Baleine - * \author Regis Houssin */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -33,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** - * Class to manage generation of project document Baleine + * Class to manage generation of project document Timespent */ class pdf_timespent extends ModelePDFProjects @@ -60,7 +59,7 @@ class pdf_timespent extends ModelePDFProjects $this->name = "timespent"; $this->description = $langs->trans("DocumentModelTimeSpent"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -75,11 +74,11 @@ class pdf_timespent extends ModelePDFProjects $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_codeproduitservice = 1; // Affiche code produit-service - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes + // Define column position $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxtimespent=$this->marge_gauche+120; 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 f6da1061c89..a12b1079caf 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 @@ -91,7 +91,7 @@ class doc_generic_task_odt extends ModelePDFTask $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PROJECT_TASK_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 7b274ac0c9a..8c8b566259a 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -72,7 +72,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'PROPALE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 127c7a92352..0fb5c1412b2 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -47,7 +47,7 @@ class pdf_paiement $this->db = $db; $this->description = $langs->transnoentities("ListOfCustomerPayments"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 588b848f3d3..fd3a93c130f 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -70,7 +70,7 @@ class doc_generic_reception_odt extends ModelePdfReception $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'RECEPTION_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index f8bbf568d86..cba1a3d894e 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -66,7 +66,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'COMPANY_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; @@ -78,7 +78,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $this->option_logo = 1; // Affiche logo - // Recupere emmetteur + // Retrieves transmitter $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini } diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index ac9c0423694..55a6caea5a2 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -73,7 +73,7 @@ class doc_generic_stock_odt extends ModelePDFStock $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'STOCK_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 61bfa916fe2..08e0894bd04 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -126,7 +126,7 @@ class pdf_standard extends ModelePDFStock $this->name = "standard"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 6a607de6d37..45edfb72cde 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -126,7 +126,7 @@ class pdf_stdmovement extends ModelePDFMovement $this->name = "stdmouvement"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 00e981dfdd6..2f2e28b5463 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -128,7 +128,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->name = "canelle"; $this->description = $langs->trans('SuppliersInvoiceModel'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -148,7 +148,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->franchise=!$mysoc->tva_assuj; - // Defini position des colonnes + // Define column position $this->posxdesc=$this->marge_gauche+1; $this->posxtva=112; $this->posxup=126; diff --git a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php index d9e9112ec54..06fc7d2ae87 100644 --- a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php @@ -76,7 +76,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'SUPPLIER_ORDER_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; @@ -233,7 +233,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if ($conf->fournisseur->commande->dir_output) { $object->fetch_thirdparty(); - + if ($object->specimen) { $dir = $conf->fournisseur->commande->dir_output; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 02b11366816..07070c261cc 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -131,7 +131,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->name = "cornas"; $this->description = $langs->trans('SuppliersCommandModel'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 116b77117e4..61982a05621 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -131,7 +131,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->name = "muscadet"; $this->description = $langs->trans('SuppliersCommandModel'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 81093d9adff..3670797da67 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -128,7 +128,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->name = "standard"; $this->description = $langs->trans('DocumentModelStandardPDF'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -144,7 +144,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->franchise=!$mysoc->tva_assuj; - // Defini position des colonnes + // Define column position $this->posxdate=$this->marge_gauche+1; $this->posxreffacturefourn=30; $this->posxreffacture=65; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 7b38ec52c0e..ac1868f6313 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; 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 44fe533f0eb..2ed06067944 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -128,7 +128,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->name = "aurore"; $this->description = $langs->trans('DocModelAuroreDescription'); - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'pdf'; $formatarray=pdf_getFormat(); $this->page_largeur = $formatarray['width']; 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 80576bfcca0..f67cc02ff2d 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 @@ -71,7 +71,7 @@ class doc_generic_user_odt extends ModelePDFUser $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'USER_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; 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 023bc714ac3..750d523b4e2 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 @@ -74,7 +74,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $this->description = $langs->trans("DocumentModelOdt"); $this->scandir = 'USERGROUP_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan - // Dimension page pour format A4 + // Page size for A4 format $this->type = 'odt'; $this->page_largeur = 0; $this->page_hauteur = 0; diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index b6cb7dbfb7f..f0992160d09 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -20,7 +20,6 @@ * \file htdocs/ecm/dir_card.php * \ingroup ecm * \brief Card of a directory for ECM module - * \author Laurent Destailleur */ require '../main.inc.php'; diff --git a/htdocs/public/agenda/index.php b/htdocs/public/agenda/index.php index 112a07951b8..f55eb4d941b 100644 --- a/htdocs/public/agenda/index.php +++ b/htdocs/public/agenda/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/agenda/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/donations/index.php b/htdocs/public/donations/index.php index 08e7650a152..7404698becd 100644 --- a/htdocs/public/donations/index.php +++ b/htdocs/public/donations/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/donations/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/index.php b/htdocs/public/index.php index e1030c9973a..a1eeeffe9c6 100644 --- a/htdocs/public/index.php +++ b/htdocs/public/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../master.inc.php'; diff --git a/htdocs/public/members/index.php b/htdocs/public/members/index.php index 42bfa7713cf..c31d0e10449 100644 --- a/htdocs/public/members/index.php +++ b/htdocs/public/members/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/members/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/paybox/index.php b/htdocs/public/paybox/index.php index 58d748aba72..60da64aad9d 100644 --- a/htdocs/public/paybox/index.php +++ b/htdocs/public/paybox/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/paybox/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 319c40f2c18..9524b1be9ed 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -21,7 +21,6 @@ * \file htdocs/public/paybox/newpayment.php * \ingroup paybox * \brief File to offer a way to make a payment for a particular Dolibarr entity - * \author Laurent Destailleur */ define("NOLOGIN", 1); // This means this output page does not require to be logged. diff --git a/htdocs/public/payment/index.php b/htdocs/public/payment/index.php index 21786830df6..b0772b576c0 100644 --- a/htdocs/public/payment/index.php +++ b/htdocs/public/payment/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/payment/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/paypal/index.php b/htdocs/public/paypal/index.php index 0cba12e6aa2..54e81788f49 100644 --- a/htdocs/public/paypal/index.php +++ b/htdocs/public/paypal/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/paypal/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/stripe/index.php b/htdocs/public/stripe/index.php index 6958940ea48..792aa7c5f10 100644 --- a/htdocs/public/stripe/index.php +++ b/htdocs/public/stripe/index.php @@ -19,7 +19,6 @@ * \file htdocs/public/stripe/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; diff --git a/htdocs/public/theme/common/index.php b/htdocs/public/theme/common/index.php index 2a9d8b8c2a9..3d4eec0ee31 100644 --- a/htdocs/public/theme/common/index.php +++ b/htdocs/public/theme/common/index.php @@ -20,7 +20,6 @@ * \file htdocs/public/theme/common/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../../master.inc.php'; diff --git a/htdocs/public/theme/index.php b/htdocs/public/theme/index.php index 6b5d38f5e94..bf856f24280 100644 --- a/htdocs/public/theme/index.php +++ b/htdocs/public/theme/index.php @@ -20,7 +20,6 @@ * \file htdocs/public/theme/index.php * \ingroup core * \brief A redirect page to an error - * \author Laurent Destailleur */ require '../../master.inc.php'; From d3b51979565f63a38900969c58d573fb08af1a1e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 20 Sep 2019 13:02:50 +0200 Subject: [PATCH 156/233] FIX new display for stripe account invert col and row for better display --- htdocs/societe/paymentmodes.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index a9f0d9aed0b..6154a8a7c3a 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1307,19 +1307,21 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $balance = \Stripe\Balance::retrieve(array("stripe_account" => $stripesupplieracc)); print ''."\n"; print ''; - print ''; - print ''; print ''; + print ''; + print ''; + print ''; print ''; + $currencybalance = array(); if (is_array($balance->available) && count($balance->available)) { foreach ($balance->available as $cpt) { $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($cpt->currency, $arrayzerounitcurrency)) $amount = $cpt->amount / 100; - else $amount = $cpt->amount; - print ''; + if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->available=$cpt->amount / 100; + else $currencybalance[$cpt->currency]->available=$cpt->amount; + $currencybalance[$cpt->currency]->currency=$cpt->currency; } } @@ -1328,11 +1330,19 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' foreach ($balance->pending as $cpt) { $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($cpt->currency, $arrayzerounitcurrency)) $amount = $cpt->amount / 100; - else $amount = $cpt->amount; - print ''; + if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount / 100; + else $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount; } } + + if (is_array($currencybalance)) + { + foreach ($currencybalance as $cpt) + { + print ''; + } + } + print '
'.$langs->trans('Status').''.$langs->trans('Amount').''.$langs->trans('Currency').''.$langs->trans('Available').''.$langs->trans('Pending').''.$langs->trans('Total').'
'.$langs->trans("Available").''.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' '.$langs->trans("Currency".strtoupper($cpt->currency)).'
'.$langs->trans("Pending").''.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' '.$langs->trans("Currency".strtoupper($cpt->currency)).'
'.$langs->trans("Currency".strtoupper($cpt->currency)).''.price($cpt->available, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).''.price($cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).''.price($cpt->available+$cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'
'; print '
'; } From 1e49fd0d45b259de9df24aa6cdd4401faafabb4b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 20 Sep 2019 15:07:58 +0200 Subject: [PATCH 157/233] Translate --- htdocs/adherents/subscription/card.php | 6 +++--- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 6 +++--- .../modules/bank/doc/pdf_sepamandate.modules.php | 10 +++++----- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 2 +- .../modules/commande/doc/pdf_einstein.modules.php | 10 +++++----- .../modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 4 ++-- .../modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- .../modules/expedition/doc/pdf_merou.modules.php | 2 +- .../modules/expedition/doc/pdf_rouget.modules.php | 6 +++--- .../expensereport/doc/pdf_standard.modules.php | 6 +++--- .../core/modules/facture/doc/pdf_crabe.modules.php | 8 ++++---- .../core/modules/facture/doc/pdf_sponge.modules.php | 6 +++--- .../modules/fichinter/doc/pdf_soleil.modules.php | 4 ++-- .../modules/livraison/doc/pdf_typhon.modules.php | 8 ++++---- .../modules/product/doc/pdf_standard.modules.php | 8 ++++---- .../core/modules/project/doc/pdf_beluga.modules.php | 6 +++--- .../modules/project/doc/pdf_timespent.modules.php | 6 +++--- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 +++++----- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- .../modules/reception/doc/pdf_squille.modules.php | 6 +++--- .../core/modules/stock/doc/pdf_standard.modules.php | 8 ++++---- .../modules/stock/doc/pdf_stdmovement.modules.php | 8 ++++---- .../supplier_invoice/pdf/pdf_canelle.modules.php | 10 +++++----- .../supplier_order/pdf/pdf_cornas.modules.php | 8 ++++---- .../supplier_order/pdf/pdf_muscadet.modules.php | 10 +++++----- .../supplier_payment/doc/pdf_standard.modules.php | 4 ++-- .../supplier_proposal/doc/pdf_aurore.modules.php | 12 ++++++------ 28 files changed, 99 insertions(+), 99 deletions(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index e44995b263f..21b5b68794f 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -68,7 +68,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $cancel) { - // Charge objet actuel + // Load current object $result=$object->fetch($rowid); if ($result > 0) { @@ -101,7 +101,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $canc if (! $errmsg) { - // Modifie valeures + // Modify values $object->dateh=dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $object->datef=dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']); $object->fk_type=$_POST["typeid"]; @@ -389,7 +389,7 @@ if ($rowid && $action != 'edit') } } - // Supprimer + // Delete if ($user->rights->adherent->cotisation->creer) { print '\n"; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 91fe828963c..9a6ee697833 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -197,7 +197,7 @@ class pdf_ban extends ModeleBankAccountDoc $nexY = $pdf->GetY(); $height_note=$nexY-($tab_top-2); - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -231,7 +231,7 @@ class pdf_ban extends ModeleBankAccountDoc } /* - * Pied de page + * Footer of the page */ $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); @@ -261,7 +261,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f66d005e6c3..c7206000982 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -109,7 +109,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'; - // Load traductions files required by page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "withdrawals", "companies", "projects", "bills")); if (! empty($conf->bank->dir_output)) @@ -194,7 +194,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $tab_top_newpage = 40; $tab_height_newpage = 210; - // Affiche notes + // Show notes if (! empty($object->note_public)) { $pdf->SetFont('', '', $default_font_size - 1); @@ -202,7 +202,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $nexY = $pdf->GetY(); $height_note=$nexY-($tab_top-2); - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -374,7 +374,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); /* - * Pied de page + * Footer of the page */ $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); @@ -404,7 +404,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index eaf4047e107..70985902ad7 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -205,7 +205,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->result = array('fullpath'=>$file); $outputlangs->charset_output=$sav_charset_output; - return 1; // Pas d'erreur + return 1; // No error } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 4a81f94ed29..6f46a9b70a9 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -353,7 +353,7 @@ class pdf_einstein extends ModelePDFCommandes $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -388,7 +388,7 @@ class pdf_einstein extends ModelePDFCommandes $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -633,7 +633,7 @@ class pdf_einstein extends ModelePDFCommandes $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1156,11 +1156,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index afe1213fa23..eeb0fa930ac 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -383,7 +383,7 @@ class pdf_eratosthene extends ModelePDFCommandes $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -831,7 +831,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1343,13 +1343,13 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index d73ddd4297b..76dafb4f10a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -279,7 +279,7 @@ class pdf_strato extends ModelePDFContract $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -556,7 +556,7 @@ class pdf_strato extends ModelePDFContract */ // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+3); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+3); // Rect takes a length in 3rd parameter and 4th parameter } /** diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 8f3441c332c..66a86e4345f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -320,7 +320,7 @@ class pdf_espadon extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -377,7 +377,7 @@ class pdf_espadon extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -788,13 +788,13 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index dbdfd722168..761201e1836 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -281,7 +281,7 @@ class pdf_merou extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d3e254c6132..96a166d4ff8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -350,7 +350,7 @@ class pdf_rouget extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -407,7 +407,7 @@ class pdf_rouget extends ModelePdfExpedition $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -800,7 +800,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 2c24c4338c5..65db52ddce3 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -334,7 +334,7 @@ class pdf_standard extends ModeleExpenseReport $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -525,7 +525,7 @@ class pdf_standard extends ModeleExpenseReport $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -883,7 +883,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetDrawColor(128, 128, 128); - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param if (empty($hidetop)) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 7ec496d385b..fd684801096 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -420,7 +420,7 @@ class pdf_crabe extends ModelePDFFactures $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -455,7 +455,7 @@ class pdf_crabe extends ModelePDFFactures $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -1498,11 +1498,11 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 10bea53032f..7a41a72ba3b 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -414,7 +414,7 @@ class pdf_sponge extends ModelePDFFactures $nexY = max($pdf->GetY(), $nexY); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -1795,13 +1795,13 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 2b5158e6f48..aec300c634d 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -282,7 +282,7 @@ class pdf_soleil extends ModelePDFFicheinter $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -529,7 +529,7 @@ class pdf_soleil extends ModelePDFFicheinter */ // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidebottom)) { diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 4c10b7c7864..796f58a6743 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -334,7 +334,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -353,7 +353,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -623,7 +623,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->result = array('fullpath'=>$file); - return 1; // pas d'erreur + return 1; // No error } else { @@ -694,7 +694,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('', '', $default_font_size - 2); // Output Rec - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 119ce6ad632..098adc71c57 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -328,7 +328,7 @@ class pdf_standard extends ModelePDFProduct $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -572,7 +572,7 @@ class pdf_standard extends ModelePDFProduct $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -630,11 +630,11 @@ class pdf_standard extends ModelePDFProduct $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 7721b29a1bf..1d7e30e7e6c 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -267,7 +267,7 @@ class pdf_beluga extends ModelePDFProjects $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-2, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+2); @@ -679,7 +679,7 @@ class pdf_beluga extends ModelePDFProjects $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -717,7 +717,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); - // Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param + // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index e4a32541aa9..2e475a05731 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -225,7 +225,7 @@ class pdf_timespent extends ModelePDFProjects $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -437,7 +437,7 @@ class pdf_timespent extends ModelePDFProjects $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -475,7 +475,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); - // Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param + // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 59267e25272..c29fc14685a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -415,7 +415,7 @@ class pdf_azur extends ModelePDFPropales $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -458,7 +458,7 @@ class pdf_azur extends ModelePDFPropales $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -818,7 +818,7 @@ class pdf_azur extends ModelePDFPropales $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1350,11 +1350,11 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f5784ab1b2b..11c4ac111d1 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -392,7 +392,7 @@ class pdf_cyan extends ModelePDFPropales $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -933,7 +933,7 @@ class pdf_cyan extends ModelePDFPropales $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1457,13 +1457,13 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 4a16724d614..c3e287a4366 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -274,7 +274,7 @@ class pdf_squille extends ModelePdfReception $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -331,7 +331,7 @@ class pdf_squille extends ModelePdfReception $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -716,7 +716,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 08e0894bd04..bff8f8b4c43 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -558,7 +558,7 @@ class pdf_standard extends ModelePDFStock $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -738,7 +738,7 @@ class pdf_standard extends ModelePDFStock $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -796,7 +796,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetFont('', 'B', $default_font_size - 3); // Output Rect - //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); $pdf->SetDrawColor(220, 26, 26); @@ -807,7 +807,7 @@ class pdf_standard extends ModelePDFStock if (empty($hidetop)) { - //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell($this->wref, 3, $outputlangs->transnoentities("Ref"), '', 'L'); } diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 45edfb72cde..e589654feb3 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -732,7 +732,7 @@ class pdf_stdmovement extends ModelePDFMovement $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -794,7 +794,7 @@ class pdf_stdmovement extends ModelePDFMovement $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -852,7 +852,7 @@ class pdf_stdmovement extends ModelePDFMovement $pdf->SetFont('', 'B', $default_font_size - 3); // Output Rect - //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); $pdf->SetDrawColor(220, 26, 26); @@ -864,7 +864,7 @@ class pdf_stdmovement extends ModelePDFMovement //Ref mouv if (empty($hidetop)) { - //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxidref, $tab_top+1); $pdf->MultiCell($this->posxdatemouv-$this->posxdatemouv-0.8, 3, $outputlangs->transnoentities("Ref"), '', 'L'); } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 2f2e28b5463..a2393d7f63e 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -340,7 +340,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -358,7 +358,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -590,7 +590,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -858,11 +858,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 07070c261cc..ffa0d9edc08 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -355,7 +355,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -785,7 +785,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1141,7 +1141,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter foreach ($this->cols as $colKey => $colDef) { @@ -1165,7 +1165,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } if (empty($hidetop)){ - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 61982a05621..9201a586d31 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -388,7 +388,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); @@ -406,7 +406,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -687,7 +687,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1043,11 +1043,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 3670797da67..3f2dca2757d 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -502,7 +502,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -619,7 +619,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore 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 2ed06067944..e39e8434a8b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -24,7 +24,7 @@ /** * \file htdocs/core/modules/propale/doc/pdf_azur.modules.php * \ingroup propale - * \brief Fichier de la classe permettant de generer les propales au modele Azur + * \brief File of the class allowing to generate the supplier propals to the Aurore model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Class to generate PDF proposal Azur + * Class to generate PDF supplier proposal Aurore */ class pdf_aurore extends ModelePDFSupplierProposal { @@ -391,7 +391,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param + // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); @@ -685,7 +685,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->result = array('fullpath'=>$file); - return 1; // Pas d'erreur + return 1; // No error } else { @@ -1201,11 +1201,11 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); From 44ba0deae69c4dc291bff0c04edfc55dbe588a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 20 Sep 2019 17:58:22 +0200 Subject: [PATCH 158/233] fix badge linked resources on fichinter --- htdocs/core/lib/fichinter.lib.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 8f8dea33b97..c17080d53f5 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -66,19 +66,20 @@ function fichinter_prepare_head($object) if ($conf->resource->enabled) { require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; - $nbResource = 0; - $objectres=new Dolresource($db); - if (is_array($objectres->available_resources)) - { - foreach ($objectres->available_resources as $modresources => $resources) - { - $resources=(array) $resources; // To be sure $resources is an array - foreach($resources as $resource_obj) - { - $linked_resources = $object->getElementResources('fichinter', $object->id, $resource_obj); - } - } - } + $objectres = new Dolresource($db); + $linked_resources = $objectres->getElementResources('fichinter', $object->id); + $nbResource = (is_array($linked_resources)?count($linked_resources):0); + // if (is_array($objectres->available_resources)) + // { + // foreach ($objectres->available_resources as $modresources => $resources) + // { + // $resources=(array) $resources; // To be sure $resources is an array + // foreach($resources as $resource_obj) + // { + // $linked_resources = $object->getElementResources('fichinter', $object->id, $resource_obj); + // } + // } + // } $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); From 86e8abde65635e41479af3dd250014ff10108f92 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 11:18:54 +0200 Subject: [PATCH 159/233] Fix warning --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2eead6da81d..9c2f8ea737c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; */ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '') { - global $user,$conf,$langs,$dolibarr_main_db_name; + global $user,$conf,$langs,$dolibarr_main_db_name, $mysoc; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]); $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]); From 14c98bea157941f4cbaafb985b108f41ecbaff02 Mon Sep 17 00:00:00 2001 From: oscim Date: Sun, 22 Sep 2019 11:34:28 +0200 Subject: [PATCH 160/233] Update livraison.class.php for correct display object link in card other object (shipping) --- htdocs/livraison/class/livraison.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 093a1c3ab1e..aa1f59cdfc4 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -844,6 +844,12 @@ class Livraison extends CommonObject elseif ($statut==0) return $langs->trans($this->statuts[$statut]); elseif ($statut==1) return $langs->trans($this->statuts[$statut]); } + elseif ($mode == 3) + { + if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'),'statut5'); + if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0'); + if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4'); + } elseif ($mode == 4) { if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5').' '.$langs->trans('StatusDeliveryCanceled'); From aed017deab26924d048f169d8b7e25186ce1e743 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 09:36:18 +0000 Subject: [PATCH 161/233] Fixing style errors. --- htdocs/livraison/class/livraison.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index aa1f59cdfc4..afc1d89538c 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -846,9 +846,9 @@ class Livraison extends CommonObject } elseif ($mode == 3) { - if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'),'statut5'); - if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0'); - if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4'); + if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5'); + if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0'); + if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4'); } elseif ($mode == 4) { From 98acfd6929369ff11a0e6fb2f1583b16b4c36b4a Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 11:57:33 +0200 Subject: [PATCH 162/233] Add basic stats to new dashboard --- htdocs/index.php | 51 ++++++++++++++++++++++++++++-- htdocs/theme/eldy/info-box.inc.php | 28 ++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index d50b5248fab..9151ead38b8 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -514,47 +514,55 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'project' => array( 'groupName' => 'Projects', + 'globalStatsKey' => 'projects', 'stats' => array('project', 'project_task'), ), 'propal' => array( 'groupName' => 'Proposals', + 'globalStatsKey' => 'proposals', 'stats' => array('propal_opened', 'propal_signed'), ), 'commande' => array( 'groupName' => 'Orders', + 'globalStatsKey' => 'orders', 'stats' => array('commande'), ), 'facture' => array( 'groupName' => 'Invoices', + 'globalStatsKey' => 'invoices', 'stats' => array('facture'), ), 'contrat' => array( 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', 'stats' => array('contrat_inactive', 'contrat_active'), ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', + 'globalStatsKey' => 'askprice', 'stats' => array('supplier_proposal_opened', 'supplier_proposal_signed'), ), 'order_supplier' => array( 'groupName' => 'SuppliersOrders', + 'globalStatsKey' => 'supplier_orders', 'stats' => array('order_supplier'), ), 'invoice_supplier' => array( 'groupName' => 'BillsSuppliers', + 'globalStatsKey' => 'supplier_invoices', 'stats' => array('invoice_supplier'), ), @@ -567,18 +575,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'Adherent' => array( 'groupName' => 'Members', + 'globalStatsKey' => 'members', 'stats' => array('Adherent'), ), 'ExpenseReport' => array( 'groupName' => 'ExpenseReport', + 'globalStatsKey' => 'expensereports', 'stats' => array('ExpenseReport'), ), 'Holiday' => array( 'groupName' => 'Holidays', + 'globalStatsKey' => 'holidays', 'stats' => array('Holiday'), ), @@ -672,12 +683,46 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if (!empty($boards)) { $groupName = $langs->trans($groupElement['groupName']); $groupKeyLowerCase = strtolower($groupKey); + $nbTotalForGroup = 0; + + // global stats + $globalStatsKey = false; + if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])){ // can be filled by hook + $globalStatsKey = $groupElement['globalStatsKey']; + $groupElement['globalStats'] = array(); + + if(in_array($globalStatsKey, $keys)) + { + // get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links + $keyIndex = array_search($globalStatsKey, $keys); + + $classe=$classes[$keyIndex]; + if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) + { + $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; + $nbTotal = doubleval($groupElement['globalStats']['total']); + if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000 , 2) .'k'; } + $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; + $groupElement['globalStats']['total'] = $nbTotal; + $groupElement['globalStats']['link'] = $links[$keyIndex]; + } + } + } + $openedDashBoard .= '
' . "\n"; $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= ' ' . "\n"; - $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= ' ' . $groupName . '' . "\n"; + $openedDashBoard.= ' '."\n"; + $openedDashBoard.= ' '."\n"; + + if(!empty($groupElement['globalStats'])){ + $openedDashBoard.= ' '.$nbTotal.''."\n"; + } + + $openedDashBoard.= ' '."\n"; + $openedDashBoard .= '
' . "\n"; + + $openedDashBoard .= ' '.$groupName.'' . "\n"; foreach ($boards as $board) { if (!empty($board->labelShort)) { diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3586d310dfa..34254812848 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -8,6 +8,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> */ .info-box { display: block; + position: relative; min-height: 90px; background: #fff; width: 100%; @@ -54,6 +55,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> border-bottom-right-radius: 0; border-bottom-left-radius: 2px; display: block; + overflow: hidden; float: left; height: 90px; width: 90px; @@ -71,6 +73,32 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .info-box-icon > img { max-width: 100%; } +.info-box-icon-text{ + box-sizing: border-box; + display: block; + position: absolute; + width: 90px; + bottom: 0px; + color: #ffffff; + background-color: rgba(0,0,0,0.1); + cursor: default; + + font-size: 10px; + line-height: 15px; + padding: 0px 3px; + text-align: center; + opacity: 0; + -webkit-transition: opacity 0.5s, visibility 0s 0.5s; + transition: opacity 0.5s, visibility 0s 0.5s; +} +.info-box-sm .info-box-icon-text{ + overflow: hidden; + width: 80px; +} +.info-box:hover .info-box-icon-text{ + opacity: 1; +} + .info-box-content { padding: 5px 10px; margin-left: 90px; From 0660229602b642a9b7188b0ee8501a586d856463 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 10:05:13 +0000 Subject: [PATCH 163/233] Fixing style errors. --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 9151ead38b8..b18ba2cf3be 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -701,7 +701,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { { $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; $nbTotal = doubleval($groupElement['globalStats']['total']); - if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000 , 2) .'k'; } + if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000, 2) .'k'; } $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; $groupElement['globalStats']['total'] = $nbTotal; $groupElement['globalStats']['link'] = $links[$keyIndex]; From 9e55fee6e44825e47204bec4d6fc55e35b185b25 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 13:46:11 +0200 Subject: [PATCH 164/233] Prepare global stats replacement --- htdocs/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 9151ead38b8..a8158f6e473 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -662,7 +662,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Show dashboard $nbworkboardempty = 0; - $isIntopOpenedDashBoard = array(); + $isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array(); if (!empty($valid_dashboardlines)) { $openedDashBoard = ''; @@ -716,6 +716,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $openedDashBoard.= ' '."\n"; if(!empty($groupElement['globalStats'])){ + $globalStatInTopOpenedDashBoard[] = $groupElement['globalStats']; $openedDashBoard.= ' '.$nbTotal.''."\n"; } From 913c298a9178bd84870a4f64c78073a959e8fce8 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 20:59:28 +0200 Subject: [PATCH 165/233] Auto remove basic stats if in new opened dashboard --- htdocs/index.php | 98 +++++++++++++++++++----------- htdocs/theme/eldy/info-box.inc.php | 7 +++ 2 files changed, 70 insertions(+), 35 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 45c7e1509e2..28a1a54e2ad 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -107,27 +107,21 @@ if (! empty($conf->global->MAIN_MOTD)) * Dashboard Dolibarr states (statistics) * Hidden for external users */ -$boxstat=''; + + +$boxstatItems = array(); +$boxstatFromHook = ''; // Load translation files required by page $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { - $boxstat.='
'; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.='
'; - $boxstat.='
'.$langs->trans("DolibarrStateBoard").'
'; - $boxstat.='
'; - $object=new stdClass(); $parameters=array(); $action=''; $reshook=$hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - $boxstat.=$hookmanager->resPrint; + $boxstatFromHook=$hookmanager->resPrint; if (empty($reshook)) { @@ -318,6 +312,7 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT { if ($conditions[$key]) { + $boxstatItem = ''; $classe=$classes[$key]; // Search in cache if load_state_board is already realized if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe])) @@ -336,28 +331,17 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text=$langs->trans($titres[$key]); - $boxstat.=''; - $boxstat.='
'; - $boxstat.=''.$text.'
'; - $boxstat.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; - $boxstat.='
'; - $boxstat.='
'; + $boxstatItem.=''; + $boxstatItem.='
'; + $boxstatItem.=''.$text.'
'; + $boxstatItem.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; + $boxstatItem.='
'; + $boxstatItem.='
'; + + $boxstatItems[$val] = $boxstatItem; } } } - - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - - $boxstat.='
'; - $boxstat.='
'; } @@ -589,7 +573,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'Holiday' => array( 'groupName' => 'Holidays', - 'globalStatsKey' => 'holidays', + 'globalStatsKey' => 'holidays', 'stats' => array('Holiday'), ), @@ -710,18 +694,18 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } - $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= '
' . "\n"; + $openedDashBoard.= '
' . "\n"; + $openedDashBoard.= '
' . "\n"; $openedDashBoard.= ' '."\n"; $openedDashBoard.= ' '."\n"; if(!empty($groupElement['globalStats'])){ - $globalStatInTopOpenedDashBoard[] = $groupElement['globalStats']; + $globalStatInTopOpenedDashBoard[] = $globalStatsKey; $openedDashBoard.= ' '.$nbTotal.''."\n"; } $openedDashBoard.= ' '."\n"; - $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= '
' . "\n"; $openedDashBoard .= ' '.$groupName.'' . "\n"; @@ -900,6 +884,50 @@ $boxlist.=$resultboxes['boxlista']; $boxlist.= '
'; + +if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) +{ + // Remove allready present info in new dash board + if(!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0){ + foreach ( $boxstatItems as $boxstatItemKey => $boxstatItemHtml) { + if (in_array($boxstatItemKey, $globalStatInTopOpenedDashBoard)) { + unset($boxstatItems[$boxstatItemKey]); + } + } + } + + if(!empty($boxstatFromHook) || !empty($boxstatItems)){ + $boxstat.='
'; + $boxstat.=''; + $boxstat.=''; + $boxstat.=''; + $boxstat.=''; + $boxstat.=''; + $boxstat.='
'; + $boxstat.='
'.$langs->trans("DolibarrStateBoard").'
'; + $boxstat.='
'; + + $boxstat.=$boxstatFromHook; + + if(is_array($boxstatItems) && count($boxstatItems) > 0) + { + $boxstat.= implode('', $boxstatItems); + } + + $boxstat.='
'; + $boxstat.='
'; + $boxstat.='
'; + $boxstat.='
'; + $boxstat.='
'; + $boxstat.='
'; + $boxstat.='
'; + $boxstat.='
'; + + $boxstat.='
'; + $boxstat.='
'; + } +} + $boxlist.= '
'; $boxlist.=$boxstat; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 34254812848..a483b3d758d 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -91,6 +91,13 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> -webkit-transition: opacity 0.5s, visibility 0s 0.5s; transition: opacity 0.5s, visibility 0s 0.5s; } + +global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)){ ?> +.info-box-icon-text{ + opacity: 1; +} + + .info-box-sm .info-box-icon-text{ overflow: hidden; width: 80px; From 3faca1dbd1d7b8d162c72126d20682dda5850622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Sep 2019 21:09:01 +0200 Subject: [PATCH 166/233] Enhancement for SCA --- htdocs/stripe/class/stripe.class.php | 44 +++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9c0bc9ebae3..6379aa36746 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -654,7 +654,7 @@ class Stripe extends CommonObject * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param int $status Status (0=test, 1=live) * @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card - * @return \Stripe\StripeCard|null Stripe Card or null if not found + * @return \Stripe\StripeCard|\Stripe\PaymentMethod|null Stripe Card or null if not found */ public function cardStripe($cu, CompanyPaymentMode $object, $stripeacc = '', $status = 0, $createifnotlinkedtostripe = 0) { @@ -680,10 +680,24 @@ class Stripe extends CommonObject { try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $card = $cu->sources->retrieve($cardref); + if (! preg_match('/^pm_/', $cardref)) + { + $card = $cu->sources->retrieve($cardref); + } + else + { + $card = \Stripe\PaymentMethod::retrieve($cardref); + } } else { - //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided - $card = $cu->sources->retrieve($cardref); + if (! preg_match('/^pm_/', $cardref)) + { + //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided + $card = $cu->sources->retrieve($cardref); + } + else { + //$card = \Stripe\PaymentMethod::retrieve($cardref, array("stripe_account" => $stripeacc)); // Don't know if this works + $card = \Stripe\PaymentMethod::retrieve($cardref); + } } } catch(Exception $e) @@ -707,12 +721,28 @@ class Stripe extends CommonObject //$a = \Stripe\Stripe::getApiKey(); //var_dump($a);var_dump($stripeacc);exit; - dol_syslog("Try to create card dataforcard = ".json_encode($dataforcard)); + dol_syslog("Try to create card with dataforcard = ".json_encode($dataforcard)); try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $card = $cu->sources->create($dataforcard); + if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + { + $card = $cu->sources->create($dataforcard); + } + else + { + // TODO + dol_syslog("Error: This case is not supported", LOG_ERR); + } } else { - $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + { + $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + } + else + { + // TODO + dol_syslog("Error: This case is not supported", LOG_ERR); + } } if ($card) From cc5c6c0c76a7b8cef8ae69b842dde8ba4f171dc6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 19:09:02 +0000 Subject: [PATCH 167/233] Fixing style errors. --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 28a1a54e2ad..bce3b9dc083 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -889,7 +889,7 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT { // Remove allready present info in new dash board if(!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0){ - foreach ( $boxstatItems as $boxstatItemKey => $boxstatItemHtml) { + foreach ($boxstatItems as $boxstatItemKey => $boxstatItemHtml) { if (in_array($boxstatItemKey, $globalStatInTopOpenedDashBoard)) { unset($boxstatItems[$boxstatItemKey]); } From 31094936c1ab3524c0e07ee17d1b2c91a5a2a92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 23 Sep 2019 10:56:11 +0200 Subject: [PATCH 168/233] wip --- htdocs/core/boxes/box_contracts.php | 5 ++++- htdocs/core/boxes/box_factures_fourn.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 43ade84ad20..c304800f4c1 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -84,7 +84,8 @@ class box_contracts extends ModeleBoxes $thirdpartytmp=new Societe($db); $sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; - $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; + $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; + $sql.= ", c.ref_customer, c.ref_supplier"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; @@ -117,6 +118,8 @@ class box_contracts extends ModeleBoxes $contractstatic->statut=$objp->fk_statut; $contractstatic->id=$objp->rowid; $contractstatic->ref=$objp->ref; + $contractstatic->ref_customer = $objp->ref_customer; + $contractstatic->ref_supplier = $objp->ref_supplier; $result=$contractstatic->fetch_lines(); $thirdpartytmp->name = $objp->name; diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 9d2e8e995e3..ce355f53e1e 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -87,7 +87,7 @@ class box_factures_fourn extends ModeleBoxes if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.nom as name, s.rowid as socid,"; - $sql.= " s.code_fournisseur,"; + $sql.= " s.code_fournisseur, s.email,"; $sql.= " s.logo,"; $sql.= " f.rowid as facid, f.ref, f.ref_supplier,"; $sql.= " f.total_ht,"; @@ -133,6 +133,7 @@ class box_factures_fourn extends ModeleBoxes $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; + $thirdpartytmp->email = $objp->email; $thirdpartytmp->fournisseur = 1; $thirdpartytmp->code_fournisseur = $objp->code_fournisseur; $thirdpartytmp->logo = $objp->logo; From bf9f25fd74553a6bd2962f3505233b184a9f4953 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 11:35:11 +0200 Subject: [PATCH 169/233] Ehance getPaymentIntent to use it for offline payment --- htdocs/stripe/class/stripe.class.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6379aa36746..c8a9c69a5ae 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -305,16 +305,18 @@ class Stripe extends CommonObject * @param string $currency_code Currency code * @param string $tag Tag * @param string $description Description - * @param Societe $object Object to pay with Stripe + * @param mixed $object Object to pay with Stripe * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param int $status Status (0=test, 1=live) * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt * @param int $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) + * @param string $payment_method 'pm_....' (if known) + * @param string $off_session If we use an already known payment method to pay off line. * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ - public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false) + public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0) { global $conf; @@ -335,7 +337,7 @@ class Stripe extends CommonObject } elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { $fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL; } - if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100); + if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = round($fee * 100); else $stripefee = round($fee); $paymentintent = null; @@ -411,6 +413,12 @@ class Stripe extends CommonObject // payment_method = // payment_method_types = array('card') //var_dump($dataforintent); + if ($off_session) + { + unset($dataforintent['setup_future_usage']); + $dataforintent["off_session"] = true; + } + if (! is_null($payment_method)) $dataforintent["payment_method"] = $payment_method; if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { @@ -491,7 +499,7 @@ class Stripe extends CommonObject } } - dol_syslog("getPaymentIntent return error=".$error, LOG_INFO, -1); + dol_syslog("getPaymentIntent return error=".$error." this->error=".$this->error, LOG_INFO, -1); if (! $error) { From d5877e9c36fbda0040c67e6b63befbd558eb9480 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 11:36:45 +0200 Subject: [PATCH 170/233] FIX Bad currency var used in stripe for connect --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index abc875c370f..626f5533da4 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -325,7 +325,7 @@ class Stripe extends CommonObject } elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { $fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL; } - if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100); + if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = round($fee * 100); else $stripefee = round($fee); $paymentintent = null; From 1584a4bf79b42b503e7cb39f37ebf20eba44c2e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 12:27:51 +0200 Subject: [PATCH 171/233] Add trigger event USER_SENTBYMAIL in agenda --- htdocs/core/class/events.class.php | 24 ------------------- .../mysql/data/llx_c_action_trigger.sql | 3 ++- .../install/mysql/migration/10.0.0-11.0.0.sql | 5 ++++ 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 57a076963fd..160e22f4c50 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -87,33 +87,9 @@ class Events // extends CommonObject array('id'=>'USER_NEW_PASSWORD', 'test'=>1), array('id'=>'USER_ENABLEDISABLE', 'test'=>1), array('id'=>'USER_DELETE', 'test'=>1), - /* array('id'=>'USER_SETINGROUP', 'test'=>1), deprecated. Replace with USER_MODIFY - array('id'=>'USER_REMOVEFROMGROUP', 'test'=>1), deprecated. Replace with USER_MODIFY */ array('id'=>'GROUP_CREATE', 'test'=>1), array('id'=>'GROUP_MODIFY', 'test'=>1), array('id'=>'GROUP_DELETE', 'test'=>1), - /* array('id'=>'ACTION_CREATE', 'test'=>$conf->societe->enabled), - array('id'=>'COMPANY_CREATE', 'test'=>$conf->societe->enabled), - array('id'=>'CONTRACT_VALIDATE', 'test'=>$conf->contrat->enabled), - array('id'=>'PROPAL_VALIDATE', 'test'=>$conf->propal->enabled), - array('id'=>'PROPAL_CLOSE_SIGNED', 'test'=>$conf->propal->enabled), - array('id'=>'PROPAL_CLOSE_REFUSED', 'test'=>$conf->propal->enabled), - array('id'=>'PROPAL_SENTBYMAIL', 'test'=>$conf->propal->enabled), - array('id'=>'ORDER_VALIDATE', 'test'=>$conf->commande->enabled), - array('id'=>'ORDER_SENTBYMAIL', 'test'=>$conf->commande->enabled), - array('id'=>'BILL_VALIDATE', 'test'=>$conf->facture->enabled), - array('id'=>'BILL_PAYED', 'test'=>$conf->facture->enabled), - array('id'=>'BILL_CANCEL', 'test'=>$conf->facture->enabled), - array('id'=>'BILL_SENTBYMAIL', 'test'=>$conf->facture->enabled), - array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled), - array('id'=>'PAYMENT_SUPPLIER_CREATE','test'=>$conf->fournisseur->enabled), - array('id'=>'MEMBER_CREATE', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_VALIDATE', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_SUBSCRIPTION', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_MODIFY', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_RESILIATE', 'test'=>$conf->adherent->enabled), - array('id'=>'MEMBER_DELETE', 'test'=>$conf->adherent->enabled), - */ ); diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index aaa96e3136a..0e2a1875e21 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -113,12 +113,13 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167); --- actions not enabled by default (no constant created for that) when we enable module agenda +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',41); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',23); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',140); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142); +-- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...) insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 92dcdce1128..890411109f9 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -33,6 +33,11 @@ ALTER TABLE llx_account_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL ALTER TABLE llx_expensereport ADD COLUMN paid smallint default 0 NOT NULL; UPDATE llx_expensereport set paid = 1 WHERE fk_statut = 6 and paid = 0; + +-- For v11 + +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); + create table llx_entrepot_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, From 8ac0383fa020b029365cb6e12de68de35bb4a481 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 12:36:12 +0200 Subject: [PATCH 172/233] FIX Send email from expense report card. FIX Alias name is not into the email recipient label. --- htdocs/core/actions_sendmails.inc.php | 54 +++++++++++---------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 836652ea819..de3a43d9ce6 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -113,8 +113,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO { $result=$object->fetch($id); - $sendtosocid=0; // Thirdparty on object - if (method_exists($object, "fetch_thirdparty") && ! in_array($object->element, array('societe','member','user','expensereport', 'contact'))) + $sendtosocid=0; // Id of related thirdparty + if (method_exists($object, "fetch_thirdparty") && ! in_array($object->element, array('societe', 'member', 'user', 'expensereport', 'contact'))) { $result=$object->fetch_thirdparty(); if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok @@ -124,7 +124,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO elseif ($object->element == 'member' || $object->element == 'user') { $thirdparty=$object; - if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; + if ($object->socid > 0) $sendtosocid=$object->socid; + } + elseif ($object->element == 'expensereport') + { + $tmpuser=new User($db); + $tmpuser->fetch($object->fk_user_author); + $thirdparty=$tmpuser; + if ($object->socid > 0) $sendtosocid=$object->socid; } elseif ($object->element == 'societe') { @@ -136,7 +143,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $contact=$object; if ($contact->id > 0) $sendtosocid=$contact->fetch_thirdparty()->id; } - else dol_print_error('', 'Use actions_sendmails.in.php for an element/object that is not supported'); + else dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported"); if (is_object($hookmanager)) { @@ -162,6 +169,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if ($receiver == '-1') $receiver=array(); else $receiver=array($receiver); } + $tmparray=array(); if (trim($_POST['sendto'])) { @@ -173,22 +181,23 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO foreach($receiver as $key=>$val) { // Recipient was provided from combo list - if ($val == 'thirdparty') // Id of third party + if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too) { - $tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>'; + $tmparray[] = dol_string_nospecial($thirdparty->getFullName($langs), ' ', array(",")).' <'.$thirdparty->email.'>'; } // Recipient was provided from combo list - elseif ($val == 'contact') // Id of contact + elseif ($val == 'contact') // Key selected means current contact { - $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; + $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; } - elseif ($val) // Id du contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; } } } + if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { $receiveruser=$_POST['receiveruser']; @@ -222,16 +231,16 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO foreach($receivercc as $key=>$val) { // Recipient was provided from combo list - if ($val == 'thirdparty') // Id of third party + if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too) { $tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>'; } // Recipient was provided from combo list - elseif ($val == 'contact') // Id of contact + elseif ($val == 'contact') // Key selected means current contact { $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; } - elseif ($val) // Id du contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? @@ -414,27 +423,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $result=$mailfile->sendfile(); if ($result) { - // Two hooks are available into method $mailfile->sendfile, so dedicated code is no more required - /* - if (! empty($conf->dolimail->enabled)) - { - $mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ? - if ($mid) - { - // set imap flag answered if it is an answered mail - $dolimail=new DoliMail($db); - $dolimail->id = $mid; - $res=$dolimail->set_prop($user, 'answered',1); - } - if ($imap==1) - { - // write mail to IMAP Server - $movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile); - if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs'); - else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings'); - } - }*/ - // Initialisation of datas of object to call trigger if (is_object($object)) { From 40f75b16d8fdb81a89266799846072f7b8970279 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2019 13:04:22 +0200 Subject: [PATCH 173/233] FIX Substitution of __PROJECT_XXX__ not done --- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/core/actions_massactions.inc.php | 4 ++ htdocs/core/lib/functions.lib.php | 46 ++++++++++++------- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c3b698d3918..a52bdee82cc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -676,7 +676,7 @@ class ActionComm extends CommonObject $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->contactid = $obj->fk_contact; // To have fetch_contact method working - $this->fk_project = $obj->fk_project; // To have fetch_project method working + $this->fk_project = $obj->fk_project; // To have fetch_projet method working $this->societe->id = $obj->fk_soc; // deprecated //$this->contact->id = $obj->fk_contact; // deprecated diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index d54d2dd02ff..6cd98f00e48 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -384,6 +384,10 @@ if (! $error && $massaction == 'confirm_presend') foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object { // Make substitution in email content + if (! empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) + { + $objecttmp->fetch_projet(); + } $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); $substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ', array_keys($listofqualifiedobj)) : $objecttmp->id); $substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b6b691117a5..268b206919c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3831,6 +3831,8 @@ function dol_print_error($db = '', $error = '', $errors = null) if (empty($dolibarr_main_prod)) print $out; else { + print 'This website is currently temporarly offline. This may be due to a maintenance operation. Current status of operation are on next line...

'."\n"; + $langs->load("errors"); print $langs->trans("DolibarrHasDetectedError").'. '; print $langs->trans("YouCanSetOptionDolibarrMainProdToZero"); define("MAIN_CORE_ERROR", 1); @@ -3859,7 +3861,7 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = $now=dol_now(); print '