From 19ce0b0d89d21533e8c2c78f85c5c8be5bc718f8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 3 Mar 2017 06:22:12 +0100 Subject: [PATCH 01/65] Fix : Language & revert a description of the function --- htdocs/accountancy/admin/index.php | 4 ++-- htdocs/langs/en_US/accountancy.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 8f023432727..85c290eef7f 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -301,7 +301,7 @@ print '
transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")); +print $langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")); print '
'; print ''; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 1b1032804f6..85b7b60c01b 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -107,7 +107,7 @@ ACCOUNTING_LENGTH_DESCRIPTION=Truncate product & services description in listing ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Truncate product & services account description form in listings after x chars (Best = 50) ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounting accounts -ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disabled by default. If set to on, you must also set the 2 following parameters (or it is ignored) +ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disabled by default. If set to on, you must not set the 2 following parameters. This function adds real zero while the 2 following functions add virtual zero. BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account ACCOUNTING_SELL_JOURNAL=Sell journal From 840408c1d21f6895c821b78c62a7bd7090c461aa Mon Sep 17 00:00:00 2001 From: tarrsalah Date: Sun, 5 Mar 2017 12:34:22 +0100 Subject: [PATCH 02/65] Fix the remainder to pay amount (#6486) The commit fix the remainder to pay amount (`$restapayer` value) in a supplier invoice card. --- htdocs/fourn/facture/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ffdaa8924aa..afd36862fde 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2411,6 +2411,8 @@ else print $langs->trans('AlreadyPaid'); print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' '; + $totalpaye = $object->getSommePaiement(); + $resteapayer = $object->total_ttc - $totalpaye; $resteapayeraffiche = $resteapayer; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; From bc7f4f30314ea9e6a803c878b06dc04d88dbbfe2 Mon Sep 17 00:00:00 2001 From: tarrsalah Date: Mon, 6 Mar 2017 09:02:01 +0100 Subject: [PATCH 03/65] No need to recalculate $totalpaye. --- htdocs/fourn/facture/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index afd36862fde..4d9e2521dd7 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2411,7 +2411,6 @@ else print $langs->trans('AlreadyPaid'); print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' '; - $totalpaye = $object->getSommePaiement(); $resteapayer = $object->total_ttc - $totalpaye; $resteapayeraffiche = $resteapayer; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; From f291e1c47051908e9ea7ffbcc8a356567359a005 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Mar 2017 12:30:59 +0100 Subject: [PATCH 04/65] Fix test on qty for stock move --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index dee344b6a5b..40ebb215250 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -277,7 +277,7 @@ class MouvementStock extends CommonObject // Check if stock is enough when qty is < 0 // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. - if ($qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) + if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { if (! empty($conf->productbatch->enabled) && $product->hasbatch() && ! $skip_batch) { From c260325863f1e9e902cdfbcc96a3999e9e6bde7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Mar 2017 12:32:07 +0100 Subject: [PATCH 05/65] Lang not loaded --- htdocs/product/stock/class/mouvementstock.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 40ebb215250..631f6697c33 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -292,6 +292,7 @@ class MouvementStock extends CommonObject } if (! $foundforbatch || $qtyisnotenough) { + $langs->load("stocks"); $this->error = $langs->trans('qtyToTranferLotIsNotEnough'); $this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough'); $this->db->rollback(); @@ -302,6 +303,7 @@ class MouvementStock extends CommonObject { if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) { + $langs->load("stocks"); $this->error = $langs->trans('qtyToTranferIsNotEnough'); $this->errors[] = $langs->trans('qtyToTranferIsNotEnough'); $this->db->rollback(); From d38818ff11af27821502c58e2b0cc7fad9b1d8b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Mar 2017 12:58:38 +0100 Subject: [PATCH 06/65] Fix option PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS not correctly supported. --- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d54a477aeee..736cb8340d3 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1774,7 +1774,7 @@ elseif (! empty($object->id)) $morehtmlref.='
'; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref.=''; $morehtmlref.='
'; } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ffdaa8924aa..4bb3346b375 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2010,7 +2010,7 @@ else $morehtmlref.='
'; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref.=''; $morehtmlref.='
'; } else { From b37827944089c9963f6eee1c0bcecb0ccc7e5b4d Mon Sep 17 00:00:00 2001 From: Quentin Vial-Gouteyron Date: Mon, 6 Mar 2017 15:50:17 +0100 Subject: [PATCH 07/65] New_filter_to_add_draft_order_to_validated_one --- htdocs/product/stock/replenish.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index c050acc7663..2f8a9ba39b4 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -53,6 +53,8 @@ $type = GETPOST('type','int'); $tobuy = GETPOST('tobuy', 'int'); $salert = GETPOST('salert', 'alpha'); $mode = GETPOST('mode','alpha'); +$draftorder = GETPOST('draftorder','alpha'); + $fourn_id = GETPOST('fourn_id','int'); $fk_supplier = GETPOST('fk_supplier','int'); @@ -96,7 +98,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $snom = ''; $sal = ''; $salert = ''; + $draftorder=''; } +if($draftorder == 'on') $draftchecked = "checked"; // Create orders if ($action == 'order' && isset($_POST['valid'])) @@ -438,6 +442,7 @@ print ''; print ''; print ''; print ''; +print ''; print ''; print '
'; print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); @@ -450,10 +455,11 @@ print ''; $param = (isset($type)? '&type=' . $type : ''); -$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert; +$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert . '&draftorder='.$draftorder; $param .= '&sref=' . $sref; $param .= '&mode=' . $mode; $param .= '&fk_supplier=' . $fk_supplier; @@ -534,7 +541,7 @@ if (!empty($conf->service->enabled) && $type == 1) print ' '; print ' '; print '' . $langs->trans('AlertOnly') . ' '; -print ' '; +print '' . $langs->trans('Draft') . ' '; print ' '; print ''; $searchpitco=$form->showFilterAndCheckAddButtons(0); @@ -584,7 +591,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) } // Force call prod->load_stats_xxx to choose status to count (otherwise it is loaded by load_stock function) - $result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4'); + if(isset($draftchecked)){ + $result=$prod->load_stats_commande_fournisseur(0,'0,1,2,3,4'); + }else { + $result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4'); + } + $result=$prod->load_stats_reception(0,'4'); //print $prod->stats_commande_fournisseur['qty'].'
'."\n"; @@ -671,11 +683,12 @@ print ''; if ($num > $conf->liste_limit) { - if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) + if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alpha')) { $filters = '&sref=' . $sref . '&snom=' . $snom; $filters .= '&sall=' . $sall; $filters .= '&salert=' . $salert; + $filters .= '&draftorder=' . $draftorder; $filters .= '&mode=' . $mode; $filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_entrepot=' . $fk_entrepot; @@ -687,6 +700,7 @@ if ($num > $conf->liste_limit) $filters .= '&fourn_id=' . $fourn_id; $filters .= (isset($type)? '&type=' . $type : ''); $filters .= '&salert=' . $salert; + $filters .= '&draftorder=' . $draftorder; $filters .= '&mode=' . $mode; $filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_entrepot=' . $fk_entrepot; From 6e0589ce2c756c0ea283520662909709fc4cc72e Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 7 Mar 2017 10:55:17 +0100 Subject: [PATCH 08/65] FIX : load multicurrency informations on supplier order and bill lines fetch --- .../class/fournisseur.commande.class.php | 57 ++++++++++--------- .../fourn/class/fournisseur.facture.class.php | 5 ++ 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b2f2d3dc3c3..98ed0957b4e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2752,7 +2752,8 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,'; $sql.= ' cd.total_localtax1, cd.total_localtax2,'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc,'; - $sql.= ' cd.date_start, cd.date_end, cd.fk_unit'; + $sql.= ' cd.date_start, cd.date_end, cd.fk_unit,'; + $sql.= ' cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid'; $sql.= ' WHERE cd.rowid = '.$rowid; @@ -2760,33 +2761,37 @@ class CommandeFournisseurLigne extends CommonOrderLine if ($result) { $objp = $this->db->fetch_object($result); - $this->rowid = $objp->rowid; - $this->fk_commande = $objp->fk_commande; - $this->desc = $objp->description; - $this->qty = $objp->qty; - $this->subprice = $objp->subprice; - $this->tva_tx = $objp->tva_tx; - $this->localtax1_tx = $objp->localtax1_tx; - $this->localtax2_tx = $objp->localtax2_tx; - $this->remise = $objp->remise; - $this->remise_percent = $objp->remise_percent; - $this->fk_product = $objp->fk_product; - $this->info_bits = $objp->info_bits; - $this->total_ht = $objp->total_ht; - $this->total_tva = $objp->total_tva; - $this->total_localtax1 = $objp->total_localtax1; - $this->total_localtax2 = $objp->total_localtax2; - $this->total_ttc = $objp->total_ttc; - $this->product_type = $objp->product_type; + $this->rowid = $objp->rowid; + $this->fk_commande = $objp->fk_commande; + $this->desc = $objp->description; + $this->qty = $objp->qty; + $this->subprice = $objp->subprice; + $this->tva_tx = $objp->tva_tx; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->remise = $objp->remise; + $this->remise_percent = $objp->remise_percent; + $this->fk_product = $objp->fk_product; + $this->info_bits = $objp->info_bits; + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_localtax1 = $objp->total_localtax1; + $this->total_localtax2 = $objp->total_localtax2; + $this->total_ttc = $objp->total_ttc; + $this->product_type = $objp->product_type; - $this->ref = $objp->product_ref; - $this->product_libelle = $objp->product_libelle; - $this->product_desc = $objp->product_desc; - - $this->date_start = $this->db->jdate($objp->date_start); - $this->date_end = $this->db->jdate($objp->date_end); - $this->fk_unit = $objp->fk_unit; + $this->ref = $objp->product_ref; + $this->product_libelle = $objp->product_libelle; + $this->product_desc = $objp->product_desc; + $this->date_start = $this->db->jdate($objp->date_start); + $this->date_end = $this->db->jdate($objp->date_end); + $this->fk_unit = $objp->fk_unit; + + $this->multicurrency_total_ht = $objp->multicurrency_total_ht; + $this->multicurrency_total_tva = $objp->multicurrency_total_tva; + $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $this->db->free($result); return 1; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 27b7627f450..b76fb6a0e45 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2078,6 +2078,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 '; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; + $sql.= ', f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid'; $sql.= ' WHERE f.rowid = '.$rowid; @@ -2130,6 +2131,10 @@ class SupplierInvoiceLine extends CommonObjectLine $this->rang = $obj->rang; $this->fk_unit = $obj->fk_unit; + $this->multicurrency_total_ht = $obj->multicurrency_total_ht; + $this->multicurrency_total_tva = $obj->multicurrency_total_tva; + $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + return 1; } From b192b6cd507e32c959a7aa4ce410473a6d5329aa Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 7 Mar 2017 11:33:18 +0100 Subject: [PATCH 09/65] FIX : multicurrency_subprice --- htdocs/fourn/class/fournisseur.commande.class.php | 3 ++- htdocs/fourn/class/fournisseur.facture.class.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 98ed0957b4e..cc833fc72ce 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2753,7 +2753,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql.= ' cd.total_localtax1, cd.total_localtax2,'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc,'; $sql.= ' cd.date_start, cd.date_end, cd.fk_unit,'; - $sql.= ' cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc'; + $sql.= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid'; $sql.= ' WHERE cd.rowid = '.$rowid; @@ -2788,6 +2788,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->date_end = $this->db->jdate($objp->date_end); $this->fk_unit = $objp->fk_unit; + $this->multicurrency_subprice = $objp->multicurrency_subprice; $this->multicurrency_total_ht = $objp->multicurrency_total_ht; $this->multicurrency_total_tva = $objp->multicurrency_total_tva; $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b76fb6a0e45..20f68f52d65 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2078,7 +2078,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 '; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; - $sql.= ', f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc'; + $sql.= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid'; $sql.= ' WHERE f.rowid = '.$rowid; @@ -2131,6 +2131,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->rang = $obj->rang; $this->fk_unit = $obj->fk_unit; + $this->multicurrency_subprice = $obj->multicurrency_subprice; $this->multicurrency_total_ht = $obj->multicurrency_total_ht; $this->multicurrency_total_tva = $obj->multicurrency_total_tva; $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; From 9eb39758034a25c9e3b17fc7526006ff6212d845 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 7 Mar 2017 15:18:20 +0100 Subject: [PATCH 10/65] FIX : forgotten fk_facture_fourn attribute on supplierinvoice line object --- htdocs/fourn/class/fournisseur.facture.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 27b7627f450..af009e7ca11 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2076,7 +2076,7 @@ class SupplierInvoiceLine extends CommonObjectLine { $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx'; $sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 '; - $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; + $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid'; @@ -2098,6 +2098,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->id = $obj->rowid; $this->rowid = $obj->rowid; + $this->fk_facture_fourn = $obj->fk_facture_fourn; $this->description = $obj->description; $this->product_ref = $obj->product_ref; $this->ref = $obj->product_ref; From 72606a6fa65dc18e42c621cbccc76aec02d222e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Mar 2017 15:46:47 +0100 Subject: [PATCH 11/65] Fix english --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 85cf85ece96..64faedeb8b6 100644 --- a/README.md +++ b/README.md @@ -81,14 +81,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Standing orders management (European SEPA) - Bank accounts management - Shared calendar/agenda (with ical and vcal export for third party tools integration) -- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...) +- Opportunities and/or project management - Projects management - Contracts management - Stock management - Shipping management - Interventions management - Employee's leave requests management -- Expense report management +- Expense reports +- Timesheets - Electronic Document Management (EDM) - Foundations members management - Mass emailing From fd0a46c5cfa1b011fe0a1c99e271aafcf5f9c5de Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 7 Mar 2017 22:31:34 +0100 Subject: [PATCH 12/65] New : add donations statistics in home statistics --- htdocs/core/modules/modDon.class.php | 2 +- htdocs/don/class/don.class.php | 35 +++++++++++++++++++++++++++- htdocs/index.php | 24 ++++++++++++------- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index f69cb1b5331..26dd397c913 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -32,7 +32,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** * Class to describe and enable module Donation */ -class modDon extends DolibarrModules +class modDon extends DolibarrModules { /** diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index d7e4d84baab..74349a16271 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -804,6 +804,39 @@ class Don extends CommonObject return $result; } + /** + * Charge indicateurs this->nb pour le tableau de bord + * + * @return int <0 if KO, >0 if OK + */ + function load_state_board() + { + global $conf; + + $this->nb=array(); + + $sql = "SELECT count(d.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as d"; + $sql.= " WHERE d.fk_statut > 0"; + $sql.= " AND d.entity IN (".getEntity('don', 1).")"; + + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nb["donations"]=$obj->nb; + } + $this->db->free($resql); + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } /** * Return clicable name (with picto eventually) diff --git a/htdocs/index.php b/htdocs/index.php index eab8844b960..21210904abb 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -159,7 +159,8 @@ if (empty($user->societe_id)) ! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), ! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), ! empty($conf->projet->enabled) && $user->rights->projet->lire, - ! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire + ! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, + ! empty($conf->don->enabled) && $user->rights->don->lire ); // Class file containing the method load_state_board for each line $includes=array( @@ -180,7 +181,8 @@ if (empty($user->societe_id)) DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php", DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php", DOL_DOCUMENT_ROOT."/projet/class/project.class.php", - DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php" + DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", + DOL_DOCUMENT_ROOT."/don/class/don.class.php" ); // Name class containing the method load_state_board for each line $classes=array('User', @@ -200,7 +202,8 @@ if (empty($user->societe_id)) 'FactureFournisseur', 'SupplierProposal', 'Project', - 'ExpenseReport' + 'ExpenseReport', + 'Don' ); // Cle array returned by the method load_state_board for each line $keys=array('users', @@ -220,7 +223,8 @@ if (empty($user->societe_id)) 'supplier_invoices', 'askprice', 'projects', - 'expensereports' + 'expensereports', + 'donations' ); // Dashboard Icon lines $icons=array('user', @@ -240,7 +244,8 @@ if (empty($user->societe_id)) 'bill', 'propal', 'project', - 'trip' + 'trip', + 'generic' ); // Translation keyword $titres=array("Users", @@ -260,7 +265,8 @@ if (empty($user->societe_id)) "SuppliersInvoices", "SupplierProposalShort", "Projects", - "ExpenseReports" + "ExpenseReports", + "Donations" ); // Dashboard Link lines $links=array( @@ -281,7 +287,8 @@ if (empty($user->societe_id)) DOL_URL_ROOT.'/fourn/facture/list.php', DOL_URL_ROOT.'/supplier_proposal/list.php', DOL_URL_ROOT.'/projet/list.php?mainmenu=project', - DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm' + DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm', + DOL_URL_ROOT.'/don/list.php?leftmenu=donations' ); // Translation lang files $langfile=array("users", @@ -301,7 +308,8 @@ if (empty($user->societe_id)) "bills", "supplier_proposal", "projects", - "trips" + "trips", + "donations" ); From 76e55fcdb1ec51c7d12623960aa91aa953b15802 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 8 Mar 2017 09:06:38 +0100 Subject: [PATCH 13/65] NEW :hidden Easter egg to display commitstrip strip on login page --- htdocs/core/tpl/login.tpl.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 3772b44c9fc..ba501e802dd 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -239,6 +239,18 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
global->MAIN_EASTER_EGG_COMMITSTRIP)) { + if (substr($langs->defaultlang,0,2)=='fr') { + $xml = simplexml_load_file("http://www.commitstrip.com/fr/feed/"); + } else { + $xml = simplexml_load_file("http://www.commitstrip.com/en/feed/"); + } + + $little = $xml->channel->item[0]->children('content',true); + + print $little->encoded; +} + ?> Date: Thu, 9 Mar 2017 08:12:45 +0100 Subject: [PATCH 14/65] fix typo in Issue tracker URL --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 690b00211f7..02d21453a3a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,7 +6,7 @@ Bug reports and feature requests *Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum). -Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues). +Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues). 1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem. 2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request. From 9b10c9f6d15cda7896d8ce0ea4402b1187ad1154 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 10 Mar 2017 09:19:42 +0100 Subject: [PATCH 15/65] FIX : Can use quote into supplier ref on order line add --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b2f2d3dc3c3..322f06d58e1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1457,7 +1457,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ", '".$localtax1_type."',"; $sql.= " '".$localtax2_type."'"; - $sql.= ", ".$remise_percent.",'".price2num($subprice,'MU')."','".$ref."',"; + $sql.= ", ".$remise_percent.",'".price2num($subprice,'MU')."','".$this->db->escape($ref)."',"; $sql.= "'".price2num($total_ht)."',"; $sql.= "'".price2num($total_tva)."',"; $sql.= "'".price2num($total_localtax1)."',"; From 8389db18bf7de7b5b4219b1f9d7bd7712e7ce5b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 10:07:09 +0100 Subject: [PATCH 16/65] Fix solution for comaptibility --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6340facf31a..2fc6d22fd62 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1223,7 +1223,7 @@ abstract class CommonObject * @param int $id To force other object id (should not be used) * @param string $format Data format ('text', 'date'). 'text' is used if not defined * @param string $id_field To force rowid field name. 'rowid' is used if not defined - * @param User|string $user Update last update fields also if user object provided + * @param User|string $user Update last update fields also if user object provided. If not provided, current user is used. * @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY') * @return int <0 if KO, >0 if OK */ @@ -1247,7 +1247,7 @@ abstract class CommonObject if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'"; else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value); else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null"); - if (is_object($user)) $sql.=", fk_user_modif = ".$user->id; + if (empty($user) && is_object($user)) $sql.=", fk_user_modif = ".$user->id; $sql.= " WHERE ".$id_field." = ".$id; dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); From 567639397ecfdede34d8e31f4c63f8aee41e592e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 10:55:35 +0100 Subject: [PATCH 17/65] Fix Must use tdoverflowmax100 instead of tdoverflow --- htdocs/core/boxes/box_services_expired.php | 14 ++++++++------ htdocs/core/boxes/modules_boxes.php | 2 +- htdocs/theme/eldy/style.css.php | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index f2bc86cdac5..90f36ef6d30 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -83,6 +83,8 @@ class box_services_expired extends ModeleBoxes $i = 0; + $thirdpartytmp = new Societe($this->db); + while ($i < $num) { $late=''; @@ -100,13 +102,13 @@ class box_services_expired extends ModeleBoxes 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); - $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', - 'logo' => 'company', - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); + $thirdpartytmp->id = $objp->socid; + $thirdpartytmp->name = $objp->name; - $this->info_box_contents[$i][3] = array('td' => 'class="tdoverflow maxwidth100onsmartphone" align="left"', - 'text' => $objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); + $this->info_box_contents[$i][2] = array('td' => 'class="tdoverflowmax100 maxwidth100onsmartphone" align="left"', + 'text' => $thirdpartytmp->getNomUrl(1, 'customer'), + 'asis' => 1 + ); $this->info_box_contents[$i][4] = array('td' => 'align="center"', 'text' => dol_print_date($dateline,'day'), diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 0f754682925..566da25aad3 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -243,7 +243,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" $out.= '>'; if ($conf->use_javascript_ajax) { - $out.= '
'; + $out.= ''; + + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue; + // Param $label = $langs->trans($key); print ''; // Value print ''; + print ''; } diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 6778f618265..e9d38ad3776 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index bb704ba5c2e..8ec0713b01a 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -116,8 +116,9 @@ function length_accountg($account) if ($account < 0 || empty($account)) return ''; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; + $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; - if (! empty($g)) { // Clean parameters $i = strlen($account); @@ -150,8 +151,9 @@ function length_accounta($accounta) if ($accounta < 0 || empty($accounta)) return ''; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; + $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; - if (! empty($a)) { // Clean parameters $i = strlen($accounta); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 85b7b60c01b..5a9e63ef4d9 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -105,9 +105,9 @@ ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin the sorting of the page "Binding don ACCOUNTING_LENGTH_DESCRIPTION=Truncate product & services description in listings after x chars (Best = 50) ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Truncate product & services account description form in listings after x chars (Best = 50) -ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts -ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounting accounts -ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disabled by default. If set to on, you must not set the 2 following parameters. This function adds real zero while the 2 following functions add virtual zero. +ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts (If you set value to 6 here, the account '706' will appear like '706000' on screen) +ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounting accounts (If you set value to 6 here, the account '401' will appear like '401000' on screen) +ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zero at the end of an accounting account. Needed by some countries (like switzerland). If keep to off (default), you can set the 2 following parameters to ask application to add virtual zero. BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account ACCOUNTING_SELL_JOURNAL=Sell journal From e5fc1583c7b89b19a603d7a04a1bc08742f523ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 12:05:42 +0100 Subject: [PATCH 21/65] Fix No external access without using getUrlContent function. --- htdocs/core/tpl/login.tpl.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index ba501e802dd..e0aa28ce2d6 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -239,16 +239,21 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file global->MAIN_EASTER_EGG_COMMITSTRIP)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; if (substr($langs->defaultlang,0,2)=='fr') { - $xml = simplexml_load_file("http://www.commitstrip.com/fr/feed/"); + $resgetcommitstrip = getURLContent("http://www.commitstrip.com/fr/feed/"); } else { - $xml = simplexml_load_file("http://www.commitstrip.com/en/feed/"); + $resgetcommitstrip = getURLContent("http://www.commitstrip.com/en/feed/"); } - - $little = $xml->channel->item[0]->children('content',true); - - print $little->encoded; + if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200') + { + $xml = simplexml_load_string($resgetcommitstrip['content']); + $little = $xml->channel->item[0]->children('content',true); + print $little->encoded; + } } ?> From bf345430859756d2f8c778904c8e4279a61485b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 12:19:50 +0100 Subject: [PATCH 22/65] FIX #6443 --- htdocs/core/lib/files.lib.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index f0cab58bb09..2607f4b2c58 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2304,17 +2304,32 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu // Define $accessallowed if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg)) { - if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1; + if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported + { + dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + exit; + } + if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1; $original_file=$conf->{$reg[1]}->dir_temp.'/'.$fuser->id.'/'.$original_file; } else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg)) { - if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1; + if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported + { + dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + exit; + } + if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1; $original_file=$conf->{$reg[1]}->dir_temp.'/'.$original_file; } else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg)) { - if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1; + if (empty($conf->{$reg[1]}->dir_output)) // modulepart not supported + { + dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + exit; + } + if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1; $original_file=$conf->{$reg[1]}->dir_output.'/'.$fuser->id.'/'.$original_file; } else From 50044ed21ecf129e3a4b5e60fa3aecd672bd047a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 12:45:56 +0100 Subject: [PATCH 23/65] FIX #6499 --- .../core/class/commondocgenerator.class.php | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 75336e2a291..0e884f87d0d 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -304,11 +304,13 @@ abstract class CommonDocGenerator $now=dol_now('gmt'); // gmt $array_other = array( - 'current_date'=>dol_print_date($now,'day','tzuser'), - 'current_datehour'=>dol_print_date($now,'dayhour','tzuser'), + // Date in default language + 'current_date'=>dol_print_date($now,'day','tzuser'), + 'current_datehour'=>dol_print_date($now,'dayhour','tzuser'), 'current_server_date'=>dol_print_date($now,'day','tzserver'), 'current_server_datehour'=>dol_print_date($now,'dayhour','tzserver'), - 'current_date_locale'=>dol_print_date($now,'day','tzuser',$outputlangs), + // Date in requested output language + 'current_date_locale'=>dol_print_date($now,'day','tzuser',$outputlangs), 'current_datehour_locale'=>dol_print_date($now,'dayhour','tzuser',$outputlangs), 'current_server_date_locale'=>dol_print_date($now,'day','tzserver',$outputlangs), 'current_server_datehour_locale'=>dol_print_date($now,'dayhour','tzserver',$outputlangs), @@ -350,6 +352,7 @@ abstract class CommonDocGenerator $array_key.'_ref_customer'=>$object->ref_client, $array_key.'_ref_supplier'=>(! empty($object->ref_fournisseur)?$object->ref_fournisseur:''), $array_key.'_source_invoice_ref'=>$invoice_source->ref, + // Dates $array_key.'_hour'=>dol_print_date($object->date,'hour'), $array_key.'_date'=>dol_print_date($object->date,'day'), $array_key.'_date_rfc'=>dol_print_date($object->date,'dayrfc'), @@ -360,6 +363,7 @@ abstract class CommonDocGenerator $array_key.'_date_validation'=>(! empty($object->date_validation)?dol_print_date($object->date_validation,'dayhour'):''), $array_key.'_date_delivery_planed'=>(! empty($object->date_livraison)?dol_print_date($object->date_livraison,'day'):''), $array_key.'_date_close'=>(! empty($object->date_cloture)?dol_print_date($object->date_cloture,'dayhour'):''), + $array_key.'_payment_mode_code'=>$object->mode_reglement_code, $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement), $array_key.'_payment_term_code'=>$object->cond_reglement_code, @@ -444,10 +448,14 @@ abstract class CommonDocGenerator 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), - 'line_date_start'=>$line->date_start, - 'line_date_start_rfc'=>dol_print_date($line->date_start,'dayrfc'), - 'line_date_end'=>$line->date_end, - 'line_date_end_rfc'=>dol_print_date($line->date_end,'dayrfc') + 'line_date_start'=>dol_print_date($line->date_start, 'day', 'tzuser'), + 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzuser', $outputlangs), + 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser'), + 'line_date_start_rfc_locale'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser', $outputlangs), + 'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'), + 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs), + 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'), + 'line_date_end_rfc_locale'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser', $outputlangs) ); // Retrieve extrafields From de2558c9075605aea5bbbef82c55866315f4c323 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 12:47:31 +0100 Subject: [PATCH 24/65] Fix useless lines --- htdocs/core/class/commondocgenerator.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 0e884f87d0d..f338aca7be8 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -448,14 +448,13 @@ abstract class CommonDocGenerator 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), + // Dates 'line_date_start'=>dol_print_date($line->date_start, 'day', 'tzuser'), 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzuser', $outputlangs), 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser'), - 'line_date_start_rfc_locale'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser', $outputlangs), 'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'), 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs), 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'), - 'line_date_end_rfc_locale'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser', $outputlangs) ); // Retrieve extrafields From 1610926ccd0c740d8e5eeea067bf66d302644cde Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 13:11:12 +0100 Subject: [PATCH 25/65] Fix remove a line that look useless --- htdocs/core/lib/files.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 13d458f4047..4df92d3da4e 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1935,7 +1935,8 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->$modulepart->dir_output.'/'.$original_file; } } - if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen + + //if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen if ($fuser->admin) $accessallowed=1; // If user is admin // For modules who wants to manage different levels of permissions for documents From 3f69b1fdf5c32c8b64b557196bb127e64d950492 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 13:14:02 +0100 Subject: [PATCH 26/65] Revert "Fix remove a line that look useless" This reverts commit 1610926ccd0c740d8e5eeea067bf66d302644cde. --- htdocs/core/lib/files.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 4df92d3da4e..13d458f4047 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1935,8 +1935,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->$modulepart->dir_output.'/'.$original_file; } } - - //if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen + if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen if ($fuser->admin) $accessallowed=1; // If user is admin // For modules who wants to manage different levels of permissions for documents From 1a57d1864a048bd1ce289b494997f23d54e2c9f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 13:39:11 +0100 Subject: [PATCH 27/65] FIX #6443 --- htdocs/core/lib/files.lib.php | 146 ++++++++++++++++------------------ 1 file changed, 67 insertions(+), 79 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 2607f4b2c58..337b0fdc460 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1803,120 +1803,122 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu // find the subdirectory name as the reference if (empty($refname)) $refname=basename(dirname($original_file)."/"); + $relative_original_file = $original_file; + // Wrapping for some images - if ($modulepart == 'companylogo') + if ($modulepart == 'companylogo' && !empty($conf->mycompany->dir_output)) { $accessallowed=1; $original_file=$conf->mycompany->dir_output.'/logos/'.$original_file; } // Wrapping for users photos - elseif ($modulepart == 'userphoto') + elseif ($modulepart == 'userphoto' && !empty($conf->user->dir_output)) { $accessallowed=1; $original_file=$conf->user->dir_output.'/'.$original_file; } // Wrapping for members photos - elseif ($modulepart == 'memberphoto') + elseif ($modulepart == 'memberphoto' && !empty($conf->adherent->dir_output)) { $accessallowed=1; $original_file=$conf->adherent->dir_output.'/'.$original_file; } // Wrapping pour les apercu factures - elseif ($modulepart == 'apercufacture') + elseif ($modulepart == 'apercufacture' && !empty($conf->facture->dir_output)) { if ($fuser->rights->facture->lire) $accessallowed=1; $original_file=$conf->facture->dir_output.'/'.$original_file; } // Wrapping pour les apercu propal - elseif ($modulepart == 'apercupropal') + elseif ($modulepart == 'apercupropal' && !empty($conf->propal->dir_output)) { if ($fuser->rights->propale->lire) $accessallowed=1; $original_file=$conf->propal->dir_output.'/'.$original_file; } // Wrapping pour les apercu commande - elseif ($modulepart == 'apercucommande') + elseif ($modulepart == 'apercucommande' && !empty($conf->commande->dir_output)) { if ($fuser->rights->commande->lire) $accessallowed=1; $original_file=$conf->commande->dir_output.'/'.$original_file; } // Wrapping pour les apercu intervention - elseif ($modulepart == 'apercufichinter') + elseif ($modulepart == 'apercufichinter' && !empty($conf->ficheinter->dir_output)) { if ($fuser->rights->ficheinter->lire) $accessallowed=1; $original_file=$conf->ficheinter->dir_output.'/'.$original_file; } // Wrapping pour les images des stats propales - elseif ($modulepart == 'propalstats') + elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp)) { if ($fuser->rights->propale->lire) $accessallowed=1; $original_file=$conf->propal->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats commandes - elseif ($modulepart == 'orderstats') + elseif ($modulepart == 'orderstats' && !empty($conf->commande->dir_temp)) { if ($fuser->rights->commande->lire) $accessallowed=1; $original_file=$conf->commande->dir_temp.'/'.$original_file; } - elseif ($modulepart == 'orderstatssupplier') + elseif ($modulepart == 'orderstatssupplier' && !empty($conf->fournisseur->dir_output)) { if ($fuser->rights->fournisseur->commande->lire) $accessallowed=1; $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file; } // Wrapping pour les images des stats factures - elseif ($modulepart == 'billstats') + elseif ($modulepart == 'billstats' && !empty($conf->facture->dir_temp)) { if ($fuser->rights->facture->lire) $accessallowed=1; $original_file=$conf->facture->dir_temp.'/'.$original_file; } - elseif ($modulepart == 'billstatssupplier') + elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output)) { if ($fuser->rights->fournisseur->facture->lire) $accessallowed=1; $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file; } // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'expeditionstats') + elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp)) { if ($fuser->rights->expedition->lire) $accessallowed=1; $original_file=$conf->expedition->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'tripsexpensesstats') + elseif ($modulepart == 'tripsexpensesstats' && !empty($conf->deplacement->dir_temp)) { if ($fuser->rights->deplacement->lire) $accessallowed=1; $original_file=$conf->deplacement->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'memberstats') + elseif ($modulepart == 'memberstats' && !empty($conf->adherent->dir_temp)) { if ($fuser->rights->adherent->lire) $accessallowed=1; $original_file=$conf->adherent->dir_temp.'/'.$original_file; } // Wrapping pour les images des stats produits - elseif (preg_match('/^productstats_/i',$modulepart)) + elseif (preg_match('/^productstats_/i',$modulepart) && !empty($conf->product->dir_temp)) { if ($fuser->rights->produit->lire || $fuser->rights->service->lire) $accessallowed=1; $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file; } // Wrapping for products or services - elseif ($modulepart == 'tax') + elseif ($modulepart == 'tax' && !empty($conf->tax->dir_output)) { if ($fuser->rights->tax->charges->lire) $accessallowed=1; $original_file=$conf->tax->dir_output.'/'.$original_file; } // Wrapping for products or services - elseif ($modulepart == 'actions') + elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { if ($fuser->rights->agenda->myactions->read) $accessallowed=1; $original_file=$conf->agenda->dir_output.'/'.$original_file; } // Wrapping for categories - elseif ($modulepart == 'category') + elseif ($modulepart == 'category' && !empty($conf->categorie->dir_output)) { if ($fuser->rights->categorie->lire) $accessallowed=1; $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file; } // Wrapping pour les prelevements - elseif ($modulepart == 'prelevement') + elseif ($modulepart == 'prelevement' && !empty($conf->prelevement->dir_output)) { if ($fuser->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) { @@ -1925,19 +1927,19 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->prelevement->dir_output.'/'.$original_file; } // Wrapping pour les graph energie - elseif ($modulepart == 'graph_stock') + elseif ($modulepart == 'graph_stock' && !empty($conf->stock->dir_temp)) { $accessallowed=1; $original_file=$conf->stock->dir_temp.'/'.$original_file; } // Wrapping pour les graph fournisseurs - elseif ($modulepart == 'graph_fourn') + elseif ($modulepart == 'graph_fourn' && !empty($conf->fournisseur->dir_temp)) { $accessallowed=1; $original_file=$conf->fournisseur->dir_temp.'/'.$original_file; } // Wrapping pour les graph des produits - elseif ($modulepart == 'graph_product') + elseif ($modulepart == 'graph_product' && !empty($conf->product->dir_temp)) { $accessallowed=1; $original_file=$conf->product->multidir_temp[$entity].'/'.$original_file; @@ -1946,32 +1948,31 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu elseif ($modulepart == 'barcode') { $accessallowed=1; - // If viewimage is called for barcode, we try to output an image on the fly, - // with not build of file on disk. + // If viewimage is called for barcode, we try to output an image on the fly, with no build of file on disk. //$original_file=$conf->barcode->dir_temp.'/'.$original_file; $original_file=''; } // Wrapping pour les icones de background des mailings - elseif ($modulepart == 'iconmailing') + elseif ($modulepart == 'iconmailing' && !empty($conf->mailing->dir_temp)) { $accessallowed=1; $original_file=$conf->mailing->dir_temp.'/'.$original_file; } - // Wrapping pour les icones de background des mailings - elseif ($modulepart == 'scanner_user_temp') + // Wrapping pour le scanner + elseif ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp)) { $accessallowed=1; $original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file; } // Wrapping pour les images fckeditor - elseif ($modulepart == 'fckeditor') + elseif ($modulepart == 'fckeditor' && !empty($conf->fckeditor->dir_output)) { $accessallowed=1; $original_file=$conf->fckeditor->dir_output.'/'.$original_file; } // Wrapping for third parties - else if ($modulepart == 'company' || $modulepart == 'societe') + else if (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output)) { if ($fuser->rights->societe->lire || preg_match('/^specimen/i',$original_file)) { @@ -1982,7 +1983,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for contact - else if ($modulepart == 'contact') + else if ($modulepart == 'contact' && !empty($conf->societe->dir_output)) { if ($fuser->rights->societe->lire) { @@ -1992,7 +1993,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for invoices - else if ($modulepart == 'facture' || $modulepart == 'invoice') + else if (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->facture->dir_output)) { if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { @@ -2001,7 +2002,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->facture->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } - else if ($modulepart == 'massfilesarea_facture') + else if ($modulepart == 'massfilesarea_facture' && !empty($conf->facture->dir_output)) { if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { @@ -2010,8 +2011,8 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } - // Wrapping pour les fiches intervention - else if ($modulepart == 'ficheinter') + // Wrapping for interventions + else if (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output)) { if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) { @@ -2022,7 +2023,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les deplacements et notes de frais - else if ($modulepart == 'deplacement') + else if ($modulepart == 'deplacement' && !empty($conf->deplacement->dir_output)) { if ($fuser->rights->deplacement->lire || preg_match('/^specimen/i',$original_file)) { @@ -2032,7 +2033,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } // Wrapping pour les propales - else if ($modulepart == 'propal') + else if ($modulepart == 'propal' && !empty($conf->propal->dir_output)) { if ($fuser->rights->propale->lire || preg_match('/^specimen/i',$original_file)) { @@ -2044,7 +2045,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les commandes - else if ($modulepart == 'commande' || $modulepart == 'order') + else if (($modulepart == 'commande' || $modulepart == 'order') && !empty($conf->commande->dir_output)) { if ($fuser->rights->commande->lire || preg_match('/^specimen/i',$original_file)) { @@ -2055,7 +2056,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les projets - else if ($modulepart == 'project') + else if ($modulepart == 'project' && !empty($conf->projet->dir_output)) { if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file)) { @@ -2064,7 +2065,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } - else if ($modulepart == 'project_task') + else if ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) { if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file)) { @@ -2073,19 +2074,9 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } - // Wrapping for interventions - else if ($modulepart == 'fichinter') - { - if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->ficheinter->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; - } // Wrapping pour les commandes fournisseurs - else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') + else if (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) { if ($fuser->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file)) { @@ -2096,7 +2087,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les factures fournisseurs - else if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') + else if (($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') && !empty($conf->fournisseur->facture->dir_output)) { if ($fuser->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file)) { @@ -2107,7 +2098,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les rapport de paiements - else if ($modulepart == 'facture_paiement') + else if ($modulepart == 'facture_paiement' && !empty($conf->facture->dir_output)) { if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { @@ -2118,7 +2109,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for accounting exports - else if ($modulepart == 'export_compta') + else if ($modulepart == 'export_compta' && !empty($conf->accounting->dir_output)) { if ($fuser->rights->accounting->ventilation->dispatch || preg_match('/^specimen/i',$original_file)) { @@ -2128,7 +2119,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les expedition - else if ($modulepart == 'expedition') + else if ($modulepart == 'expedition' && !empty($conf->expedition->dir_output)) { if ($fuser->rights->expedition->lire || preg_match('/^specimen/i',$original_file)) { @@ -2138,7 +2129,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les bons de livraison - else if ($modulepart == 'livraison') + else if ($modulepart == 'livraison' && !empty($conf->livraison->dir_output)) { if ($fuser->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file)) { @@ -2148,7 +2139,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les actions - else if ($modulepart == 'actions') + else if ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { if ($fuser->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file)) { @@ -2158,7 +2149,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les actions - else if ($modulepart == 'actionsreport') + else if ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp)) { if ($fuser->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file)) { @@ -2179,7 +2170,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les contrats - else if ($modulepart == 'contract') + else if ($modulepart == 'contract' && !empty($conf->contrat->dir_output)) { if ($fuser->rights->contrat->lire || preg_match('/^specimen/i',$original_file)) { @@ -2189,7 +2180,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les dons - else if ($modulepart == 'donation') + else if ($modulepart == 'donation' && !empty($conf->donation->dir_output)) { if ($fuser->rights->don->lire || preg_match('/^specimen/i',$original_file)) { @@ -2199,7 +2190,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les remises de cheques - else if ($modulepart == 'remisecheque') + else if ($modulepart == 'remisecheque' && !empty($conf->banque->dir_output)) { if ($fuser->rights->banque->lire || preg_match('/^specimen/i',$original_file)) { @@ -2210,7 +2201,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for bank - else if ($modulepart == 'bank') + else if ($modulepart == 'bank' && !empty($conf->bank->dir_output)) { if ($fuser->rights->banque->lire) { @@ -2220,7 +2211,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for export module - else if ($modulepart == 'export') + else if ($modulepart == 'export' && !empty($conf->export->dir_temp)) { // Aucun test necessaire car on force le rep de download sur // le rep export qui est propre a l'utilisateur @@ -2229,21 +2220,21 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for import module - else if ($modulepart == 'import') + else if ($modulepart == 'import' && !empty($conf->import->dir_temp)) { $accessallowed=1; $original_file=$conf->import->dir_temp.'/'.$original_file; } // Wrapping pour l'editeur wysiwyg - else if ($modulepart == 'editor') + else if ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) { $accessallowed=1; $original_file=$conf->fckeditor->dir_output.'/'.$original_file; } // Wrapping for miscellaneous medias files - elseif ($modulepart == 'medias') + elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root)) { $accessallowed=1; global $dolibarr_main_data_root; @@ -2251,25 +2242,21 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for backups - else if ($modulepart == 'systemtools') + else if ($modulepart == 'systemtools' && !empty($conf->admin->dir_output)) { - if ($fuser->admin) - { - $accessallowed=1; - } + if ($fuser->admin) $accessallowed=1; $original_file=$conf->admin->dir_output.'/'.$original_file; } // Wrapping for upload file test - else if ($modulepart == 'admin_temp') + else if ($modulepart == 'admin_temp' && !empty($conf->admin->dir_temp)) { - if ($fuser->admin) - $accessallowed=1; + if ($fuser->admin) $accessallowed=1; $original_file=$conf->admin->dir_temp.'/'.$original_file; } // Wrapping pour BitTorrent - else if ($modulepart == 'bittorrent') + else if ($modulepart == 'bittorrent' && !empty($conf->bittorrent->dir_output)) { $accessallowed=1; $dir='files'; @@ -2278,7 +2265,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour Foundation module - else if ($modulepart == 'member') + else if ($modulepart == 'member' && !empty($conf->adherent->dir_output)) { if ($fuser->rights->adherent->lire || preg_match('/^specimen/i',$original_file)) { @@ -2288,7 +2275,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping for Scanner - else if ($modulepart == 'scanner_user_temp') + else if ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp)) { $accessallowed=1; $original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file; @@ -2301,6 +2288,9 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu // If modulepart=module Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart else { + if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a file called specimen. Test must be done before changing $original_file int full path. + if ($fuser->admin) $accessallowed=1; // If user is admin + // Define $accessallowed if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg)) { @@ -2353,8 +2343,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->$modulepart->dir_output.'/'.$original_file; } } - if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen - if ($fuser->admin) $accessallowed=1; // If user is admin // For modules who wants to manage different levels of permissions for documents $subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS'; From fbbcec2ba3e1346202c50a74a553296568270fb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 14:04:06 +0100 Subject: [PATCH 28/65] FIX #6444 --- htdocs/core/lib/files.lib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 337b0fdc460..664c2e0a03d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1066,7 +1066,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } // Security: - // On interdit fichiers caches, remontees de repertoire ainsi que les pipes dans les noms de fichiers. + // We refuse cache files/dirs, upload using .. and pipes into filenames. if (preg_match('/^\./',$src_file) || preg_match('/\.\./',$src_file) || preg_match('/[<>|]/',$src_file)) { dol_syslog("Refused to deliver file ".$src_file, LOG_WARNING); @@ -1150,6 +1150,14 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook); + // Security: + // We refuse cache files/dirs, upload using .. and pipes into filenames. + if (preg_match('/^\./',$file) || preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file)) + { + dol_syslog("Refused to delete file ".$file, LOG_WARNING); + return False; + } + if (empty($nohook)) { $hookmanager->initHooks(array('fileslib')); From 277fa7dbe16fe37fc1f3553bb844276ec4a8ac91 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 14:08:53 +0100 Subject: [PATCH 29/65] FIX #6444 --- htdocs/core/lib/files.lib.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 664c2e0a03d..c7cc2687463 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1139,6 +1139,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable * @param int $nohook Disable all hooks * @param object $object Current object in use * @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error + * @see dol_delete_dir */ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null) { @@ -1151,8 +1152,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook); // Security: - // We refuse cache files/dirs, upload using .. and pipes into filenames. - if (preg_match('/^\./',$file) || preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file)) + // We refuse transversal using .. and pipes into filenames. + if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file)) { dol_syslog("Refused to delete file ".$file, LOG_WARNING); return False; @@ -1222,9 +1223,18 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n * @param string $dir Directory to delete * @param int $nophperrors Disable all PHP output errors * @return boolean True if success, false if error + * @see dol_delete_file */ function dol_delete_dir($dir,$nophperrors=0) { + // Security: + // We refuse transversal using .. and pipes into filenames. + if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir)) + { + dol_syslog("Refused to delete dir ".$dir, LOG_WARNING); + return False; + } + $dir_osencoded=dol_osencode($dir); return ($nophperrors?@rmdir($dir_osencoded):rmdir($dir_osencoded)); } From 135358780cbae665e6de61aaaf59113254f4c06b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 14:48:26 +0100 Subject: [PATCH 30/65] FIX #6445 --- htdocs/core/login/functions_dolibarr.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index ee162bd9cc8..daf82b2f995 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -47,7 +47,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= { dol_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest." passwordtotest=".preg_replace('/./','*',$passwordtotest)." entitytotest=".$entitytotest); - // If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko + // If test username/password asked, we define $test=false if ko and $login var to login if ok, set also $_SESSION["dol_loginmesg"] if ko $table = MAIN_DB_PREFIX."user"; $usernamecol1 = 'login'; $usernamecol2 = 'email'; @@ -59,6 +59,9 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'"; $sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")"; $sql.=' AND statut = 1'; + // Required to first found the user into entity, then the superadmin. + // For the case (TODO and that we must avoid) a user has renamed its login with same value than a user in entity 0. + $sql.=' ORDER BY entity DESC'; $resql=$db->query($sql); if ($resql) From c3179963ca3079a53141a1fd4e27a2a5dd817e18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 14:59:57 +0100 Subject: [PATCH 31/65] Fix search fails under certain circumstances. --- htdocs/admin/modules.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 341cdd00ebc..d4e9b8b7ea0 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -390,6 +390,7 @@ if ($mode != 'marketplace') // Check filters $modulename=$objMod->getName(); + $moduletechnicalname=$objMod->name; $moduledesc=$objMod->getDesc(); $moduledesclong=$objMod->getDescLong(); $moduleauthor=$objMod->getPublisher(); @@ -399,6 +400,7 @@ if ($mode != 'marketplace') { $qualified=0; if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename) + || preg_match('/'.preg_quote($search_keyword).'/i', $moduletechnicalname) || preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc) || preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong) || preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor) From 8f338a155a5a8d1d1063b17e8fadbebbee8989bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 15:19:15 +0100 Subject: [PATCH 32/65] Fix last_insert_id at a better place --- htdocs/core/db/Database.interface.php | 2 +- htdocs/core/modules/import/import_csv.modules.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index ab38cdf378c..28623f780a5 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -195,7 +195,7 @@ interface Database * Execute a SQL request and return the resultset * * @param string $query SQL query string - * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions). + * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return resource Resultset of answer diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 3e3ec91dd60..96f0dca04fa 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -588,9 +588,9 @@ class ImportCsv extends ModeleImports { $updatedone = false; $insertdone = false; - if(!empty($updatekeys)) { + if (!empty($updatekeys)) { // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) - if(empty($lastinsertid)) { + if (empty($lastinsertid)) { $sqlSelect = 'SELECT rowid FROM '.$tablename; $data = array_combine($listfields, $listvalues); @@ -627,7 +627,7 @@ class ImportCsv extends ModeleImports } } - if(!empty($lastinsertid)) { + if (!empty($lastinsertid)) { // Build SQL UPDATE request $sqlstart = 'UPDATE '.$tablename; @@ -660,7 +660,7 @@ class ImportCsv extends ModeleImports } // Update not done, we do insert - if(!$error && !$updatedone) { + if (!$error && !$updatedone) { // Build SQL INSERT request $sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key'; $sqlend = ') VALUES('.implode(', ', $listvalues).", '".$importid."'"; @@ -679,10 +679,10 @@ class ImportCsv extends ModeleImports if ($sql) { $resql=$this->db->query($sql); - $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). if ($resql) { - $insertdone = true; + $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). + $insertdone = true; } else { From 57c297117517f961d1903e11b85534dba270dbfd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:19:18 +0100 Subject: [PATCH 33/65] Fix dol_banner for agenda --- htdocs/core/class/html.form.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0bb01da357d..3a99965e301 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5851,7 +5851,13 @@ class Form { $ret.=dol_htmlentities($object->getFullName($langs)); } + else if (in_array($object->element, array('action', 'agenda'))) + { + $ret.=$object->label; + } else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + + if ($morehtmlref) { $ret.=' '.$morehtmlref; From 618c27d63c7ecfffc22404fe95dea5d72edb42bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:26:43 +0100 Subject: [PATCH 34/65] Optimize space --- htdocs/comm/action/index.php | 24 +++++++++++++++++------- htdocs/core/lib/functions.lib.php | 14 ++++++++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f8b50fb588a..25d410e7bdb 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1353,7 +1353,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
    '; // always 1 li per ul, 1 ul per event print '
  • '; print '
'; } if (! empty($head['text'])) { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 0a802475f01..5d03c087f06 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -577,13 +577,13 @@ div.myavailability { text-overflow: ellipsis; white-space: nowrap; } -.tdoverflowmax100 { +.tdoverflowmax100 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.tdoverflowmax300 { +.tdoverflowmax300 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 300px; overflow: hidden; text-overflow: ellipsis; From 80702e4c0a63ad7a7e79127a575cd9f058e4dc16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 11:22:27 +0100 Subject: [PATCH 18/65] Fix Better HTML5 compliant --- htdocs/core/boxes/box_actions.php | 8 +++--- htdocs/core/boxes/box_activity.php | 26 +++++++++---------- htdocs/core/boxes/box_bookmarks.php | 4 +-- htdocs/core/boxes/box_clients.php | 6 ++--- htdocs/core/boxes/box_commandes.php | 12 ++++----- htdocs/core/boxes/box_comptes.php | 10 +++---- htdocs/core/boxes/box_contacts.php | 8 +++--- htdocs/core/boxes/box_contracts.php | 12 ++++----- htdocs/core/boxes/box_external_rss.php | 2 +- htdocs/core/boxes/box_factures.php | 12 ++++----- htdocs/core/boxes/box_factures_fourn.php | 14 +++++----- htdocs/core/boxes/box_factures_fourn_imp.php | 12 ++++----- htdocs/core/boxes/box_factures_imp.php | 12 ++++----- htdocs/core/boxes/box_ficheinter.php | 10 +++---- htdocs/core/boxes/box_fournisseurs.php | 8 +++--- htdocs/core/boxes/box_goodcustomers.php | 8 +++--- .../boxes/box_graph_invoices_permonth.php | 2 +- .../box_graph_invoices_supplier_permonth.php | 2 +- .../core/boxes/box_graph_orders_permonth.php | 2 +- .../box_graph_orders_supplier_permonth.php | 2 +- .../boxes/box_graph_propales_permonth.php | 2 +- htdocs/core/boxes/box_members.php | 8 +++--- htdocs/core/boxes/box_produits.php | 12 ++++----- .../core/boxes/box_produits_alerte_stock.php | 10 +++---- htdocs/core/boxes/box_project.php | 14 +++++----- htdocs/core/boxes/box_propales.php | 12 ++++----- htdocs/core/boxes/box_prospect.php | 8 +++--- htdocs/core/boxes/box_services_contracts.php | 4 +-- htdocs/core/boxes/box_services_expired.php | 8 +++--- htdocs/core/boxes/box_supplier_orders.php | 12 ++++----- htdocs/core/boxes/box_task.php | 10 +++---- 31 files changed, 136 insertions(+), 136 deletions(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index c406ada6fa5..b6d38d17b53 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -110,14 +110,14 @@ class box_actions extends ModeleBoxes $label = empty($objp->label)?$objp->type_label:$objp->label; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $actionstatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => ($societestatic->id > 0 ? $societestatic->getNomUrl(1) : ''), 'asis' => 1, ); @@ -128,7 +128,7 @@ class box_actions extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => ($objp->percentage>= 0?$objp->percentage.'%':''), ); @@ -149,7 +149,7 @@ class box_actions extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 34666507488..96a451f70f8 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -148,19 +148,19 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee, ); $this->info_box_contents[$line][2] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), 'text' => $data[$j]->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", ); $this->info_box_contents[$line][3] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency) ); @@ -230,19 +230,19 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), ); $this->info_box_contents[$line][2] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $data[$j]->nb, 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", ); $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), ); $totalMnt += $objp->Mnttot; @@ -260,7 +260,7 @@ class box_activity extends ModeleBoxes ); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } @@ -323,12 +323,12 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0), ); $this->info_box_contents[$line][2] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $data[$j]->nb, 'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0), 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut, @@ -336,7 +336,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), ); $totalMnt += $data[$j]->Mnttot; @@ -413,12 +413,12 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), ); $this->info_box_contents[$line][2] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $data[$j]->nb, 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, @@ -426,7 +426,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), ); $totalMnt += $data[$j]->Mnttot; diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index e99a0b30387..b6df56f52a2 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -94,7 +94,7 @@ class box_bookmarks extends ModeleBoxes 'target' => $objp->target?'newtab':'', ); $this->info_box_contents[$line][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->title, 'url' => $objp->url, 'tooltip' => $objp->title, @@ -117,7 +117,7 @@ class box_bookmarks extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 307dcc7cbfd..0649d43a049 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -117,13 +117,13 @@ class box_clients extends ModeleBoxes $thirdpartystatic->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem, "day") ); @@ -140,7 +140,7 @@ class box_clients extends ModeleBoxes $db->free($result); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 7653206333d..fe460f7d512 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -115,33 +115,33 @@ class box_commandes extends ModeleBoxes $societestatic->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $commandestatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $societestatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); if (! empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER)) { if ($objp->fk_user_valid > 0) $userstatic->fetch($objp->fk_user_valid); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''), 'asis' => 1, ); } $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($date,'day'), ); @@ -158,7 +158,7 @@ class box_commandes extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index a1c3625e78c..2372a31f035 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -111,18 +111,18 @@ class box_comptes extends ModeleBoxes $solde_total[$objp->currency_code] += $solde; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $account_static->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->number, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code) ); @@ -151,14 +151,14 @@ class box_comptes extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 45963af9bb1..d6c38a9fce8 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -110,19 +110,19 @@ class box_contacts extends ModeleBoxes $societestatic->fournisseur = $objp->fournisseur; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $contactstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem, "day"), ); @@ -144,7 +144,7 @@ class box_contacts extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index fe864e1df16..cd436f3eb85 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -106,25 +106,25 @@ class box_contracts extends ModeleBoxes // if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); } $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $contractstatic->getNomUrl(1), 'text2'=> $late, 'asis'=>1 ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"', 'text' => $thirdpartytmp->getNomUrl(1), 'asis'=>1 ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datec,'day'), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right" class="nowrap"', + 'td' => 'class="nowrap right"', 'text' => $contractstatic->getLibStatut(6), 'asis'=>1, ); @@ -141,14 +141,14 @@ class box_contracts extends ModeleBoxes $db->free($resql); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index dbe71a6ca41..71b643665b3 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -163,7 +163,7 @@ class box_external_rss extends ModeleBoxes ); $this->info_box_contents[$line][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $title, 'url' => $href, 'tooltip' => $tooltip, diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 22a90929a0b..b7c9dfa0e91 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -122,25 +122,25 @@ class box_factures extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $societestatic->getNomUrl(1, '', 40), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($date,'day'), ); @@ -161,7 +161,7 @@ class box_factures extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); @@ -169,7 +169,7 @@ class box_factures extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index b43d9cfc47b..4f88d99bb09 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -122,32 +122,32 @@ class box_factures_fourn extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->ref_supplier, 'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'
'.$langs->trans('RefSupplier').': '.$objp->ref_supplier, 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($date,'day'), ); @@ -171,14 +171,14 @@ class box_factures_fourn extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->transnoentities("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 0d6bc28f077..3313b4cbd50 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -119,25 +119,25 @@ class box_factures_fourn_imp extends ModeleBoxes $tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '
' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1 ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartytmp->getNomUrl(1, '', 40), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datelimite,'day'), ); @@ -161,14 +161,14 @@ class box_factures_fourn_imp extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 67c4d4dbfcc..6bd2e662b64 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -126,25 +126,25 @@ class box_factures_imp extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $societestatic->getNomUrl(1, '', 44), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datelimite,'day'), ); @@ -163,7 +163,7 @@ class box_factures_imp extends ModeleBoxes else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); @@ -171,7 +171,7 @@ class box_factures_imp extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index d57a2a991df..9fcd8ec6cd7 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -98,7 +98,7 @@ class box_ficheinter extends ModeleBoxes 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/fichinter/card.php?id=".$objp->rowid); - $this->info_box_contents[$i][1] = array('td' => 'align="left"', + $this->info_box_contents[$i][1] = array('td' => '', 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some interventions have no ref 'url' => DOL_URL_ROOT."/fichinter/card.php?id=".$objp->rowid); @@ -106,11 +106,11 @@ class box_ficheinter extends ModeleBoxes 'logo' => 'company', 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); - $this->info_box_contents[$i][3] = array('td' => 'align="left"', + $this->info_box_contents[$i][3] = array('td' => '', 'text' => dol_trunc($objp->name,40), 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); - $this->info_box_contents[$i][4] = array('td' => 'align="right"', + $this->info_box_contents[$i][4] = array('td' => 'class="right"', 'text' => dol_print_date($datec,'day')); $this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"', @@ -127,14 +127,14 @@ class box_ficheinter extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index ed3680af455..432d34897d0 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -94,13 +94,13 @@ class box_fournisseurs extends ModeleBoxes $thirdpartytmp->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartytmp->getNomUrl(1, '', 40), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem, "day"), ); @@ -120,14 +120,14 @@ class box_fournisseurs extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 552ed92b8a3..73208b1423a 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -114,18 +114,18 @@ class box_goodcustomers extends ModeleBoxes $nbimpaye = $objp->nbfact - $objp->nbfactpaye; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem, "day") ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $nbfact.( $nbimpaye != 0 ? ' ('.$nbimpaye.')':'') ); @@ -142,7 +142,7 @@ class box_goodcustomers extends ModeleBoxes $db->free($result); } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index e4639070203..d313d10b310 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -255,7 +255,7 @@ class box_graph_invoices_permonth extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 254195b42f1..ddc51aa79fe 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -252,7 +252,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 6b023b9c157..0d3077a82ce 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -253,7 +253,7 @@ class box_graph_orders_permonth extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 646f28e949c..d16bfbc0f90 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -252,7 +252,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 39fe12ed7a3..2a29cf27314 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -254,7 +254,7 @@ class box_graph_propales_permonth extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index afcbe8e68a6..1bbcec45881 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -117,19 +117,19 @@ class box_members extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $memberstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $memberstatic->getFullName($langs), 'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem, "day"), ); @@ -150,7 +150,7 @@ class box_members extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 5cce3254bfb..10ec22ce5f5 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -106,13 +106,13 @@ class box_produits extends ModeleBoxes $productstatic->entity = $objp->entity; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $productstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->label, ); @@ -139,7 +139,7 @@ class box_produits extends ModeleBoxes } } $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $price, ); @@ -149,7 +149,7 @@ class box_produits extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem,'day'), ); @@ -174,14 +174,14 @@ class box_produits extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 3ec0fc7070c..1367caed866 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -113,13 +113,13 @@ class box_produits_alerte_stock extends ModeleBoxes $productstatic->entity = $objp->entity; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $productstatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->label, ); @@ -148,7 +148,7 @@ class box_produits_alerte_stock extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $price, ); @@ -180,7 +180,7 @@ class box_produits_alerte_stock extends ModeleBoxes else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); @@ -188,7 +188,7 @@ class box_produits_alerte_stock extends ModeleBoxes } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 4c0689cd282..c2cc1cb041b 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -104,14 +104,14 @@ class box_project extends ModeleBoxes ); $this->info_box_contents[$i][1] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->ref, 'tooltip' => $tooltip, 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid, ); $this->info_box_contents[$i][2] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->title, ); @@ -123,20 +123,20 @@ class box_project extends ModeleBoxes if ($resultTask) { $objTask = $db->fetch_object($resultTask); $this->info_box_contents[$i][3] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"), ); if ($objTask->nb > 0 ) $this->info_box_contents[$i][4] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%", ); else - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); + $this->info_box_contents[$i][4] = array('td' => 'class="right"', 'text' => "N/A "); $totalnbTask += $objTask->nb; } else { - $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0, 0, ',', ' ')); - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); + $this->info_box_contents[$i][3] = array('td' => 'class="right"', 'text' => number_format(0, 0, ',', ' ')); + $this->info_box_contents[$i][4] = array('td' => 'class="right"', 'text' => "N/A "); } $i++; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index b0a1e4a3798..d3945ddb940 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -109,25 +109,25 @@ class box_propales extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $propalstatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $societestatic->getNomUrl(1,'',40), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($date,'day'), ); @@ -148,14 +148,14 @@ class box_propales extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 40adb98b405..1acd77addfc 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -117,13 +117,13 @@ class box_prospect extends ModeleBoxes $thirdpartystatic->logo = $objp->logo; $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($datem, "day"), ); @@ -149,14 +149,14 @@ class box_prospect extends ModeleBoxes $db->free($resql); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 752509a0616..b33079d2ab0 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -155,13 +155,13 @@ class box_services_contracts extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 90f36ef6d30..2754a4cece6 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -98,7 +98,7 @@ class box_services_expired extends ModeleBoxes 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); - $this->info_box_contents[$i][1] = array('td' => 'align="left"', + $this->info_box_contents[$i][1] = array('td' => '', 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); @@ -114,7 +114,7 @@ class box_services_expired extends ModeleBoxes 'text' => dol_print_date($dateline,'day'), 'text2'=> $late); - $this->info_box_contents[$i][5] = array('td' => 'align="right"', + $this->info_box_contents[$i][5] = array('td' => 'class="right"', 'text' => $objp->nb_services); @@ -131,7 +131,7 @@ class box_services_expired extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } @@ -140,7 +140,7 @@ class box_services_expired extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', + $this->info_box_contents[0][0] = array('td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 1f0e1ece2ef..29b6009b367 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -112,25 +112,25 @@ class box_supplier_orders extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $objp->ref, 'tooltip' => $tooltip, 'url' => $urlo, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'), 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => dol_print_date($date,'day'), ); @@ -151,7 +151,7 @@ class box_supplier_orders extends ModeleBoxes $db->free($result); } else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), ); @@ -160,7 +160,7 @@ class box_supplier_orders extends ModeleBoxes else { $this->info_box_contents[0][0] = array( - 'td' => 'align="left"', + 'td' => '', 'text' => $langs->trans("ReadPermissionNotAllowed"), ); } diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 29dd9390597..ed02e2fc6eb 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -99,19 +99,19 @@ class box_task extends ModeleBoxes { $objp = $db->fetch_object($result); $this->info_box_contents[$i][] = array( - 'td' => 'align="left"', + 'td' => '', 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0), ); $this->info_box_contents[$i][] = array( - 'td' => 'align="right"', + 'td' => 'class="right"', 'text' => $objp->nb." ".$langs->trans("Tasks"), 'url' => DOL_URL_ROOT."/projet/tasks/list.php?leftmenu=projects&viewstatut=".$objp->fk_statut, ); $totalnb += $objp->nb; - $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); $totalplannedtot += $objp->plannedtot; - $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); $totaldurationtot += $objp->durationtot; $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); @@ -124,7 +124,7 @@ class box_task extends ModeleBoxes // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")." ".$textHead); $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); From 46eedeafe82073253709d07eb166915078f8c7fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 11:30:46 +0100 Subject: [PATCH 19/65] Fix message shown to many times --- htdocs/core/ajax/box.php | 5 ++++- htdocs/core/class/html.formother.class.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index be4d9231c5f..fbb8fc759ad 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -73,7 +73,10 @@ if ($boxorder && $zone != '' && $userid > 0) if ($result > 0) { $langs->load("boxes"); - setEventMessages($langs->trans("BoxAdded"), null); + if (empty(GETPOST('closing'))) + { + setEventMessages($langs->trans("BoxAdded"), null); + } } } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index bcad9dbac44..5f8fe76e320 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1046,7 +1046,7 @@ class FormOther if (boxorder==\'A:A-B:B\' && closing == 1) // There is no more boxes on screen, and we are after a delete of a box so we must hide title { jQuery.ajax({ - url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?closing=\'+closing+\'&boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', async: false }); // We force reload to be sure to get all boxes into list @@ -1055,7 +1055,7 @@ class FormOther else { jQuery.ajax({ - url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?closing=\'+closing+\'&boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', async: true }); } From fda84995e87a1fb1c0540a7854169cb1951c9448 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 11:50:57 +0100 Subject: [PATCH 20/65] If manage zero is set, we must NOT set length. So we can here make a shortcut to avoid useless code. --- htdocs/accountancy/admin/index.php | 9 +++++++-- htdocs/admin/index.php | 2 +- htdocs/core/lib/accounting.lib.php | 6 ++++-- htdocs/langs/en_US/accountancy.lang | 6 +++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 85c290eef7f..74479a9d39f 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -87,7 +87,8 @@ if ($action == 'update') { setEventMessages($langs->trans("Error"), null, 'errors'); } - foreach ($list as $constname) { + foreach ($list as $constname) + { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -278,13 +279,17 @@ foreach ($list as $key) $var = ! $var; print '
'.$label.''; - print ''; + print ''; print '
'; @@ -1413,7 +1413,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa { $savlabel=$event->libelle; $event->libelle=$daterange; + //print ''; print $event->getNomUrl(0); + //print ''; $event->libelle=$savlabel; } else @@ -1421,7 +1423,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print $daterange; } //print ' '; - print "
\n"; + print " "; } else { @@ -1535,14 +1537,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa * Change color with a delta * * @param string $color Color - * @param int $minus Delta + * @param int $minus Delta (1 = 16 unit) + * @param int $minusunit Minus unit * @return string New color */ -function dol_color_minus($color, $minus) +function dol_color_minus($color, $minus, $minusunit = 16) { $newcolor=$color; - $newcolor[0]=((hexdec($newcolor[0])-$minus)<0)?0:dechex((hexdec($newcolor[0])-$minus)); - $newcolor[2]=((hexdec($newcolor[2])-$minus)<0)?0:dechex((hexdec($newcolor[2])-$minus)); - $newcolor[4]=((hexdec($newcolor[4])-$minus)<0)?0:dechex((hexdec($newcolor[4])-$minus)); + if ($minusunit == 16) + { + $newcolor[0]=dechex(max(min(hexdec($newcolor[0])-$minus, 15), 0)); + $newcolor[2]=dechex(max(min(hexdec($newcolor[2])-$minus, 15), 0)); + $newcolor[4]=dechex(max(min(hexdec($newcolor[4])-$minus, 15), 0)); + } + else + { + // Not yet implemented + } return $newcolor; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6a0ffad4149..0c19d216164 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1047,9 +1047,15 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } } } + if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; - if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + + if ($object->element == 'societe') + { + if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) + { + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + } } elseif ($object->element == 'product') { @@ -1099,9 +1105,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'product' || $object->element == 'bank_account') { - if(! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; + if (! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; } - + if ($object->element != 'product' && $object->element != 'bookmark') { $morehtmlref.='
'; From a9b39f302812465c5cb4ca4c0b17a80f9ac79472 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:19:18 +0100 Subject: [PATCH 35/65] Fix dol_banner for agenda --- htdocs/core/class/html.form.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 51d24f7c729..9a5aadd2148 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5745,7 +5745,13 @@ class Form { $ret.=dol_htmlentities($object->getFullName($langs)); } + else if (in_array($object->element, array('action', 'agenda'))) + { + $ret.=$object->label; + } else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + + if ($morehtmlref) { $ret.=' '.$morehtmlref; From 2a3d3b4b50cac7d5e843bbf74e03fd60cf1fea08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:40:38 +0100 Subject: [PATCH 36/65] Fix dol_banner for agenda --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/tpl/resource_add.tpl.php | 2 +- htdocs/theme/eldy/style.css.php | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9a5aadd2148..60ff30c6433 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5747,7 +5747,7 @@ class Form } else if (in_array($object->element, array('action', 'agenda'))) { - $ret.=$object->label; + $ret.=$object->ref.'
'.$object->label; } else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index 97cb933bcf7..68fccf6e540 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -8,7 +8,7 @@ $formresources = new FormResource($db); $out = '
'; -$out .= '
'; +$out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5d03c087f06..7c699c31e7f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2742,11 +2742,12 @@ div.pagination li.paginationafterarrows { } */ + /* Set the color for hover lines */ .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover, .box_pair:hover, .box_impair:hover { - background: rgb() !important; + background-color: rgb() !important; } @@ -2757,10 +2758,10 @@ div.pagination li.paginationafterarrows { color: #202020; min-height: 18px; /* seems to not be used */ - background: #; + background-color: #; } #GanttChartDIV { - background: #; + background-color: #; } .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { @@ -2776,13 +2777,14 @@ table.dataTable tr.odd { } /* For no hover style */ -table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td { +table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { background-color: # !important; } tr.nohoverpair td { background-color: # !important; } + table.dataTable td { padding: 5px 2px 5px 3px !important; } From b6bdd985997bbb7be6839212ff5e5fd61a2ad27b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:44:30 +0100 Subject: [PATCH 37/65] Fix css --- htdocs/core/tpl/resource_add.tpl.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index 68fccf6e540..b521445701b 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -6,7 +6,7 @@ require_once(DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'); $form = new Form($db); $formresources = new FormResource($db); -$out = '
'; +$out = '
'; $out .= ''; $out .= ''; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index df3e374b565..4c5016268a8 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2648,7 +2648,7 @@ table.dataTable tr.odd { } /* For no hover style */ -table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td { +table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { background-color: # !important; } tr.nohoverpair td { From 209bd0b3e4cd7c09cf4794c70f88ebe18af2cc80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:53:26 +0100 Subject: [PATCH 38/65] 2nd try to fix better compatibility --- htdocs/core/class/commonobject.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2fc6d22fd62..7b812e7ee36 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1223,11 +1223,11 @@ abstract class CommonObject * @param int $id To force other object id (should not be used) * @param string $format Data format ('text', 'date'). 'text' is used if not defined * @param string $id_field To force rowid field name. 'rowid' is used if not defined - * @param User|string $user Update last update fields also if user object provided. If not provided, current user is used. + * @param User|string $fuser Update the user of last update field with this user. If not provided, current user is used except if value is 'none' * @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY') * @return int <0 if KO, >0 if OK */ - function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $user='', $trigkey='') + function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='') { global $user,$langs,$conf; @@ -1247,7 +1247,8 @@ abstract class CommonObject if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'"; else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value); else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null"); - if (empty($user) && is_object($user)) $sql.=", fk_user_modif = ".$user->id; + if (! empty($fuser) && is_object($fuser)) $sql.=", fk_user_modif = ".$fuser->id; + elseif (empty($fuser) || $fuser != 'none') $sql.=", fk_user_modif = ".$user->id; $sql.= " WHERE ".$id_field." = ".$id; dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); @@ -1256,7 +1257,7 @@ abstract class CommonObject { if ($trigkey) { - $result=$this->call_trigger($trigkey, $user); // This may set this->errors + $result=$this->call_trigger($trigkey, (! empty($fuser) && is_object($fuser)) ? $fuser : $user); // This may set this->errors if ($result < 0) $error++; } From 29c66b43a34d2933b619f8df3a0517dd639311a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:07:14 +0100 Subject: [PATCH 39/65] Fix responsive --- htdocs/core/lib/company.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2e809fa6c3b..b010f8143b4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -531,6 +531,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin print "\n"; print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,''); + print '
'; print "\n".'
'; $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status"; @@ -597,7 +598,8 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin dol_print_error($db); } print "
"; - + print ''; + print "
\n"; } From c0b3219c7258e7f6ee2ed65c8b6b798a797e6a7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:33:04 +0100 Subject: [PATCH 40/65] Missing translation --- htdocs/langs/en_US/loan.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/loan.lang b/htdocs/langs/en_US/loan.lang index de0a6fd0295..a26e23bbbc2 100644 --- a/htdocs/langs/en_US/loan.lang +++ b/htdocs/langs/en_US/loan.lang @@ -43,6 +43,7 @@ LoanCalcDesc=This mortgage calculator can be used to figure out monthly p GoToInterest=%s will go towards INTEREST GoToPrincipal=%s will go towards PRINCIPAL YouWillSpend=You will spend %s in year %s +AddLoan=Create loan # Admin ConfigLoan=Configuration of the module loan LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default From 5033c6ea99bffa1648db1aad5b55716c303fa248 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:35:39 +0100 Subject: [PATCH 41/65] Add hidden constant as this is not common --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 54643ad6780..69dde026c9b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -406,7 +406,7 @@ $listofreferent=array( 'table'=>'stock_mouvement', 'datefieldname'=>'datem', 'disableamount'=>0, - 'test'=>$conf->stock->enabled && $user->rights->stock->mouvement->lire), + 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))) /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", From 106d74184c1164f277f9a1ab72ed57caa45bdd35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:43:06 +0100 Subject: [PATCH 42/65] CSS change. More information on project list of thirdparty. --- htdocs/core/lib/company.lib.php | 33 ++++++++++++++++--- htdocs/projet/list.php | 5 ++- htdocs/theme/eldy/style.css.php | 58 +++++++++++++++++++-------------- htdocs/theme/md/style.css.php | 40 ++++++++++++++++------- 4 files changed, 94 insertions(+), 42 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2e809fa6c3b..0e610df00e8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -533,8 +533,10 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,''); print "\n".''; - $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status"; + $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; + $sql .= ", cls.code as opp_status_code"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; $sql .= " WHERE p.fk_soc = ".$object->id; $sql .= " ORDER BY p.dateo DESC"; @@ -544,8 +546,14 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin $num = $db->num_rows($result); print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; if ($num > 0) @@ -574,9 +582,24 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin // Label print ''; // Date start - print ''; + print ''; // Date end - print ''; + print ''; + // Opp amount + print ''; + // Opp status + print ''; + // Opp percent + print ''; // Status print ''; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 68077621771..35f65b75c2a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -741,7 +741,7 @@ while ($i < min($num,$limit)) print ''; if (! $i) $totalarray['nbfield']++; } - // Amount + // Opp Amount if (! empty($arrayfields['p.opp_amount']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } + // Opp percent if (! empty($arrayfields['p.opp_percent']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } + // Budget if (! empty($arrayfields['p.budget_amount']['checked'])) { print '"; } From 2054ce0aab2e7fab9a81fa4544e1cd2baba16136 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:50:55 +0100 Subject: [PATCH 44/65] FIX Avoid flash on screen --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index a0e37026ff8..571b24bca52 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -597,7 +597,7 @@ class FormProjets if ($num > 0) { $sellist = '"; } From 4737c62394f1a5654f2ade30f71df66953eae6d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:50:55 +0100 Subject: [PATCH 46/65] FIX Avoid flash on screen --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index ffce8300a0c..47706d90d7f 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -586,7 +586,7 @@ class FormProjets if ($num > 0) { $sellist = '
'.$langs->trans("Ref").''.$langs->trans("Name").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("Status").''.$langs->trans("Ref").''.$langs->trans("Name").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("OpportunityAmountShort").''.$langs->trans("OpportunityStatusShort").''.$langs->trans("OpportunityProbabilityShort").''.$langs->trans("Status").'
'.$obj->title.''.dol_print_date($db->jdate($obj->do),"day").''.dol_print_date($db->jdate($obj->do),"day").''.dol_print_date($db->jdate($obj->de),"day").''.dol_print_date($db->jdate($obj->de),"day").''; + if ($obj->opp_status_code) + { + print price($obj->opp_amount, 1, '', 1, -1, -1, ''); + } + print ''; + if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); + print ''; + if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%'; + print ''.$projecttmp->getLibStatut(5).''; @@ -754,6 +754,7 @@ while ($i < min($num,$limit)) if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield']; } + // Opp Status if (! empty($arrayfields['p.fk_opp_status']['checked'])) { print ''; @@ -761,6 +762,7 @@ while ($i < min($num,$limit)) print ''; @@ -768,6 +770,7 @@ while ($i < min($num,$limit)) print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ffb3e7b83f8..5ce9e9515c1 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -100,7 +100,6 @@ $usegradienttop=(isset($conf->global->THEME_ELDY_TOPMENU_BACK1)?0:1); $usegradienttitle=(isset($conf->global->THEME_ELDY_BACKTITLE1)?0:1); $useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:1); $borderwith=2; -$noborderline=0; // Case of option always editable if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody; @@ -273,7 +272,7 @@ input.select2-input { } .select2-choice { border: none; - border-bottom: 1px solid #aaa !important; + border-bottom: 1px solid #ccc !important; } textarea.cke_source:focus @@ -299,15 +298,19 @@ input { input, select { border-bottom: solid 1px rgba(0,0,0,.2); - padding:4px; + padding: 4px; margin-left:0px; margin-bottom:1px; margin-top:1px; - } +} +select { + padding: 4px 4px 4px 1px; +} textarea { border-radius: 0; - border: solid 1px rgba(0,0,0,.3); - border-top:solid 1px rgba(0,0,0,.3); + border-top:solid 1px rgba(0,0,0,.1); + border-left:solid 1px rgba(0,0,0,.1); + border-right:solid 1px rgba(0,0,0,.1); border-bottom:solid 1px rgba(0,0,0,.2); padding:4px; @@ -476,6 +479,9 @@ th .button { .valignbottom { vertical-align: bottom; } +.valigntextbottom { + vertical-align: text-bottom; +} .centpercent { width: 100%; } @@ -919,8 +925,8 @@ div.fiche { div.fiche { - margin-: px; - margin-: dol_optimize_smallscreen)?'12':'6')); ?>px; + margin-: px; + margin-: dol_optimize_smallscreen)?'16':'6')); ?>px; dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?> dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?> } @@ -1477,10 +1483,6 @@ form#login { -webkit-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15); box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15); - /*-moz-box-shadow: 3px 2px 20px #CCC; - -webkit-box-shadow: 3px 2px 20px #CCC; - box-shadow: 3px 2px 20px #CCC;*/ - border-radius: 5px; /*border-top:solid 1px rgba(180,180,180,.4); border-left:solid 1px rgba(180,180,180,.4); @@ -2273,9 +2275,6 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { - - border: 1px solid #E0E0E0; - border-collapse: collapse !important; padding: 1px 2px 1px 3px; /* t r b l */ } @@ -2295,18 +2294,14 @@ div .tdtop { } table.border td, div.border div div.tagtd { - - padding: 2px 2px 2px 2px; - border: 1px solid #E0E0E0; - padding: 3px 2px 3px 2px; - border-bottom: 1px solid #E0E0E0; - - padding: 3px 2px 3px 2px; - /* border: 1px solid #E0E0E0; */ - border-collapse: collapse; } +div.tabBar .fichecenter table.border>tbody>tr>td, div.tabBar .fichecenter div.border div div.tagtd +{ + padding-top: 4px; + border-bottom: 1px solid #E0E0E0; +} td.border, div.tagtable div div.border { border-top: 1px solid #000000; @@ -2854,6 +2849,7 @@ span.dashboardlineko { } .boxtable { margin-bottom: 8px !important; + border-bottom-width: 0 !important; } .tdboxstats { text-align: center; @@ -3910,6 +3906,9 @@ div.dataTables_length select { /* Select2 */ /* ============================================================================== */ +.select2-container .select2-choice { + border-bottom: 1px solid #ccc; +} .select2-container .select2-choice > .select2-chosen { margin-right: 23px; } @@ -3936,7 +3935,7 @@ div.dataTables_length select { border-top: none !important; border-left: none !important; border-right: none !important; - border-bottom: 1px solid #aaa; + border-bottom: 1px solid #ccc; } .select2-drop.select2-drop-above { box-shadow: none !important; @@ -4023,6 +4022,15 @@ a span.select2-chosen .select2-container-multi .select2-choices .select2-search-choice { margin-bottom: 3px; } +.select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi .select2-choices, +.select2-container-multi.select2-container-active .select2-choices +{ + border-bottom: 1px solid #ccc; + border-right: none; + border-top: none; + border-left: 1px solid #ddd; +} + /* Special case for the select2 add widget */ #addbox .select2-container .select2-choice > .select2-chosen { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 96cb8002719..b64ce9e3a89 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -273,7 +273,7 @@ input.select2-input { } .select2-choice { border: none; - border-bottom: 1px solid #aaa !important; + border-bottom: 1px solid #ccc !important; } textarea.cke_source:focus @@ -296,16 +296,22 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla input, select { border-bottom: solid 1px rgba(0,0,0,.2); - padding:4px; margin-left:0px; margin-bottom:1px; margin-top:1px; - } +} +input { + padding:4px; +} +select { + padding:1px; +} textarea { border-radius: 0; - border: solid 1px rgba(0,0,0,.3); - border-top:solid 1px rgba(0,0,0,.3); + border-top:solid 1px rgba(0,0,0,.1); + border-left:solid 1px rgba(0,0,0,.1); + border-right:solid 1px rgba(0,0,0,.1); border-bottom:solid 1px rgba(0,0,0,.2); background-color: #FFF; @@ -481,6 +487,9 @@ th .button { .valignbottom { vertical-align: bottom; } +.valigntextbottom { + vertical-align: text-bottom; +} .centpercent { width: 100%; } @@ -1512,9 +1521,6 @@ form#login { -moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); -webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - /*-moz-box-shadow: 3px 2px 20px #CCC; - -webkit-box-shadow: 3px 2px 20px #CCC; - box-shadow: 3px 2px 20px #CCC;*/ border-radius: 4px; border:solid 1px rgba(80,80,80,.4); @@ -2184,9 +2190,7 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { - border: 1px solid #f4f4f4; - border-collapse: collapse !important; padding: 1px 2px 1px 3px; /* t r b l */ } @@ -2776,6 +2780,7 @@ span.dashboardlineko { } .boxtable { margin-bottom: 8px !important; + border-bottom-width: 0 !important; } .tdboxstats { text-align: center; @@ -3856,6 +3861,9 @@ div.dataTables_length select { /* Select2 */ /* ============================================================================== */ +.select2-container .select2-choice { + border-bottom: 1px solid #ccc; +} .select2-container .select2-choice > .select2-chosen { margin-right: 23px; } @@ -3883,7 +3891,7 @@ div.dataTables_length select { border-top: none !important; border-left: none !important; border-right: none !important; - border-bottom: 1px solid #aaa; + border-bottom: 1px solid #ccc; } .select2-drop.select2-drop-above { box-shadow: none !important; @@ -3970,6 +3978,16 @@ a span.select2-chosen .select2-container-multi .select2-choices .select2-search-choice { margin-bottom: 3px; } +.select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi .select2-choices, +.select2-container-multi.select2-container-active .select2-choices +{ + border-bottom: 1px solid #ccc; + border-right: none; + border-top: none; + border-left: 1px solid #ddd; +} + + /* Special case for the select2 add widget */ #addbox .select2-container .select2-choice > .select2-chosen { From 21189048e7b7efafda508a746ae8fb60120f137e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:50:31 +0100 Subject: [PATCH 43/65] FIX choice of category was lost if an error occurs during creation --- htdocs/projet/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 7c8a3e3a71a..1b0ccb36ed0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -595,6 +595,7 @@ if ($action == 'create' && $user->rights->projet->creer) // Categories print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); + $arrayselected=GETPOST('categories', 'array'); print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); + $arrayselected=GETPOST('categories', 'array'); print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print "
'; // New value From 47dd53abbe322413c3e47926d6719bb7a2d2e633 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 02:36:22 +0100 Subject: [PATCH 48/65] NEW The substitution keys available for emailing edition is now into a popup --- htdocs/comm/mailing/card.php | 18 +++--------------- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/theme/eldy/style.css.php | 9 ++++----- htdocs/theme/md/style.css.php | 3 +-- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index ea4b21d78be..2ce6a638191 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -846,11 +846,6 @@ else print '
'; -/* print ''; - print ''; -*/ // Description print ''; - - // Status - /* - print ''; - */ // Nb of distinct emails print ''; @@ -1191,7 +1179,7 @@ else $htmltext.=''; // Print mail content - print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic'); dol_fiche_head(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3a99965e301..a427d67ac83 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -447,7 +447,7 @@ class Form else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag if ($tooltipon == 1 || $tooltipon == 3) { - $paramfortooltiptd=' class="'.$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" '; + $paramfortooltiptd=' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" '; if ($tooltiptrigger == '') $paramfortooltiptd.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip else $paramfortooltiptd.=' dolid="'.$tooltiptrigger.'"'; } @@ -524,7 +524,7 @@ class Form elseif ($type == 'warning') $img = img_warning($alt); else $img = img_picto($alt, $type); - return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger); + return $this->textwithtooltip($text, $htmltext, ($tooltiptrigger?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger); } /** diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5ce9e9515c1..e424f65ca3f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -304,7 +304,7 @@ input, select { margin-top:1px; } select { - padding: 4px 4px 4px 1px; + /* padding: 4px 4px 2px 1px; */ } textarea { border-radius: 0; @@ -387,7 +387,7 @@ fieldset { border: 1px solid #AAAAAA !important; } border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; - padding: 4px 14px; + padding: 3px 14px; margin-bottom: 0; margin-top: 0; text-align: center; @@ -3942,6 +3942,7 @@ div.dataTables_length select { } .select2-drop.select2-drop-above.select2-drop-active { border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; } .select2-container-active .select2-choice, .select2-container-active .select2-choices { @@ -3977,8 +3978,6 @@ div.dataTables_length select { } .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices { background-image: none; - border-left: 1px solid #ccc !important; - border-right: 1px solid #ccc !important; border-radius: 0 !important; } div.select2-drop-above @@ -4025,7 +4024,7 @@ a span.select2-chosen .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi .select2-choices, .select2-container-multi.select2-container-active .select2-choices { - border-bottom: 1px solid #ccc; + border-bottom: none; border-right: none; border-top: none; border-left: 1px solid #ddd; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index b64ce9e3a89..76776e1c41e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3898,6 +3898,7 @@ div.dataTables_length select { } .select2-drop.select2-drop-above.select2-drop-active { border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; } .select2-container-active .select2-choice, .select2-container-active .select2-choices { @@ -3933,8 +3934,6 @@ div.dataTables_length select { } .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices { background-image: none; - border-left: 1px solid #ccc !important; - border-right: 1px solid #ccc !important; border-radius: 0 !important; } div.select2-drop-above From c7713a88392b63be7e304a164cde84d4083b8fce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 03:01:45 +0100 Subject: [PATCH 49/65] CSS --- htdocs/theme/eldy/style.css.php | 14 +++++++------- htdocs/theme/md/style.css.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 691513e4231..85fdd49f8ef 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -272,7 +272,7 @@ input.select2-input { } .select2-choice { border: none; - border-bottom: 1px solid #ccc !important; + border-bottom: solid 1px rgba(0,0,0,.1) !important; /* required to avoid to lose bottom line when focus is lost on select2. */ } textarea.cke_source:focus @@ -288,7 +288,7 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla font-family: ; border: none; - border-bottom: 1px solid #C0C0C0; + border-bottom: solid 1px rgba(0,0,0,.1); outline: none; margin: 0px 0px 0px 0px; } @@ -296,7 +296,7 @@ input { line-height: 17px; } input, select { - border-bottom: solid 1px rgba(0,0,0,.2); + border-bottom: solid 1px rgba(0,0,0,.1); padding: 4px; margin-left:0px; @@ -311,7 +311,7 @@ textarea { border-top:solid 1px rgba(0,0,0,.1); border-left:solid 1px rgba(0,0,0,.1); border-right:solid 1px rgba(0,0,0,.1); - border-bottom:solid 1px rgba(0,0,0,.2); + border-bottom:solid 1px rgba(0,0,0,.1); padding:4px; margin-left:0px; @@ -3909,7 +3909,7 @@ div.dataTables_length select { /* ============================================================================== */ .select2-container .select2-choice { - border-bottom: 1px solid #ccc; + border-bottom: solid 1px rgba(0,0,0,.1); } .select2-container .select2-choice > .select2-chosen { margin-right: 23px; @@ -3937,14 +3937,14 @@ div.dataTables_length select { border-top: none !important; border-left: none !important; border-right: none !important; - border-bottom: 1px solid #ccc; + border-bottom: solid 1px rgba(0,0,0,.1); } .select2-drop.select2-drop-above { box-shadow: none !important; } .select2-drop.select2-drop-above.select2-drop-active { border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; + border-bottom: solid 1px rgba(0,0,0,.1); } .select2-container-active .select2-choice, .select2-container-active .select2-choices { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3917967acef..481c3483724 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -288,13 +288,13 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla font-size: px; font-family: ; border: none; - border-bottom: 1px solid #C0C0C0; + border-bottom: solid 1px rgba(0,0,0,.1); outline: none; margin: 0px 0px 0px 0px; } input, select { - border-bottom: solid 1px rgba(0,0,0,.2); + border-bottom: solid 1px rgba(0,0,0,.1); margin-left:0px; margin-bottom:1px; From 0ff4f7e6949ce945a8870beed633610704bed57d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 03:10:57 +0100 Subject: [PATCH 50/65] Fix translation --- htdocs/langs/en_US/companies.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index ea1c2e805a0..166633ef2ae 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -13,7 +13,7 @@ MenuNewPrivateIndividual=New private individual NewCompany=New company (prospect, customer, supplier) NewThirdParty=New third party (prospect, customer, supplier) CreateDolibarrThirdPartySupplier=Create a third party (supplier) -CreateThirdPartyOnly=Create thirdpary +CreateThirdPartyOnly=Create third party CreateThirdPartyAndContact=Create a third party + a child contact ProspectionArea=Prospection area IdThirdParty=Id third party From aa0db5783ad2973f22f07284a63bda9565f05444 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 03:35:02 +0100 Subject: [PATCH 51/65] Update favorite icon to use standard icon. --- htdocs/theme/eldy/img/object_bookmark.png | Bin 201 -> 326 bytes htdocs/theme/md/img/object_bookmark.png | Bin 201 -> 326 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/theme/eldy/img/object_bookmark.png b/htdocs/theme/eldy/img/object_bookmark.png index 39109ef5ee61c102adfab2c4c7378fd83f76c040..42f702a584c43a444d8962c418f95deb2501e607 100644 GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh0wlLOK8*rWOiAAEE)4(M`_JqL@;D1TB8wRq zxP?KOkzv*x37{Z*iKnkC`$J}KCI!i2w&NgO*F9YvLnJQuUa<9Y4wPtl_&i2`#mcQ6 zvrM8`E=5KBU>3hVfwhC%psBaO!D4E}&F;Ou9JeAP;<&FXuq{&frX|tq%A*#$@7>%) ziG7Keyw6^dd0KPE_R{rV#|4bBhBS+Yu-_8 zzHz*%t9ohVRr}N*UaMYLY*w}~PdD5rp|!lvI6;90X`wF z|NsAAyLRo~y?c)xJ2qv?lzaE?egFRb`Sa)3u3g)@b?dov=ia}6zjW!+mX?;D>e*9) zx)@7>{DK)Ap4~_Ta%??a978y+Cnp?Ws{raQk(7{NW!*Z>z@XsGy?xc{%*@$QuQsVD wOqE*7y2wcF97|xPYpO$6;LRHmtjnYs7Mk%eyI5Cl1{%cR>FVdQ&MBb@0LwH@(f|Me diff --git a/htdocs/theme/md/img/object_bookmark.png b/htdocs/theme/md/img/object_bookmark.png index 39109ef5ee61c102adfab2c4c7378fd83f76c040..42f702a584c43a444d8962c418f95deb2501e607 100644 GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh0wlLOK8*rWOiAAEE)4(M`_JqL@;D1TB8wRq zxP?KOkzv*x37{Z*iKnkC`$J}KCI!i2w&NgO*F9YvLnJQuUa<9Y4wPtl_&i2`#mcQ6 zvrM8`E=5KBU>3hVfwhC%psBaO!D4E}&F;Ou9JeAP;<&FXuq{&frX|tq%A*#$@7>%) ziG7Keyw6^dd0KPE_R{rV#|4bBhBS+Yu-_8 zzHz*%t9ohVRr}N*UaMYLY*w}~PdD5rp|!lvI6;90X`wF z|NsAAyLRo~y?c)xJ2qv?lzaE?egFRb`Sa)3u3g)@b?dov=ia}6zjW!+mX?;D>e*9) zx)@7>{DK)Ap4~_Ta%??a978y+Cnp?Ws{raQk(7{NW!*Z>z@XsGy?xc{%*@$QuQsVD wOqE*7y2wcF97|xPYpO$6;LRHmtjnYs7Mk%eyI5Cl1{%cR>FVdQ&MBb@0LwH@(f|Me From 9cbc5387ef35cf6dbd9883cdec6cb8dfde891941 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 11:41:02 +0100 Subject: [PATCH 52/65] Fix text --- htdocs/langs/en_US/stocks.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 1448ec061a2..f97d95725fa 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -62,7 +62,7 @@ ReStockOnBill=Increase real stocks on suppliers invoices/credit notes validation ReStockOnValidateOrder=Increase real stocks on suppliers orders approbation ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses. -StockDiffPhysicTeoric=Explanation for difference between physical and theoretical stock +StockDiffPhysicTeoric=Explanation for difference between physical and virtual stock NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required. DispatchVerb=Dispatch StockLimitShort=Limit for alert From 9d63697d2afea0c146e569b52469e485c5ca69aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:04:01 +0100 Subject: [PATCH 53/65] Fix missing translation --- htdocs/langs/en_US/stocks.lang | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index f97d95725fa..58a71b08857 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -60,7 +60,7 @@ DeStockOnShipment=Decrease real stocks on shipping validation DeStockOnShipmentOnClosing=Decrease real stocks on shipping classification closed ReStockOnBill=Increase real stocks on suppliers invoices/credit notes validation ReStockOnValidateOrder=Increase real stocks on suppliers orders approbation -ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving +ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receipt of goods OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses. StockDiffPhysicTeoric=Explanation for difference between physical and virtual stock NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required. @@ -69,7 +69,10 @@ StockLimitShort=Limit for alert StockLimit=Stock limit for alert PhysicalStock=Physical stock RealStock=Real Stock +RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements. +RealStockWillAutomaticallyWhen=The real stock will automatically change according to this rules (see stock module setup to change this): VirtualStock=Virtual stock +VirtualStockDesc=Virtual stock is the stock you will get once all opened pending actions that affect stocks will be closed (supplier order received, customer order shipped, ...) IdWarehouse=Id warehouse DescWareHouse=Description warehouse LieuWareHouse=Localisation warehouse From 4ca634b41c93f2cfed9795e839249457a843301f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:04:28 +0100 Subject: [PATCH 54/65] Better look and feel --- htdocs/product/stock/product.php | 95 +++++++------- .../product/stock/tpl/stockcorrection.tpl.php | 11 +- .../product/stock/tpl/stocktransfer.tpl.php | 5 + htdocs/societe/soc.php | 4 +- htdocs/theme/eldy/style.css.php | 52 ++++---- htdocs/theme/md/style.css.php | 1 - htdocs/variants/combinations.php | 120 +++++++++++------- 7 files changed, 160 insertions(+), 128 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 14cd07ec817..f12316591d0 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -110,7 +110,7 @@ $parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $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'); -if($action == 'addlimitstockwarehouse') { +if ($action == 'addlimitstockwarehouse') { $seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $desiredstock = GETPOST('desiredstock'); @@ -625,7 +625,8 @@ if ($id > 0 || $ref) print ''; // Real stock - $text_stock_options = ''; + $text_stock_options = $langs->trans("RealStockDesc").'
'; + $text_stock_options.= $langs->trans("RealStockWillAutomaticallyWhen").'
'; $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)?$langs->trans("DeStockOnShipment").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'
':''); @@ -642,57 +643,55 @@ if ($id > 0 || $ref) $stocktheo = price2num($object->stock_theorique, 'MS'); + $found=0; + $helpondiff=''.$langs->trans("StockDiffPhysicTeoric").':
'; + // Number of customer orders running + if (! empty($conf->commande->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $helpondiff.=$langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty']; + $result=$object->load_stats_commande(0,'0'); + if ($result < 0) dol_print_error($db,$object->error); + $helpondiff.=' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; + } + + // Number of product from customer order already sent (partial shipping) + if (! empty($conf->expedition->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $result=$object->load_stats_sending(0,'2'); + $helpondiff.=$langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty']; + } + + // Number of supplier order running + if (! empty($conf->fournisseur->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $result=$object->load_stats_commande_fournisseur(0,'3,4'); + $helpondiff.=$langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty']; + $result=$object->load_stats_commande_fournisseur(0,'0,1,2'); + if ($result < 0) dol_print_error($db,$object->error); + $helpondiff.=' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; + } + + // Number of product from supplier order already received (partial receipt) + if (! empty($conf->fournisseur->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $helpondiff.=$langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty']; + } + // Calculating a theorical value - print '
'; - print "'; + print "'; print ''; - print ''; - print ''; - // Last movement $sql = "SELECT max(m.datem) as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 757407a6692..28fd3dfadea 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -21,12 +21,14 @@ element == 'product') $productref = $object->ref; $langs->load("productbatch"); - if (empty($id)) $id = $object->id; + + if (empty($id)) $id = $object->id; print ' - - - + '; + print dol_fiche_head(); + + ?> +
'.$langs->trans("Ref").''; - print $form->showrefnav($object,'id', $linkback); - print '
'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string'); @@ -865,13 +860,6 @@ else print '
'.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string'); print '
'.$langs->trans("Status").''.$object->getLibStatut(4); - if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; - print'
'; @@ -1062,7 +1050,7 @@ else $htmltext.=''; // Print mail content - print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic'); dol_fiche_head(''); @@ -1085,7 +1073,7 @@ else } else { - print $langs->trans("NoAttachedFiles").'
'; + print ''.$langs->trans("NoAttachedFiles").'
'; } print '
'.$langs->trans("VirtualStock").'".(empty($stocktheo)?0:$stocktheo); + print '
'; + print $form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")); + print '"; + //print (empty($stocktheo)?0:$stocktheo); + print $form->textwithpicto((empty($stocktheo)?0:$stocktheo), $helpondiff); if ($object->seuil_stock_alerte != '' && ($object->stock_theorique < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit")); print '
'; - print $langs->trans("StockDiffPhysicTeoric"); - print ''; - - $found=0; - // Number of customer orders running - if (! empty($conf->commande->enabled)) - { - if ($found) print '
'; else $found=1; - print $langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty']; - $result=$object->load_stats_commande(0,'0'); - if ($result < 0) dol_print_error($db,$object->error); - print ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; - } - - // Number of product from customer order already sent (partial shipping) - if (! empty($conf->expedition->enabled)) - { - if ($found) print '
'; else $found=1; - $result=$object->load_stats_sending(0,'2'); - print $langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty']; - } - - // Number of supplier order running - if (! empty($conf->fournisseur->enabled)) - { - if ($found) print '
'; else $found=1; - $result=$object->load_stats_commande_fournisseur(0,'3,4'); - print $langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty']; - $result=$object->load_stats_commande_fournisseur(0,'0,1,2'); - if ($result < 0) dol_print_error($db,$object->error); - print ' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; - } - - // Number of product from supplier order already received (partial receipt) - if (! empty($conf->fournisseur->enabled)) - { - if ($found) print '
'; else $found=1; - print $langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty']; - } - - print '
- + - - + - + - + - + - + - +
- +
>
-
-
- + + +
+ +
+ + - - + '; + } + else + { if ($action === 'delete') { if ($prodcomb->fetch($valueid) > 0) { @@ -565,7 +583,22 @@ if (! empty($id) || ! empty($ref)) { " class="button">

- + '; + print '
'; + if ($productCombinations) { + print ''.$langs->trans('Copy').''; + } + print ''.$langs->trans('NewProductCombination').''; + print ''.$langs->trans('ProductCombinationGenerator').''; + print '
'; + print ''; + + + + ?> @@ -618,17 +651,6 @@ if (! empty($id) || ! empty($ref)) { '; - print ' '; - print ''; - } } From 53238c2b0d8d4c55fc058e6191b291a37467ae4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:27:42 +0100 Subject: [PATCH 55/65] Fix sort order and number of lines --- htdocs/product/reassortlot.php | 15 +++++++++------ htdocs/product/stock/mouvement.php | 10 +++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 471aa7e3e6d..01285f09417 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -126,10 +126,7 @@ $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl on pl.fk_product = p.rowi if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ -if ($sall) -{ - $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')"; -} +if ($sall) $sql.=natural_search(array('p.ref','p.label','p.description','p.note'), $sall); // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) { @@ -163,6 +160,12 @@ $sql.= " pb.batch, pb.eatby, pb.sellby,"; $sql.= " pl.eatby, pl.sellby"; if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet $sql.= $db->order($sortfield,$sortorder); +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} $sql.= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -193,11 +196,11 @@ if ($resql) if ($sref || $snom || $sall || GETPOST('search')) { - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, 'title_products'); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products'); } else { - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, 0, 'title_products'); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products'); } if (! empty($catid)) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 8e6775e2e6e..7c4b4dcab08 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -89,7 +89,7 @@ $arrayfields=array( 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(! empty($conf->productbatch->enabled))), - 'm.warehouse'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it + 'e.label'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), 'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1), @@ -710,7 +710,7 @@ if ($resql) if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['m.warehouse']['checked'])) print_liste_field_titre($arrayfields['m.warehouse']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible + if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); @@ -774,7 +774,7 @@ if ($resql) // Batch if (! empty($arrayfields['m.batch']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['pl.eatby']['checked'])) { @@ -787,7 +787,7 @@ if ($resql) print ''; } // Warehouse - if (! empty($arrayfields['m.warehouse']['checked'])) + if (! empty($arrayfields['e.label']['checked'])) { print ''; } // Warehouse - if (! empty($arrayfields['m.warehouse']['checked'])) + if (! empty($arrayfields['e.label']['checked'])) { print ''; print ''; + // Project + if (! empty($conf->projet->enabled)) + { + $formproject=new FormProjets($db); + + // Associated project + $langs->load("projects"); + + print ''; + } + // Payment Mode print ''; } + // Project + if (! empty($conf->projet->enabled)){ + print ''; + } + // Mode of payment print ''; + print ''; } print '
'; //print ''; @@ -949,7 +949,7 @@ if ($resql) print ''. dol_print_date($objp->sellby,'day') .''; print $warehousestatic->getNomUrl(1); From 4e6ee4d12cb2449953556f7e6888f9dd5ee7d418 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:37:18 +0100 Subject: [PATCH 56/65] Fix dol_banner on card for lot --- .../product/stock/class/productlot.class.php | 29 ++++++++++++++++ htdocs/product/stock/productlot_card.php | 34 ++++--------------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 6128f8dcf17..1f97fa3f4d7 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -524,6 +524,35 @@ class Productlot extends CommonObject } } + + /** + * Return label of status of object + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut(0,$mode); + } + + /** + * Return label of a given status + * + * @param int $statut Status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label of status + */ + function LibStatut($statut,$mode=0) + { + global $langs; + + //$langs->load('stocks'); + + return ''; + } + + /** * Return a link to the a lot card (with optionaly the picto) * Use this->id,this->lastname, this->firstname diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 3407c75a6f5..0df3df3ac4f 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -270,24 +270,6 @@ llxHeader('','ProductLot',''); $form=new Form($db); -// Put here content of your page - -// Example : Adding jquery code -print ''; - - // Part to create if ($action == 'create') { @@ -335,19 +317,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $formconfirm; } - print ''."\n"; $linkback = '' . $langs->trans("BackToList") . ''; - // Ref - print ''; - print ''; - print ''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'batch'); + + print '
' . $langs->trans('Batch') . ''; - print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'batch'); - print '
'."\n"; // Product - print ''; print ''; @@ -364,7 +342,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Sell by print ''; print ''; From 910859145fbe27e5b7062c879d28a1febdb3fe87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:40:47 +0100 Subject: [PATCH 57/65] Fix filter on lot was lost --- htdocs/product/stock/mouvement.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 7c4b4dcab08..de46538a037 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -640,6 +640,7 @@ if ($resql) if ($search_inventorycode) $param.='&search_inventorycode='.urlencode($search_inventorycode); if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref); if ($search_product) $param.='&search_product='.urlencode($search_product); + if ($search_batch) $param.='&search_batch='.urlencode($search_batch); if ($search_warehouse > 0) $param.='&search_warehouse='.urlencode($search_warehouse); if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined From f06126c46318c877289772df2ac07f3d53c8f57d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:45:18 +0100 Subject: [PATCH 58/65] Fix style --- htdocs/product/stock/productlot_card.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 0df3df3ac4f..4d1b82307f8 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -322,7 +322,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'batch'); - print '
'.$langs->trans("Product").''; + print '
'.$langs->trans("Product").''; $producttmp = new Product($db); $producttmp->fetch($object->fk_product); print $producttmp->getNomUrl(1, 'stock'); @@ -356,7 +334,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Eat by print '
'; print $form->editfieldkey($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); - print ''; + print ''; print $form->editfieldval($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); print '
'; print $form->editfieldkey($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); - print ''; + print ''; print $form->editfieldval($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); print '
'."\n"; + print '
'; + print '
'; + + print '
'."\n"; // Product print '
'.$langs->trans("Product").''; @@ -353,6 +356,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; + print ''; + dol_fiche_end(); From 7103d7921e44584d9ab59ad5c28f9da7e4849d82 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 13:42:16 +0100 Subject: [PATCH 59/65] Uniformize look --- htdocs/product/traduction.php | 20 +++++++++++++++----- htdocs/theme/eldy/style.css.php | 5 +++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index e7986fde074..b5f4b8b34ae 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -244,8 +244,9 @@ if ($action == 'edit') foreach ($object->multilangs as $key => $value) { $s=picto_from_langcode($key); - print "
".($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '')."
"; + print "
".($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"')."
"; + print '
'; print ''; print ''; print ''; + print '
'; print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; @@ -263,6 +264,8 @@ if ($action == 'edit') } } + print '
'; + print '
'; print ''; print '     '; @@ -274,17 +277,20 @@ if ($action == 'edit') } else if ($action != 'add') { - if ($cnt_trans) print '
'; + //if ($cnt_trans) print '
'; if (! empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $s=picto_from_langcode($key); + //print '
'; + print ($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; + //print '
'; - print ''; print ''; - print ''; + print ''; if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { print ''; @@ -312,6 +318,8 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; + dol_fiche_head(); + print '
'.($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')'.$object->multilangs[$key]["other"].'
'; print '
'.$langs->trans('Language').''; print $formadmin->select_language('','forcelangprod',0,$object->multilangs,1); @@ -331,7 +339,9 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service } print '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 6c6869ce7d4..1f2f1a225e3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2559,10 +2559,11 @@ div.pagination li.paginationafterarrows { /* Set the color for hover lines */ -.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover +.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, +table.dataTable tr.even:hover, table.dataTable tr.odd:hover { - background-color: rgb() !important; + background: rgb() !important; /* Must be background to be stronger than background of odd or even */ } From c6c07bf9f4bbbc7e0aa15a191c0824844344f82b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 12 Mar 2017 14:32:49 +0100 Subject: [PATCH 60/65] New : Add project to social contributions --- htdocs/compta/sociales/card.php | 67 +++++++++++++++---- .../sociales/class/chargesociales.class.php | 42 +++++++----- htdocs/core/class/html.formprojet.class.php | 3 +- .../install/mysql/migration/5.0.0-6.0.0.sql | 2 + .../mysql/tables/llx_chargesociales.sql | 36 +++++----- htdocs/langs/en_US/compta.lang | 2 + htdocs/projet/element.php | 58 ++++++++++------ 7 files changed, 139 insertions(+), 71 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 92cb36059e4..76456aee99b 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2016 Frédéric France - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * * 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 @@ -28,6 +28,11 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} $langs->load("compta"); $langs->load("bills"); @@ -35,6 +40,7 @@ $langs->load("bills"); $id=GETPOST('id','int'); $action=GETPOST("action"); $confirm=GETPOST('confirm'); +$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); // Security check $socid = GETPOST('socid','int'); @@ -43,8 +49,6 @@ $result = restrictedArea($user, 'tax', $id, 'chargesociales','charges'); $object = new ChargeSociales($db); - - /* *************************************************************************** */ /* */ /* Actions */ @@ -122,6 +126,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer) $dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear')); $amount=price2num(GETPOST('amount')); $actioncode=GETPOST('actioncode'); + if (! $dateech) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors'); @@ -149,13 +154,14 @@ if ($action == 'add' && $user->rights->tax->charges->creer) } else { - $object->type=$actioncode; - $object->lib=GETPOST('label'); - $object->date_ech=$dateech; - $object->periode=$dateperiod; - $object->amount=$amount; - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->fk_account = GETPOST('fk_account', 'int'); + $object->type = $actioncode; + $object->lib = GETPOST('label'); + $object->date_ech = $dateech; + $object->periode = $dateperiod; + $object->amount = $amount; + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->fk_account = GETPOST('fk_account', 'int'); + $object->fk_project = GETPOST('fk_project'); $id=$object->create($user); if ($id <= 0) @@ -172,6 +178,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr $dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear')); $dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear')); $amount=price2num(GETPOST('amount')); + if (! $dateech) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors'); @@ -196,10 +203,11 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr { $result=$object->fetch($id); - $object->lib=GETPOST('label'); - $object->date_ech=$dateech; - $object->periode=$dateperiod; - $object->amount=price2num($amount); + $object->lib = GETPOST('label'); + $object->date_ech = $dateech; + $object->periode = $dateperiod; + $object->amount = price2num($amount); + $object->fk_project = GETPOST("fk_project"); $result=$object->update($user); if ($result <= 0) @@ -325,6 +333,21 @@ if ($action == 'create') print '
'.$langs->trans("Project").''; + + $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1); + + print '
' . $langs->trans('PaymentMode') . ''; $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); @@ -485,6 +508,22 @@ if ($id > 0) print '
'.$langs->trans("AmountTTC").''.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'
'; + print $langs->trans("Project"); + print ''; + if ($action == 'edit') { + $formproject=new FormProjets($db); + $numproject=$formproject->select_projects(-1,$object->fk_project,'fk_project',16,0,1,1); + } else { + $project=new Project($db); + $project->fetch($object->fk_project); + print $project->getNomUrl(1,'',1);; + } + print '
'; print ' - fetch($currcomb->fk_product_child); ?> - > - - - - - - - - - - + fetch($currcomb->fk_product_child); + ?> + > + + + + + + + + + + '; + } + ?>
'; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 61546b39061..dae1fe109ca 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2016 Frédéric France + * Copyright (C) 2017 Alexandre Spangaro * * 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 @@ -52,6 +53,7 @@ class ChargeSociales extends CommonObject var $date_modification; var $date_validation; var $fk_account; + var $fk_project; /** @@ -75,7 +77,7 @@ class ChargeSociales extends CommonObject function fetch($id, $ref='') { $sql = "SELECT cs.rowid, cs.date_ech"; - $sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode, cs.import_key"; + $sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; $sql.= ", cs.fk_account, cs.fk_mode_reglement"; $sql.= ", c.libelle"; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; @@ -93,20 +95,21 @@ class ChargeSociales extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; - $this->date_ech = $this->db->jdate($obj->date_ech); - $this->lib = $obj->lib; - $this->type = $obj->fk_type; - $this->type_libelle = $obj->libelle; - $this->fk_account = $obj->fk_account; - $this->mode_reglement_id = $obj->fk_mode_reglement; - $this->mode_reglement_code = $obj->mode_reglement_code; - $this->mode_reglement = $obj->mode_reglement_libelle; - $this->amount = $obj->amount; - $this->paye = $obj->paye; - $this->periode = $this->db->jdate($obj->periode); - $this->import_key = $this->import_key; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->date_ech = $this->db->jdate($obj->date_ech); + $this->lib = $obj->lib; + $this->type = $obj->fk_type; + $this->type_libelle = $obj->libelle; + $this->fk_account = $obj->fk_account; + $this->mode_reglement_id = $obj->fk_mode_reglement; + $this->mode_reglement_code = $obj->mode_reglement_code; + $this->mode_reglement = $obj->mode_reglement_libelle; + $this->amount = $obj->amount; + $this->fk_project = $obj->fk_project; + $this->paye = $obj->paye; + $this->periode = $this->db->jdate($obj->periode); + $this->import_key = $this->import_key; $this->db->free($resql); @@ -166,13 +169,15 @@ class ChargeSociales extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, entity, fk_user_author, date_creation)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, date_creation)"; $sql.= " VALUES (".$this->type; $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); $sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"NULL"); $sql.= ", '".$this->db->escape($this->lib)."'"; - $sql.= ", '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."'"; + $sql.= ", '".$this->db->idate($this->date_ech)."'"; + $sql.= ", '".$this->db->idate($this->periode)."'"; $sql.= ", '".price2num($newamount)."'"; + $sql.= ", ".($this->fk_project>0?$this->fk_project:'NULL'); $sql.= ", ".$conf->entity; $sql.= ", ".$user->id; $sql.= ", '".$this->db->idate($now)."'"; @@ -283,6 +288,7 @@ class ChargeSociales extends CommonObject $sql.= ", date_ech='".$this->db->idate($this->date_ech)."'"; $sql.= ", periode='".$this->db->idate($this->periode)."'"; $sql.= ", amount='".price2num($this->amount,'MT')."'"; + $sql.= ", fk_projet='".$this->db->escape($this->fk_project)."'"; $sql.= ", fk_user_modif=".$user->id; $sql.= " WHERE rowid=".$this->id; @@ -302,7 +308,7 @@ class ChargeSociales extends CommonObject } /** - * Enter description here ... + * Calculate amount remaining to pay by year * * @param int $year Year * @return number diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 571b24bca52..0a6837ecb53 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -464,7 +464,7 @@ class FormProjets if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done) $linkedtothirdparty=false; - if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement'))) $linkedtothirdparty=true; + if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true; $sqlfilter=''; $projectkey="fk_projet"; @@ -507,6 +507,7 @@ class FormProjets $sql = 'SELECT t.rowid, t.label as ref'; $projectkey='fk_origin'; break; + case "chargesociales": default: $sql = "SELECT t.rowid, t.ref"; break; diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 0dfc5f36925..e6d525df983 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -114,3 +114,5 @@ UPDATE llx_const set value='moono-lisa' where value = 'moono' AND name = 'FCKEDI ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx; ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx; +ALTER TABLE llx_chargesociales ADD COLUMN fk_projet integer DEFAULT NULL; + diff --git a/htdocs/install/mysql/tables/llx_chargesociales.sql b/htdocs/install/mysql/tables/llx_chargesociales.sql index 95ab50661b6..5c07c9a74fc 100644 --- a/htdocs/install/mysql/tables/llx_chargesociales.sql +++ b/htdocs/install/mysql/tables/llx_chargesociales.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2005-2009 Regis Houssin +-- Copyright (C) 2017 Alexandre Spangaro -- -- 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 @@ -19,23 +20,24 @@ create table llx_chargesociales ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - date_ech datetime NOT NULL, -- date echeance - libelle varchar(80) NOT NULL, - entity integer DEFAULT 1 NOT NULL, -- multi company id - tms timestamp, - date_creation datetime, -- date de creation - date_valid datetime, -- date de validation - fk_user_author integer, -- user making creation - fk_user_modif integer, -- user making last change - fk_user_valid integer, -- user validating - fk_type integer NOT NULL, - fk_account integer, -- bank account - fk_mode_reglement integer, -- mode de reglement - amount real default 0 NOT NULL, - paye smallint default 0 NOT NULL, - periode date, - import_key varchar(14) + rowid integer AUTO_INCREMENT PRIMARY KEY, + date_ech datetime NOT NULL, -- date echeance + libelle varchar(80) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + tms timestamp, + date_creation datetime, -- date de creation + date_valid datetime, -- date de validation + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating + fk_type integer NOT NULL, + fk_account integer, -- bank account + fk_mode_reglement integer, -- mode de reglement + amount real default 0 NOT NULL, + paye smallint default 0 NOT NULL, + periode date, + fk_projet integer DEFAULT NULL, + import_key varchar(14) )ENGINE=innodb; -- diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index eca26d337c2..aa5f2195a56 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -56,6 +56,7 @@ MenuTaxAndDividends=Taxes and dividends MenuSocialContributions=Social/fiscal taxes MenuNewSocialContribution=New social/fiscal tax NewSocialContribution=New social/fiscal tax +AddSocialContribution=Add social/fiscal tax ContributionsToPay=Social/fiscal taxes to pay AccountancyTreasuryArea=Accountancy/Treasury area NewPayment=New payment @@ -205,3 +206,4 @@ ImportDataset_tax_contrib=Social/fiscal taxes ImportDataset_tax_vat=Vat payments ErrorBankAccountNotFound=Error: Bank account not found FiscalPeriod=Accounting period +ListSocialContributionAssociatedProject=List of social contributions associated with the project diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 69dde026c9b..89bab45896f 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012-2016 Juanjo Menent - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Josep Lluís Amador * @@ -34,25 +34,27 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; -if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; -if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; -if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; -if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; -if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; +if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; +if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; $langs->load("projects"); $langs->load("companies"); $langs->load("suppliers"); +$langs->load("compta"); if (! empty($conf->facture->enabled)) $langs->load("bills"); if (! empty($conf->commande->enabled)) $langs->load("orders"); if (! empty($conf->propal->enabled)) $langs->load("propal"); @@ -406,7 +408,20 @@ $listofreferent=array( 'table'=>'stock_mouvement', 'datefieldname'=>'datem', 'disableamount'=>0, - 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))) + 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))), +'chargesociales'=>array( + 'name'=>"SocialContribution", + 'title'=>"ListSocialContributionAssociatedProject", + 'class'=>'ChargeSociales', + 'margin'=>'add', + 'table'=>'chargesociales', + 'datefieldname'=>'date_ech', + 'disableamount'=>0, + 'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id, + 'lang'=>'compta', + 'buttonnew'=>'AddSocialContribution', + 'testnew'=>$user->rights->tax->charges->lire, + 'test'=>$conf->tax->enabled && $user->rights->tax->charges->lire) /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", @@ -539,7 +554,7 @@ foreach ($listofreferent as $key => $value) // Special cases if ($tablename != 'expensereport_det' && method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty(); - if ($tablename == 'don') $total_ht_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount; elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') { @@ -564,7 +579,7 @@ foreach ($listofreferent as $key => $value) if ($qualifiedfortotal) $total_ht = $total_ht + $total_ht_by_line; - if ($tablename == 'don') $total_ttc_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount; elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') { @@ -865,9 +880,10 @@ foreach ($listofreferent as $key => $value) $date=''; $total_time_by_line = null; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif ($tablename == 'stock_mouvement') $date = $element->datem; + if ($tablename == 'chargesociales') $date = $element->date_ech; elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) { - if ($tablename=='don') $date = $element->datedon; + if ($tablename == 'don') $date = $element->datedon; if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') { $date=($element->date_commande?$element->date_commande:$element->date_valid); @@ -927,7 +943,7 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_line=null; $othermessage=''; - if ($tablename == 'don') $total_ht_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount; elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); elseif (in_array($tablename, array('projet_task'))) { @@ -967,7 +983,7 @@ foreach ($listofreferent as $key => $value) if (empty($value['disableamount'])) { $total_ttc_by_line=null; - if ($tablename == 'don') $total_ttc_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount; elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') { From e8a1f0ba46ed8272b123170feaa0a0ffa137f9a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Mar 2017 17:10:32 +0100 Subject: [PATCH 61/65] Uniformize code --- htdocs/variants/combinations.php | 71 +++++++++++++++++++------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 03e45a328e8..dabace75ac0 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -615,35 +615,48 @@ if (! empty($id) || ! empty($ref)) { trans('OnBuy') ?>
getNomUrl(1) ?> - fetchByFkCombination($currcomb->id); - $iMax = count($productCombination2ValuePairs); - - for ($i = 0; $i < $iMax; $i++) { - echo dol_htmlentities($productCombination2ValuePairs[$i]); - - if ($i !== ($iMax - 1)) { - echo ', '; - } - } ?> - variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?>variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?>getLibStatut(2, 0) ?>getLibStatut(2, 1) ?> - - -
getNomUrl(1) ?> + fetchByFkCombination($currcomb->id); + $iMax = count($productCombination2ValuePairs); + + for ($i = 0; $i < $iMax; $i++) { + echo dol_htmlentities($productCombination2ValuePairs[$i]); + + if ($i !== ($iMax - 1)) { + echo ', '; + } + } ?> + variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?>variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?>getLibStatut(2, 0) ?>getLibStatut(2, 1) ?> + + +
'.$langs->trans("None").'
From 520bdac5109ae86112f1a8f8248d8f24891a978a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Mar 2017 01:35:04 +0100 Subject: [PATCH 62/65] Translation --- htdocs/core/modules/modNotification.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index c29c77b8f24..72c90ca7a6d 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -44,7 +44,7 @@ class modNotification extends DolibarrModules $this->family = "technic"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); - $this->description = "Gestion des notifications (par mail) sur evenement Dolibarr"; + $this->description = "EMail notifications (push) on business Dolibarr events"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 1; From b8b32ae2e34805bebc26928dd27a17457c135629 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Mar 2017 02:10:22 +0100 Subject: [PATCH 63/65] FIX colspan --- htdocs/societe/rib.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 65bd12b2be4..feea1aca0ce 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -359,14 +359,16 @@ if ($socid && $action != 'edit' && $action != "create") print load_fiche_titre($langs->trans("DefaultRIB"), '', ''); + print '
'; print '
'; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; // Show fields of bank account foreach($account->getFieldsToShow(1) as $val) @@ -407,24 +409,24 @@ if ($socid && $action != 'edit' && $action != "create") } print ''; - print ''; + print ''; print ''; } - print '\n"; - print '\n"; - print '\n"; print '
'.$langs->trans("LabelRIB").''.$account->label.'
'.$account->label.'
'.$langs->trans("BankName").''.$account->bank.'
'.$account->bank.'
'.$langs->trans($val).''.$content.''.$content.'
'.$langs->trans("BankAccountDomiciliation").''; + print '
'.$langs->trans("BankAccountDomiciliation").''; print $account->domiciliation; print "
'.$langs->trans("BankAccountOwner").''; + print '
'.$langs->trans("BankAccountOwner").''; print $account->proprio; print "
'.$langs->trans("BankAccountOwnerAddress").''; + print '
'.$langs->trans("BankAccountOwnerAddress").''; print $account->owner_address; print "
'; - + print '
'; print '
'; @@ -611,7 +613,7 @@ if ($socid && $action != 'edit' && $action != "create") { $colspan=8; if (! empty($conf->prelevement->enabled)) $colspan+=2; - print '
'.$langs->trans("NoBANRecord").'
'.$langs->trans("NoBANRecord").'
'; From ca80c588532b718b79f794d3bbb85595400995bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Mar 2017 02:14:42 +0100 Subject: [PATCH 64/65] Fix PHP error --- htdocs/core/ajax/box.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index fbb8fc759ad..7826747769b 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -73,7 +73,7 @@ if ($boxorder && $zone != '' && $userid > 0) if ($result > 0) { $langs->load("boxes"); - if (empty(GETPOST('closing'))) + if (! GETPOST('closing')) { setEventMessages($langs->trans("BoxAdded"), null); } From 14ed67499ed9e612e5a80444e61ee4d79fd10391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Tue, 14 Mar 2017 00:26:47 +0100 Subject: [PATCH 65/65] FIX html tag Fix incorrect html tag not closed --- htdocs/societe/tpl/linesalesrepresentative.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 0c3dd0656b8..d8d4b4b08bb 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -3,7 +3,7 @@ print '
'; print '
'; print $langs->trans('SalesRepresentatives'); - print ''; + print ''; if ($user->rights->societe->creer && $user->rights->societe->client->voir) print ''.img_edit('',1).''; else