From c3f07dd2e08bd6b8cf67da2b76b1577d98de5014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Oct 2018 19:28:52 +0200 Subject: [PATCH 01/90] define $code for all execution paths --- htdocs/societe/class/societe.class.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 729995a81d0..de5ce919a64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1837,24 +1837,28 @@ class Societe extends CommonObject if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { + $code = ''; if (($this->client) && (! empty ( $this->code_client )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 ) - ) - $code = $this->code_client . ' - '; + ) { + $code .= $this->code_client . ' - '; + } if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 ) - ) - $code .= $this->code_fournisseur . ' - '; + ) { + $code .= $this->code_fournisseur . ' - '; + } - if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) - $name =$code.' '.$name; - else - $name =$code; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) { + $name = $code.' '.$name; + } else { + $name = $code; + } } if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')'; From 62c602e8216e1856298db6c0071463d0ef8ee083 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 08:50:23 +0200 Subject: [PATCH 02/90] Standardize and update code --- htdocs/contrat/class/contrat.class.php | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2bcb802000f..398da806c2d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2519,8 +2519,16 @@ class ContratLigne extends CommonObjectLine public $tms; + /** + * @var int ID + */ public $fk_contrat; + + /** + * @var int ID + */ public $fk_product; + public $statut; // 0 inactive, 4 active, 5 closed public $type; // 0 for product, 1 for service @@ -2563,6 +2571,10 @@ class ContratLigne extends CommonObjectLine public $qty; public $remise_percent; public $remise; + + /** + * @var int ID + */ public $fk_remise_except; public $subprice; // Unit price HT @@ -2582,13 +2594,30 @@ class ContratLigne extends CommonObjectLine public $total_localtax2; public $total_ttc; + /** + * @var int ID + */ public $fk_fournprice; + public $pa_ht; public $info_bits; + + /** + * @var int ID + */ public $fk_user_author; + + /** + * @var int ID + */ public $fk_user_ouverture; + + /** + * @var int ID + */ public $fk_user_cloture; + public $commentaire; const STATUS_INITIAL = 0; From 69379dc2bb7b032a8564ac9c7b27f0d57258b218 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 09:12:25 +0200 Subject: [PATCH 03/90] Standardize and update code --- htdocs/core/class/comment.class.php | 3 ++ htdocs/core/class/discount.class.php | 46 ++++++++++++++++++---------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 287d260f4d2..161ce438e29 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -47,6 +47,9 @@ class Comment extends CommonObject public $datec; + /** + * @var int ID + */ public $fk_user_author; /** diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 6f6e3a09041..067b1f87e57 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -34,9 +34,9 @@ class DiscountAbsolute public $db; /** - * @var string Error code (or message) - */ - public $error; + * @var string Error code (or message) + */ + public $error; /** * @var string[] Array of error strings @@ -48,9 +48,9 @@ class DiscountAbsolute */ public $id; - /** - * @var int Thirdparty ID - */ + /** + * @var int Thirdparty ID + */ public $fk_soc; public $discount_type; // 0 => customer discount, 1 => supplier discount @@ -60,20 +60,34 @@ class DiscountAbsolute public $tva_tx; // Vat rate /** - * @var int User ID Id utilisateur qui accorde la remise - */ - public $fk_user; + * @var int User ID Id utilisateur qui accorde la remise + */ + public $fk_user; /** - * @var string description - */ - public $description; + * @var string description + */ + public $description; public $datec; // Date creation - public $fk_facture_line; // Id invoice line when a discount is used into an invoice line (for absolute discounts) - public $fk_facture; // Id invoice when a discount line is used into an invoice (for credit note) - public $fk_facture_source; // Id facture avoir a l'origine de la remise - public $ref_facture_source; // Ref facture avoir a l'origine de la remise + + /** + * @var int ID invoice line when a discount is used into an invoice line (for absolute discounts) + */ + public $fk_facture_line; + + /** + * @var int ID invoice when a discount line is used into an invoice (for credit note) + */ + public $fk_facture; + + /** + * @var int ID credit note having caused the discount + */ + public $fk_facture_source; + + public $ref_facture_source; // Ref credit note having caused the discount + public $ref_invoice_supplier_source; /** From 90cb6150c41581b5476da5d858b9000205d1d31e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 09:16:01 +0200 Subject: [PATCH 04/90] Standardize and update code --- htdocs/core/class/html.formticket.class.php | 4 ++++ htdocs/core/class/menubase.class.php | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 5d2136bd236..6c4a9703014 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -45,6 +45,10 @@ class FormTicket public $db; public $track_id; + + /** + * @var int ID + */ public $fk_user_create; public $message; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 7db88051e5e..0daf4fe56da 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -52,9 +52,22 @@ class Menubase public $module; public $type; public $mainmenu; + + /** + * @var int ID + */ public $fk_menu; + + /** + * @var int ID + */ public $fk_mainmenu; + + /** + * @var int ID + */ public $fk_leftmenu; + public $position; public $url; public $target; From c2f73ddf1382a737c46f57a5567be02e257da304 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 09:20:50 +0200 Subject: [PATCH 05/90] Standardize and update code --- htdocs/cron/class/cronjob.class.php | 17 +++++++++++++++++ htdocs/don/class/don.class.php | 9 +++++++++ htdocs/don/class/paymentdonation.class.php | 16 ++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 26b17016a5f..a71088f3286 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -83,8 +83,17 @@ class Cronjob extends CommonObject public $status; public $processing; + + /** + * @var int ID + */ public $fk_user_author; + + /** + * @var int ID + */ public $fk_user_mod; + public $nbrun; public $libname; public $test; // A test condition to know if job is visible/qualified @@ -1390,8 +1399,16 @@ class Cronjobline */ public $status; + /** + * @var int ID + */ public $fk_user_author; + + /** + * @var int ID + */ public $fk_user_mod; + public $note; public $nbrun; public $libname; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index ed9c629a50d..6abd093c8c3 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -73,8 +73,17 @@ class Don extends CommonObject public $town; public $email; public $public; + + /** + * @var int ID + */ public $fk_project; + + /** + * @var int ID + */ public $fk_typepayment; + public $num_payment; public $date_valid; public $modepaymentid = 0; diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 69c6e8b5501..b0e3a80b082 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -49,7 +49,11 @@ class PaymentDonation extends CommonObject */ public $rowid; + /** + * @var int ID + */ public $fk_donation; + public $datec=''; public $tms=''; public $datep=''; @@ -57,8 +61,20 @@ class PaymentDonation extends CommonObject public $amounts=array(); // Array of amounts public $typepayment; public $num_payment; + + /** + * @var int ID + */ public $fk_bank; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; /** From 15fee5497570cad2b4f56880fdf7f7536e76b748 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 09:23:55 +0200 Subject: [PATCH 06/90] Standardize and update code --- htdocs/ecm/class/ecmdirectory.class.php | 11 +++++++++++ htdocs/ecm/class/ecmfiles.class.php | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index f477e27b37b..9038b74cb2a 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -52,6 +52,9 @@ class EcmDirectory // extends CommonObject */ public $label; + /** + * @var int ID + */ public $fk_parent; /** @@ -62,7 +65,15 @@ class EcmDirectory // extends CommonObject public $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' public $date_c; public $date_m; + + /** + * @var int ID + */ public $fk_user_m; + + /** + * @var int ID + */ public $fk_user_c; /** diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 50dbcb60dc6..42af7f92635 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -85,8 +85,17 @@ class EcmFiles extends CommonObject public $extraparams; public $date_c = ''; public $date_m = ''; + + /** + * @var int ID + */ public $fk_user_c; + + /** + * @var int ID + */ public $fk_user_m; + public $acl; public $src_object_type; public $src_object_id; @@ -879,8 +888,17 @@ class EcmfilesLine public $extraparams; public $date_c = ''; public $date_m = ''; + + /** + * @var int ID + */ public $fk_user_c; + + /** + * @var int ID + */ public $fk_user_m; + public $acl; public $src_object_type; public $src_object_id; From b2826966e4bfce9b370a6db9a7221e26fbd5dc34 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 11:30:33 +0200 Subject: [PATCH 07/90] Standardize and update code --- htdocs/expedition/class/expedition.class.php | 3 +++ .../class/expensereport.class.php | 15 +++++++++++++ .../class/paymentexpensereport.class.php | 22 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 7b764e32093..57a1c8aa6b9 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2343,6 +2343,9 @@ class ExpeditionLigne extends CommonObjectLine */ public $table_element='expeditiondet'; + /** + * @var int ID + */ public $fk_origin_line; /** diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 4fbca221d65..6cc7b13ee7c 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2426,9 +2426,24 @@ class ExpenseReportLine public $value_unit; public $date; + /** + * @var int ID + */ public $fk_c_type_fees; + + /** + * @var int ID + */ public $fk_c_exp_tax_cat; + + /** + * @var int ID + */ public $fk_projet; + + /** + * @var int ID + */ public $fk_expensereport; public $type_fees_code; diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 1dd5048991c..35f1fef7b5b 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -50,17 +50,39 @@ class PaymentExpenseReport extends CommonObject */ public $rowid; + /** + * @var int ID + */ public $fk_expensereport; + public $datec=''; public $tms=''; public $datep=''; public $amount; // Total amount of payment public $amounts=array(); // Array of amounts + + /** + * @var int ID + */ public $fk_typepayment; + public $num_payment; + + /** + * @var int ID + */ public $fk_bank; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; + //Unknow field public $chid; public $total; From 9b6367c1ee030e7fe08c3fcc5c3354f21bc622d1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 10 Oct 2018 12:16:20 +0200 Subject: [PATCH 08/90] Standardize and update code --- htdocs/fichinter/class/fichinter.class.php | 12 +++++++ .../class/fournisseur.commande.class.php | 21 +++++++++++++ .../fournisseur.commande.dispatch.class.php | 16 ++++++++++ .../fourn/class/fournisseur.facture.class.php | 31 ++++++++++++++++++- .../fourn/class/fournisseur.product.class.php | 11 ++++++- 5 files changed, 89 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 48cbdbf7715..d8be14c298a 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -82,8 +82,16 @@ class Fichinter extends CommonObject */ public $description; + /** + * @var int ID + */ public $fk_contrat = 0; + + /** + * @var int ID + */ public $fk_project = 0; + public $extraparams=array(); public $lines = array(); @@ -1360,7 +1368,11 @@ class FichinterLigne extends CommonObjectLine public $error=''; // From llx_fichinterdet + /** + * @var int ID + */ public $fk_fichinter; + public $desc; // Description ligne public $datei; // Date intervention public $duration; // Duree de l'intervention diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b52fd4a4a58..ce9665cc6c8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -128,10 +128,20 @@ class CommandeFournisseur extends CommonOrder public $note_private; public $note_public; public $model_pdf; + + /** + * @var int ID + */ public $fk_project; + public $cond_reglement_id; public $cond_reglement_code; + + /** + * @var int ID + */ public $fk_account; + public $mode_reglement_id; public $mode_reglement_code; public $user_author_id; @@ -157,7 +167,11 @@ class CommandeFournisseur extends CommonOrder public $linked_objects=array(); // Multicurrency + /** + * @var int ID + */ public $fk_multicurrency; + public $multicurrency_code; public $multicurrency_tx; public $multicurrency_total_ht; @@ -3154,7 +3168,14 @@ class CommandeFournisseurLigne extends CommonOrderLine public $fk_commande; // From llx_commande_fournisseurdet + /** + * @var int ID + */ public $fk_parent_line; + + /** + * @var int ID + */ public $fk_facture; /** diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 76d3e6e0d96..2bcdce36b3c 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -65,10 +65,26 @@ class CommandeFournisseurDispatch extends CommonObject */ public $id; + /** + * @var int ID + */ public $fk_commande; + + /** + * @var int ID + */ public $fk_product; + + /** + * @var int ID + */ public $fk_commandefourndet; + public $qty; + + /** + * @var int ID + */ public $fk_entrepot; /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e3943ed7415..f4c37a1113c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -138,7 +138,12 @@ class FactureFournisseur extends CommonInvoice public $propalid; public $cond_reglement_id; public $cond_reglement_code; + + /** + * @var int ID + */ public $fk_account; + public $mode_reglement_id; public $mode_reglement_code; @@ -153,21 +158,31 @@ class FactureFournisseur extends CommonInvoice */ public $fournisseur; - //Incorterms + /** + * @var int ID Incorterms + */ public $fk_incoterms; + public $location_incoterms; public $libelle_incoterms; //Used into tooltip public $extraparams=array(); // Multicurrency + /** + * @var int ID + */ public $fk_multicurrency; + public $multicurrency_code; public $multicurrency_tx; public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; //! id of source invoice if replacement invoice or credit note + /** + * @var int ID + */ public $fk_facture_source; /** @@ -2722,18 +2737,32 @@ class SupplierInvoiceLine extends CommonObjectLine public $total_ttc; public $total_localtax1; public $total_localtax2; + + /** + * @var int ID + */ public $fk_product; + public $product_type; public $product_label; public $info_bits; + + /** + * @var int ID + */ public $fk_parent_line; + public $special_code; public $rang; public $localtax1_type; public $localtax2_type; // Multicurrency + /** + * @var int ID + */ public $fk_multicurrency; + public $multicurrency_code; public $multicurrency_subprice; public $multicurrency_total_ht; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index f97a6c4f4ba..a86e728e028 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -72,12 +72,21 @@ class ProductFournisseur extends Product public $fourn_remise_percent; // discount for quantity (percent) public $fourn_remise; // discount for quantity (amount) public $product_fourn_id; // supplier id - public $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) + + /** + * @var int ID availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) + */ + public $fk_availability; + public $fourn_unitprice; public $fourn_tva_tx; public $fourn_tva_npr; + /** + * @var int ID + */ public $fk_supplier_price_expression; + public $supplier_reputation; // reputation of supplier public $reputations=array(); // list of available supplier reputations From 8fc4e2066f483965a7811f642c5d0a2e358b4c1f Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 10 Oct 2018 18:18:02 +0200 Subject: [PATCH 09/90] FIX : position 0 for emails templates Closes #9548 #8737 #9478 --- htdocs/admin/mails_templates.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 394742c7d2a..206191f5967 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -319,10 +319,11 @@ if (empty($reshook)) if ($i) $sql.=","; $sql.= $field."="; -// print $keycode.' - '.$_POST[$keycode].'
'; - if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1 + //print $keycode.' - '.$_POST[$keycode].'
'; + if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1 + elseif ($keycode == 'position') $sql.=((int) $_POST[$keycode]); else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } From dd515c9cace1339f897d801230bc702af042e5f2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 11 Oct 2018 09:22:03 +0200 Subject: [PATCH 10/90] Standardize and update code --- htdocs/holiday/class/holiday.class.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index fe90f85b6a4..a888a4919a6 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -79,14 +79,38 @@ class Holiday extends CommonObject public $date_fin_gmt=''; // Date end in GMT public $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning public $statut=''; // 1=draft, 2=validated, 3=approved + + /** + * @var int ID + */ public $fk_validator; + public $date_valid=''; + + /** + * @var int ID + */ public $fk_user_valid; + public $date_refuse=''; + + /** + * @var int ID + */ public $fk_user_refuse; + public $date_cancel=''; + + /** + * @var int ID + */ public $fk_user_cancel; + public $detail_refuse=''; + + /** + * @var int ID + */ public $fk_type; public $holiday = array(); From c2646886357468181cc36d6c1c39961659b96611 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 11 Oct 2018 09:53:36 +0200 Subject: [PATCH 11/90] Standardize and update code --- htdocs/loan/class/loan.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index dd066f0064c..e9f5fbfff72 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -66,9 +66,25 @@ class Loan extends CommonObject public $date_creation; public $date_modification; public $date_validation; + + /** + * @var int ID + */ public $fk_bank; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; + + /** + * @var int ID + */ public $fk_project; From ee225a2b8bc7f714e82ac8fb46e3b142a14cc433 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 11 Oct 2018 10:14:22 +0200 Subject: [PATCH 12/90] FIX situation prev percent --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8834d93d162..bf84114129f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1535,6 +1535,7 @@ if (empty($reshook)) { $line->origin = $object->origin; $line->origin_id = $line->id; + $line->fk_prev_id = $line->id; $line->fetch_optionals($line->id); $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note From 92686100b23d63c25865e49a4aac01b0d1ad74df Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 11 Oct 2018 10:51:54 +0200 Subject: [PATCH 13/90] Fix count on no countable object --- htdocs/compta/facture/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8834d93d162..aeb145a7ea2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3250,8 +3250,7 @@ if ($action == 'create') print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); // We check if Origin document (id and type is known) has already at least one invoice attached to it $objectsrc->fetchObjectLinked($originid,$origin,'','facture'); - $cntinvoice=count($objectsrc->linkedObjects['facture']); - if ($cntinvoice>=1) + if(!empty($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture'])) { setEventMessages('WarningBillExist', null, 'warnings'); echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; From ced40384436d3c94e87910cce049c100a31bee49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 11:56:52 +0200 Subject: [PATCH 14/90] FIX qty not visible for a lot when making shipment on a dedicated stock --- ChangeLog | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/expedition/card.php | 19 +++--- htdocs/expedition/class/expedition.class.php | 18 +++--- .../class/expeditionbatch.class.php | 58 +++++++++---------- 6 files changed, 51 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d1bbfbf379..2449730bf8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -86,7 +86,7 @@ NEW: Add a tab to specify accountant/auditor of the company NEW: Add Date delivery and Availability on Propals List NEW: Add date in goods reception supplier order table NEW: Add delivery_time_days of suppliers in export profile -NEW: Add Docments'tab to expedition module +NEW: Add Documents'tab to expedition module NEW: Use dol_print_phone in thirdparty list page to format phone NEW: Add entry for the GDPR contact NEW: Add extrafield type "html" diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 671a3d6cbc3..73de27cafac 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1376,7 +1376,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if ($detail->eatby) $dte[]=$outputlangs->transnoentitiesnoconv('printEatby',dol_print_date($detail->eatby, $format, false, $outputlangs)); if ($detail->sellby) $dte[]=$outputlangs->transnoentitiesnoconv('printSellby',dol_print_date($detail->sellby, $format, false, $outputlangs)); if ($detail->batch) $dte[]=$outputlangs->transnoentitiesnoconv('printBatch',$detail->batch); - $dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->dluo_qty); + $dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->qty); $libelleproduitservice.= "__N__ ".implode(" - ", $dte); } } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 71c287f7119..b79b1d094da 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -364,7 +364,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='') $detail.= $langs->trans("Batch").': '.$dbatch->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; $detail.= '
'; } print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 49bded5a45b..0f45ca61804 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -649,7 +649,7 @@ if (empty($reshook)) $qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id; $batch_id = GETPOST($batch,'int'); $batch_qty = GETPOST($qty, 'int'); - if (! empty($batch_id) && ($batch_id != $detail_batch->fk_origin_stock || $batch_qty != $detail_batch->dluo_qty)) + if (! empty($batch_id) && ($batch_id != $detail_batch->fk_origin_stock || $batch_qty != $detail_batch->qty)) { if ($lotStock->fetch($batch_id) > 0 && $line->fetch($detail_batch->fk_expeditiondet) > 0) // $line is ExpeditionLine { @@ -666,7 +666,7 @@ if (empty($reshook)) $line->detail_batch->batch = $lotStock->batch; $line->detail_batch->id = $detail_batch->id; $line->detail_batch->entrepot_id = $lotStock->warehouseid; - $line->detail_batch->dluo_qty = $batch_qty; + $line->detail_batch->qty = $batch_qty; if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; @@ -720,7 +720,7 @@ if (empty($reshook)) $line->detail_batch->fk_origin_stock = $batch_id; $line->detail_batch->batch = $lotStock->batch; $line->detail_batch->entrepot_id = $lotStock->warehouseid; - $line->detail_batch->dluo_qty = $batch_qty; + $line->detail_batch->qty = $batch_qty; if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; @@ -741,7 +741,7 @@ if (empty($reshook)) $line->detail_batch[0]->fk_origin_stock = $batch_id; $line->detail_batch[0]->batch = $lotStock->batch; $line->detail_batch[0]->entrepot_id = $lotStock->warehouseid; - $line->detail_batch[0]->dluo_qty = $batch_qty; + $line->detail_batch[0]->qty = $batch_qty; if ($object->create_line_batch($line, $line->array_options) < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1306,6 +1306,7 @@ if ($action == 'create') { // Product need lot print ''; // end line and start a new one for lot/serial + print ''; $staticwarehouse=new Entrepot($db); if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id); @@ -1323,7 +1324,7 @@ if ($action == 'create') print ''; if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) { - foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) + foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) // $dbatch is instance of Productbatch { //var_dump($dbatch); $batchStock = + $dbatch->qty; // To get a numeric @@ -1344,7 +1345,7 @@ if ($action == 'create') $detail.= $langs->trans("Batch").': '.$dbatch->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; $detail.= '
'; print $detail; @@ -2242,7 +2243,7 @@ else if ($id || $ref) { print ''; // Qty to ship or shipped - print '' . '' . ''; + print '' . '' . ''; // Batch number managment if ($lines[$i]->entrepot_id == 0) { @@ -2354,12 +2355,12 @@ else if ($id || $ref) if ($lines[$i]->product_tobatch) { $detail = ''; - foreach ($lines[$i]->detail_batch as $dbatch) + foreach ($lines[$i]->detail_batch as $dbatch) // $dbatch is instance of ExpeditionLineBatch { $detail.= $langs->trans("Batch").': '.$dbatch->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; $detail.= '
'; } print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5728d60932a..5848c1b9d9d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -415,7 +415,7 @@ class Expedition extends CommonObject { if ($detbatch->entrepot_id) { - $stockLocationQty[$detbatch->entrepot_id] += $detbatch->dluo_qty; + $stockLocationQty[$detbatch->entrepot_id] += $detbatch->qty; } } // create shipment lines @@ -931,7 +931,7 @@ class Expedition extends CommonObject $this->error=$linebatch->error; return -1; } - $linebatch->dluo_qty=$value['q']; + $linebatch->qty=$value['q']; $tab[]=$linebatch; if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) @@ -940,7 +940,7 @@ class Expedition extends CommonObject $prod_batch = new Productbatch($this->db); $prod_batch->fetch($value['id_batch']); - if ($prod_batch->qty < $linebatch->dluo_qty) + if ($prod_batch->qty < $linebatch->qty) { $langs->load("errors"); $this->errors[]=$langs->trans('ErrorStockIsNotEnoughToAddProductOnShipment', $prod_batch->fk_product); @@ -1164,7 +1164,7 @@ class Expedition extends CommonObject // We use warehouse selected for each line foreach($lotArray as $lot) { - $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->dluo_qty, 0, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); // Price is set to 0, because we don't want to see WAP changed + $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->qty, 0, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); // Price is set to 0, because we don't want to see WAP changed if ($result < 0) { $error++;$this->errors=$this->errors + $mouvS->errors; @@ -2572,7 +2572,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[]='ErrorBadParameters'; $error++; } - $qty = price2num($this->detail_batch[0]->dluo_qty); + $qty = price2num($this->detail_batch[0]->qty); } } else if (! empty($this->detail_batch)) @@ -2586,7 +2586,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[]='ErrorBadParameters'; $error++; } - $qty = price2num($this->detail_batch->dluo_qty); + $qty = price2num($this->detail_batch->qty); } // check parameters @@ -2624,7 +2624,7 @@ class ExpeditionLigne extends CommonObjectLine { if ($expedition_batch_id != $lot->id) { - $remainingQty += $lot->dluo_qty; + $remainingQty += $lot->qty; } } $qty += $remainingQty; @@ -2652,7 +2652,7 @@ class ExpeditionLigne extends CommonObjectLine $error++; } } - if (! $error && $this->detail_batch->dluo_qty > 0) + if (! $error && $this->detail_batch->qty > 0) { // create lot expedition line if (isset($lot->id)) @@ -2662,7 +2662,7 @@ class ExpeditionLigne extends CommonObjectLine $shipmentLot->eatby = $lot->eatby; $shipmentLot->sellby = $lot->sellby; $shipmentLot->entrepot_id = $this->detail_batch->entrepot_id; - $shipmentLot->dluo_qty = $this->detail_batch->dluo_qty; + $shipmentLot->qty = $this->detail_batch->qty; $shipmentLot->fk_origin_stock = $batch_id; if ($shipmentLot->create($this->id) < 0) { diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index d94baee2a43..227566d8382 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -34,7 +34,7 @@ class ExpeditionLineBatch extends CommonObject var $sellby; var $eatby; var $batch; - var $dluo_qty; + var $qty; var $entrepot_id; var $fk_origin_stock; var $fk_expeditiondet; @@ -58,41 +58,41 @@ class ExpeditionLineBatch extends CommonObject */ function fetchFromStock($id_stockdluo) { - $sql = "SELECT"; - $sql.= " pb.batch,"; - $sql.= " pl.sellby,"; - $sql.= " pl.eatby,"; - $sql.= " ps.fk_entrepot"; + $sql = "SELECT"; + $sql.= " pb.batch,"; + $sql.= " pl.sellby,"; + $sql.= " pl.eatby,"; + $sql.= " ps.fk_entrepot"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; - $sql.= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product"; - $sql.= " WHERE pb.rowid = ".(int) $id_stockdluo; + $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; + $sql.= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid"; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product"; + $sql.= " WHERE pb.rowid = ".(int) $id_stockdluo; - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); $this->sellby = $this->db->jdate($obj->sellby); $this->eatby = $this->db->jdate($obj->eatby); $this->batch = $obj->batch; $this->entrepot_id= $obj->fk_entrepot; $this->fk_origin_stock=(int) $id_stockdluo; - } - $this->db->free($resql); + } + $this->db->free($resql); - return 1; - } - else - { - $this->error="Error ".$this->db->lasterror(); - return -1; - } - } + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + return -1; + } + } /** * Create an expeditiondet_batch DB record link to an expedtiondet record @@ -118,7 +118,7 @@ class ExpeditionLineBatch extends CommonObject $sql.= " ".(! isset($this->sellby) || dol_strlen($this->sellby)==0?'NULL':("'".$this->db->idate($this->sellby))."'").","; $sql.= " ".(! isset($this->eatby) || dol_strlen($this->eatby)==0?'NULL':("'".$this->db->idate($this->eatby))."'").","; $sql.= " ".(! isset($this->batch)?'NULL':("'".$this->db->escape($this->batch)."'")).","; - $sql.= " ".(! isset($this->dluo_qty)?'NULL':$this->dluo_qty).","; + $sql.= " ".(! isset($this->qty)?'NULL':$this->qty).","; $sql.= " ".(! isset($this->fk_origin_stock)?'NULL':$this->fk_origin_stock); $sql.= ")"; @@ -218,7 +218,7 @@ class ExpeditionLineBatch extends CommonObject $tmp->id = $obj->rowid; $tmp->fk_origin_stock = $obj->fk_origin_stock; $tmp->fk_expeditiondet = $obj->fk_expeditiondet; - $tmp->dluo_qty = $obj->qty; + $tmp->qty = $obj->qty; $ret[]=$tmp; $i++; From e1e1599a6d9ce293a223d2d8db4a712b652a8a97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 11:59:14 +0200 Subject: [PATCH 15/90] FIX shared link ko on proposals --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 15e8c003417..210626f461c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2496,7 +2496,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, //$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' && !empty($conf->propal->multidir_output[$entity])) + else if (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i',$original_file)) { From 88ff7241f5b848aac28394142b8a876e85424aef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 13:12:13 +0200 Subject: [PATCH 16/90] FIX Quick hack to solve pb of bad definition of public holidays --- htdocs/core/lib/date.lib.php | 23 +++++++++++++++++++++++ test/phpunit/DateLibTest.php | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ea1dbe237de..23f4ebd1186 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -573,6 +573,8 @@ function dol_get_first_day_week($day,$month,$year,$gm=false) */ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $lastday=0) { + global $conf; + $nbFerie = 0; // Check to ensure we use correct parameters @@ -588,6 +590,27 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); + + + // Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ... + if (! empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS)) + { + $arrayofdaystring=explode(',',$conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS); + foreach($arrayofdaystring as $daystring) + { + $tmp=explode('-',$daystring); + var_dump($tmp); + if ($tmp[2]) + { + if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie=true; + } + else + { + if ($tmp[0] == $mois && $tmp[1] == $jour) $ferie=true; + } + } + } + if ($countrycode == 'FR') { $countryfound=1; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 1290523abc1..e0cd1fab31b 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -205,6 +205,26 @@ class DateLibTest extends PHPUnit_Framework_TestCase $result=num_public_holiday($date1,$date2,'XX',1); print __METHOD__." result=".$result."\n"; $this->assertEquals(2,$result,'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown) + + $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS='12-13,2019-12-14'; + + $date1=dol_mktime(0, 0, 0, 12, 13, 2018); + $date2=dol_mktime(0, 0, 0, 12, 13, 2018); + $result=num_public_holiday($date1,$date2,'YY',1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1,$result,'NumPublicHoliday for YY the 2018-12-13'); // 0 opened day, 1 closed days (even if country unknown) + + $date1=dol_mktime(0, 0, 0, 12, 14, 2018); + $date2=dol_mktime(0, 0, 0, 12, 14, 2018); + $result=num_public_holiday($date1,$date2,'YY',1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(0,$result,'NumPublicHoliday for YY the 2018-12-14'); // 1 opened day, 0 closed days (even if country unknown) + + $date1=dol_mktime(0, 0, 0, 12, 14, 2019); + $date2=dol_mktime(0, 0, 0, 12, 14, 2019); + $result=num_public_holiday($date1,$date2,'YY',1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1,$result,'NumPublicHoliday for YY the 2019-12-14'); // 0 opened day, 1 closed days (even if country unknown) } /** From e6f179b6cb348207deb9ed5c8b488224e5e575e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 13:33:44 +0200 Subject: [PATCH 17/90] Fix look --- htdocs/product/stock/productlot_card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 4c614155042..7c2f4f148ad 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -390,6 +390,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print ''.$langs->trans("ShowLogOfMovementIfLot").'
'; + print '
'; } From 4b32c8e100c0cf2c53f72651ba2ee11a43d9e662 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 11 Oct 2018 14:24:55 +0200 Subject: [PATCH 18/90] Fix extrafield contact typed as date isn't show in the list from 'contact/address' tab of company --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index e77d0ee0eaf..855794da2d6 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -21,7 +21,7 @@ if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'so if ($align) print ' align="'.$align.'"'; print '>'; $tmpkey='options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp'))) + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !preg_match('/^[0-9]{10}$/', $obj->$tmpkey)) { $value = $db->jdate($obj->$tmpkey); } From 79420593f44aa1e320847d9c8e8da9ef245fa05d Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 11 Oct 2018 17:14:22 +0200 Subject: [PATCH 19/90] Fix display 0 (as virtual stock) instead of empty string --- htdocs/product/reassort.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index ccd01e56db7..a915594c4de 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -338,7 +338,7 @@ if ($resql) // Real stock print ''; if ($objp->seuil_stock_alerte != '' && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; - print $objp->stock_physique; + print $objp->stock_physique|0; print ''; // Details per warehouse From 849a1a94000f9a959423a7f26b2d8b0bb93e5b31 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 09:26:58 +0200 Subject: [PATCH 20/90] Standardize and update code --- .../template/class/myobject.class.php | 9 +++++++++ htdocs/product/class/product.class.php | 3 +++ htdocs/product/class/productbatch.class.php | 16 ++++++++++------ .../product/class/productcustomerprice.class.php | 10 +++++++++- .../class/propalmergepdfproduct.class.php | 13 +++++++++++++ 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index b04dd735e49..19e6bcd64a4 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -130,8 +130,17 @@ class MyObject extends CommonObject public $date_creation; public $tms; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; + public $import_key; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 050d756ad82..3e1ceb8b2dc 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -290,6 +290,9 @@ class Product extends CommonObject public $oldcopy; + /** + * @var int ID + */ public $fk_price_expression; /* To store supplier price found */ diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index f6a7df212eb..eb4fc32baed 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -37,13 +37,17 @@ class Productbatch extends CommonObject private static $_table_element='product_batch'; //!< Name of table without prefix where object is stored - var $tms=''; - var $fk_product_stock; - var $sellby=''; - var $eatby=''; - var $batch=''; - var $qty; + public $tms=''; + public $fk_product_stock; + public $sellby=''; + public $eatby=''; + public $batch=''; + public $qty; public $warehouseid; + + /** + * @var int ID + */ public $fk_product; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 5aaa2c079ea..3079fef5412 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -45,6 +45,10 @@ class Productcustomerprice extends CommonObject public $datec = ''; public $tms = ''; + + /** + * @var int ID + */ public $fk_product; /** @@ -987,12 +991,16 @@ class PriceByCustomerLine public $datec = ''; public $tms = ''; + + /** + * @var int ID + */ public $fk_product; /** * @var int Thirdparty ID */ - public $fk_soc; + public $fk_soc; public $price; public $price_ttc; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 3a7f3fb586d..f2aabb86876 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -647,11 +647,24 @@ class PropalmergepdfproductLine */ public $id; + /** + * @var int ID + */ public $fk_product; + public $file_name; public $lang; + + /** + * @var int ID + */ public $fk_user_author; + + /** + * @var int ID + */ public $fk_user_mod; + public $datec=''; public $tms=''; public $import_key; From 357173f0ef55f34e4248ef964cd92fe7a00e8116 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 09:30:53 +0200 Subject: [PATCH 21/90] Standardize and update code --- .../price_global_variable_updater.class.php | 5 +++++ .../product/inventory/class/inventory.class.php | 17 +++++++++++++++++ htdocs/product/stock/class/entrepot.class.php | 4 ++++ .../stock/class/mouvementstock.class.php | 8 ++++++++ htdocs/product/stock/class/productlot.class.php | 13 +++++++++++++ .../stock/class/productstockentrepot.class.php | 9 +++++++++ 6 files changed, 56 insertions(+) diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index b06a249ccc6..c4dda3481bb 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -60,7 +60,12 @@ class PriceGlobalVariableUpdater public $description; public $parameters; + + /** + * @var int ID + */ public $fk_variable; + public $update_interval; //!< Interval in mins public $next_update; //!< Next update timestamp public $last_status; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index e1be589ac88..39df52a8208 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -114,7 +114,11 @@ class Inventory extends CommonObject */ public $entity; + /** + * @var int ID + */ public $fk_warehouse; + public $date_inventory; public $title; @@ -126,9 +130,22 @@ class Inventory extends CommonObject public $date_creation; public $date_validation; public $tms; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; + + /** + * @var int ID + */ public $fk_user_valid; + public $import_key; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 575aa2a705d..b2a78a9cd3e 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -78,6 +78,10 @@ class Entrepot extends CommonObject //! Code Postal public $zip; public $town; + + /** + * @var int ID + */ public $fk_parent; // List of short language codes for status diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 0d8338c4d9f..f5fad015636 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -49,6 +49,10 @@ class MouvementStock extends CommonObject public $tms = ''; public $datem = ''; public $price; + + /** + * @var int ID + */ public $fk_user_author; /** @@ -56,7 +60,11 @@ class MouvementStock extends CommonObject */ public $label; + /** + * @var int ID + */ public $fk_origin; + public $origintype; public $inventorycode; public $batch; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index d7b77cd83ee..1530e068856 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -63,14 +63,27 @@ class Productlot extends CommonObject */ public $entity; + /** + * @var int ID + */ public $fk_product; + public $batch; public $eatby = ''; public $sellby = ''; public $datec = ''; public $tms = ''; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; + public $import_key; diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index 1ab24b553d8..6b12af88c7a 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -51,8 +51,17 @@ class ProductStockEntrepot extends CommonObject public $table_element = 'product_warehouse_properties'; public $tms = ''; + + /** + * @var int ID + */ public $fk_product; + + /** + * @var int ID + */ public $fk_entrepot; + public $seuil_stock_alerte; public $desiredstock; public $import_key; From 7e6cdfb5ec178f7495370f3afe16be2e6b447110 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 09:34:54 +0200 Subject: [PATCH 22/90] Standardize and update code --- htdocs/projet/class/task.class.php | 17 +++++++++++++++++ htdocs/resource/class/dolresource.class.php | 5 +++++ htdocs/societe/class/societe.class.php | 13 +++++++++++++ htdocs/societe/class/societeaccount.class.php | 9 +++++++++ 4 files changed, 44 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index a3fd5fb1703..84829bf85cb 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -49,6 +49,9 @@ class Task extends CommonObject public $picto = 'task'; protected $childtables=array('projet_task_time'); // To test if we can delete object + /** + * @var int ID parent task + */ public $fk_task_parent; /** @@ -67,10 +70,24 @@ class Task extends CommonObject public $date_start; public $date_end; public $progress; + + /** + * @var int ID + */ public $fk_statut; + public $priority; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_valid; + public $rang; public $timespent_min_date; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 1c04a5633ec..c6e25c4d837 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -47,7 +47,12 @@ class Dolresource extends CommonObject public $element_type; public $busy; public $mandatory; + + /** + * @var int ID + */ public $fk_user_create; + public $type_label; public $tms=''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index dbc51c93816..6343fcf0e91 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -281,7 +281,12 @@ class Societe extends CommonObject public $remise_supplier_percent; public $mode_reglement_supplier_id; public $cond_reglement_supplier_id; + + /** + * @var int ID + */ public $fk_prospectlevel; + public $name_bis; //Log data @@ -449,12 +454,20 @@ class Societe extends CommonObject public $array_options; // Incoterms + /** + * @var int ID + */ public $fk_incoterms; + public $location_incoterms; public $libelle_incoterms; //Used into tooltip // Multicurrency + /** + * @var int ID + */ public $fk_multicurrency; + public $multicurrency_code; diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index bcb09675c3d..12a664f2686 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -127,8 +127,17 @@ class SocieteAccount extends CommonObject public $note_private; public $date_creation; public $tms; + + /** + * @var int ID + */ public $fk_user_creat; + + /** + * @var int ID + */ public $fk_user_modif; + public $import_key; /** From b4e254247267bdc1d5c65454c2e3894d02d33ef1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 12:20:05 +0200 Subject: [PATCH 23/90] Standardize and update code --- htdocs/stripe/class/stripe.class.php | 3 ++ .../class/supplier_proposal.class.php | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 3c07c9ae5f6..e66fc769a09 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -38,6 +38,9 @@ class Stripe extends CommonObject */ public $fk_soc; + /** + * @var int ID + */ public $fk_key; /** diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 688f6aa1276..adc2c8643ac 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -166,7 +166,11 @@ class SupplierProposal extends CommonObject public $specimen; // Multicurrency + /** + * @var int ID + */ public $fk_multicurrency; + public $multicurrency_code; public $multicurrency_tx; public $multicurrency_total_ht; @@ -2712,9 +2716,21 @@ class SupplierProposalLine extends CommonObjectLine */ public $id; + /** + * @var int ID + */ public $fk_supplier_proposal; + + /** + * @var int ID + */ public $fk_parent_line; + public $desc; // Description ligne + + /** + * @var int ID + */ public $fk_product; // Id produit predefini /** @@ -2733,11 +2749,19 @@ class SupplierProposalLine extends CommonObjectLine public $tva_tx; public $subprice; public $remise_percent; + + /** + * @var int ID + */ public $fk_remise_except; public $rang = 0; + /** + * @var int ID + */ public $fk_fournprice; + public $pa_ht; public $marge_tx; public $marque_tx; @@ -2811,7 +2835,11 @@ class SupplierProposalLine extends CommonObjectLine public $ref_supplier; // Multicurrency + /** + * @var int ID + */ public $fk_multicurrency; + public $multicurrency_code; public $multicurrency_subprice; public $multicurrency_total_ht; From ba40ad4aabf1d7779a61e8cc604f150f3a0e328c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 12:23:45 +0200 Subject: [PATCH 24/90] Standardize and update code --- htdocs/ticket/class/actions_ticket.class.php | 3 +++ htdocs/ticket/class/ticketlogs.class.php | 8 ++++++++ htdocs/user/class/user.class.php | 3 +++ htdocs/website/class/websitepage.class.php | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 2fd26b5797b..7e8ae39564a 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -70,6 +70,9 @@ class ActionsTicket */ public $description; + /** + * @var int ID + */ public $fk_statut; /** diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index 01ba7972ced..79a4c95efed 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -62,8 +62,16 @@ class Ticketlogs// extends CommonObject */ public $id; + /** + * @var int ID + */ public $fk_track_id; + + /** + * @var int ID + */ public $fk_user_create; + public $datec = ''; public $message; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index da0e39d9ad7..d2afacce54a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -123,6 +123,9 @@ class User extends CommonObject public $socid; public $contactid; + /** + * @var int ID + */ public $fk_member; /** diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 4277a03167d..b6ef620b7d2 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -49,7 +49,11 @@ class WebsitePage extends CommonObject */ public $picto = 'label'; + /** + * @var int ID + */ public $fk_website; + public $pageurl; public $aliasalt; public $type_container; From 9d4f6dc44465b6ed0368dee271be2c97222affce Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 15:55:36 +0200 Subject: [PATCH 25/90] Standardize and update code --- htdocs/accountancy/admin/account.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 087f9957f16..c9b72d9cc4c 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -38,11 +38,11 @@ $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist'; // To manage different context of search -$search_account = GETPOST("search_account"); -$search_label = GETPOST("search_label"); -$search_accountparent = GETPOST("search_accountparent"); -$search_pcgtype = GETPOST("search_pcgtype"); -$search_pcgsubtype = GETPOST("search_pcgsubtype"); +$search_account = GETPOST('search_account','alpha'); +$search_label = GETPOST('search_label','alpha'); +$search_accountparent = GETPOST('search_accountparent','alpha'); +$search_pcgtype = GETPOST('search_pcgtype','alpha'); +$search_pcgsubtype = GETPOST('search_pcgsubtype','alpha'); // Security check if ($user->societe_id > 0) accessforbidden(); From 181c1e0b77b606fbfc172e4e7e17854937214edd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 16:01:27 +0200 Subject: [PATCH 26/90] Standardize and update code --- htdocs/accountancy/admin/accountmodel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index e3ed164d60b..c50bb495c09 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -55,8 +55,8 @@ $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); $actl[1] = img_picto($langs->trans("Activated"),'switch_on'); -$listoffset=GETPOST('listoffset'); -$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; +$listoffset=GETPOST('listoffset','alpha'); +$listlimit=GETPOST('listlimit','int')>0?GETPOST('listlimit','int'):1000; $active = 1; $sortfield = GETPOST("sortfield",'aZ09comma'); From c5edb3289b9d048074e8dacb486dee27494ef121 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 16:09:05 +0200 Subject: [PATCH 27/90] Standardize and update code --- htdocs/accountancy/admin/accountmodel.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index c50bb495c09..efa23a6a586 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -139,13 +139,13 @@ $sourceList=array(); * Actions */ -if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) +if (GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter_x','alpha')) { $search_country_id = ''; } // Actions add or modify an entry into a dictionary -if (GETPOST('actionadd') || GETPOST('actionmodify')) +if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); $listfieldinsert=explode(',',$tabfieldinsert[$id]); @@ -235,7 +235,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null // Si verif ok et action add, on ajoute la ligne - if ($ok && GETPOST('actionadd')) + if ($ok && GETPOST('actionadd','alpha')) { if ($tabrowid[$id]) { @@ -300,7 +300,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } // Si verif ok et action modify, on modifie la ligne - if ($ok && GETPOST('actionmodify')) + if ($ok && GETPOST('actionmodify','alpha')) { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -341,7 +341,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -if (GETPOST('actioncancel')) +if (GETPOST('actioncancel','alpha')) { //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } @@ -560,7 +560,7 @@ if ($id) $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) + if (GETPOST('actionadd','alpha')) { foreach ($fieldlist as $key=>$val) { From 4df574d58ed36ffbcbf0e1843b8b8e122985f796 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 16:23:27 +0200 Subject: [PATCH 28/90] Standardize and update code --- htdocs/accountancy/admin/card.php | 34 ++++++++++++-------- htdocs/accountancy/admin/categories_list.php | 14 ++++---- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 6a92a3f6080..b64bf291955 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -73,25 +73,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) // To manage zero or not at the end of the accounting account if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { - $account_number = GETPOST('account_number'); + $account_number = GETPOST('account_number','int'); } else { - $account_number = clean_account(GETPOST('account_number')); + $account_number = clean_account(GETPOST('account_number','int')); } - if (GETPOST('account_parent') <= 0) { + if (GETPOST('account_parent','int') <= 0) + { $account_parent = 0; - } else { + } + else + { $account_parent = GETPOST('account_parent','int'); } $object->fk_pcg_version = $obj->pcg_version; - $object->pcg_type = GETPOST('pcg_type'); - $object->pcg_subtype = GETPOST('pcg_subtype'); + $object->pcg_type = GETPOST('pcg_type','alpha'); + $object->pcg_subtype = GETPOST('pcg_subtype','alpha'); $object->account_number = $account_number; $object->account_parent = $account_parent; - $object->account_category = GETPOST('account_category'); + $object->account_category = GETPOST('account_category','alpha'); $object->label = GETPOST('label', 'alpha'); $object->active = 1; @@ -135,25 +138,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) // To manage zero or not at the end of the accounting account if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { - $account_number = GETPOST('account_number'); + $account_number = GETPOST('account_number','int'); } else { - $account_number = clean_account(GETPOST('account_number')); + $account_number = clean_account(GETPOST('account_number','int')); } - if (GETPOST('account_parent') <= 0) { + if (GETPOST('account_parent','int') <= 0) + { $account_parent = 0; - } else { + } + else + { $account_parent = GETPOST('account_parent','int'); } $object->fk_pcg_version = $obj->pcg_version; - $object->pcg_type = GETPOST('pcg_type'); - $object->pcg_subtype = GETPOST('pcg_subtype'); + $object->pcg_type = GETPOST('pcg_type','alpha'); + $object->pcg_subtype = GETPOST('pcg_subtype','alpha'); $object->account_number = $account_number; $object->account_parent = $account_parent; - $object->account_category = GETPOST('account_category'); + $object->account_category = GETPOST('account_category','alpha'); $object->label = GETPOST('label', 'alpha'); $result = $object->update($user); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 900205b7588..14a6b56512d 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -51,8 +51,8 @@ $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); $actl[1] = img_picto($langs->trans("Activated"),'switch_on'); -$listoffset=GETPOST('listoffset'); -$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; +$listoffset=GETPOST('listoffset','alpha'); +$listlimit=GETPOST('listlimit','int')>0?GETPOST('listlimit','int'):1000; $active = 1; $sortfield = GETPOST("sortfield",'aZ09comma'); @@ -134,13 +134,13 @@ $sourceList=array(); * Actions */ -if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) +if (GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter_x','alpha')) { $search_country_id = ''; } // Actions add or modify an entry into a dictionary -if (GETPOST('actionadd') || GETPOST('actionmodify')) +if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); $listfieldinsert=explode(',',$tabfieldinsert[$id]); @@ -250,7 +250,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } // Si verif ok et action modify, on modifie la ligne - if ($ok && GETPOST('actionmodify')) + if ($ok && GETPOST('actionmodify','alpha')) { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -291,7 +291,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -if (GETPOST('actioncancel')) +if (GETPOST('actioncancel','alpha')) { //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } @@ -513,7 +513,7 @@ if ($id) $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) + if (GETPOST('actionadd','alpha')) { foreach ($fieldlist as $key=>$val) { From bd426d105235080055e852aaa5c39bc39f581414 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 16:44:25 +0200 Subject: [PATCH 29/90] Standardize and update code --- htdocs/accountancy/admin/categories.php | 4 ++-- htdocs/accountancy/admin/defaultaccounts.php | 2 +- htdocs/accountancy/admin/fiscalyear_card.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 735c5595ddc..6e003738173 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -37,9 +37,9 @@ $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); $cancel = GETPOST('cancel','alpha'); $action = GETPOST('action','aZ09'); -$cat_id = GETPOST('account_category'); +$cat_id = GETPOST('account_category','int'); $selectcpt = GETPOST('cpt_bk', 'array'); -$cpt_id = GETPOST('cptid'); +$cpt_id = GETPOST('cptid','int'); if ($cat_id == 0) { $cat_id = null; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 8cd45c1cfda..31fc04fa745 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -76,7 +76,7 @@ $list_account = array ( $accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE; -if (GETPOST('change_chart')) +if (GETPOST('change_chart', 'alpha')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index cc4dd9dbb7f..05c7a3fd174 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -166,7 +166,7 @@ if ($action == 'create') print ''; // Label - print ''; + print ''; // Date start print ''; print ''; print ''; */ From 1cfb06934c867c208361a6f1ae859830c32a8094 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 16:49:53 +0200 Subject: [PATCH 30/90] Standardize and update code --- htdocs/accountancy/admin/journals_list.php | 18 +++++++++--------- htdocs/accountancy/admin/productaccount.php | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 20d0a5200a5..ae254788b08 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -51,8 +51,8 @@ $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); $actl[1] = img_picto($langs->trans("Activated"),'switch_on'); -$listoffset=GETPOST('listoffset'); -$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; +$listoffset=GETPOST('listoffset', 'alpha'); +$listlimit=GETPOST('listlimit', 'int')>0?GETPOST('listlimit', 'int'):1000; $active = 1; $sortfield = GETPOST("sortfield",'alpha'); @@ -143,13 +143,13 @@ $sourceList = array( * Actions */ -if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) +if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) { $search_country_id = ''; } // Actions add or modify an entry into a dictionary -if (GETPOST('actionadd') || GETPOST('actionmodify')) +if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); $listfieldinsert=explode(',',$tabfieldinsert[$id]); @@ -190,7 +190,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null // Si verif ok et action add, on ajoute la ligne - if ($ok && GETPOST('actionadd')) + if ($ok && GETPOST('actionadd', 'alpha')) { if ($tabrowid[$id]) { @@ -252,7 +252,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } // Si verif ok et action modify, on modifie la ligne - if ($ok && GETPOST('actionmodify')) + if ($ok && GETPOST('actionmodify', 'alpha')) { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -294,7 +294,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -//if (GETPOST('actioncancel')) +//if (GETPOST('actioncancel', 'alpha')) //{ // $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition //} @@ -462,7 +462,7 @@ if ($id) $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) + if (GETPOST('actionadd', 'alpha')) { foreach ($fieldlist as $key=>$val) { @@ -504,7 +504,7 @@ if ($id) $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; - if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); + if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); // There is several pages if ($num > $listlimit) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 2467b89b108..0babd9aab5f 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -62,8 +62,8 @@ $search_current_account_valid = GETPOST('search_current_account_valid', 'alpha') if ($search_current_account_valid == '') $search_current_account_valid='withoutvalidaccount'; $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); -$btn_changeaccount = GETPOST('changeaccount'); -$btn_changetype = GETPOST('changetype'); +$btn_changeaccount = GETPOST('changeaccount', 'alpha'); +$btn_changetype = GETPOST('changetype', 'alpha'); $limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST("sortfield",'alpha'); From 18b3238bad56baeb277853af1741b07ca5d7a8d2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 12 Oct 2018 16:56:01 +0200 Subject: [PATCH 31/90] Standardize and update code --- htdocs/accountancy/bookkeeping/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 5add04d7361..a8ff1e13338 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -217,7 +217,7 @@ else if ($action == "confirm_create") { $action='create'; $error++; } - if (! GETPOST('next_num_mvt')) + if (! GETPOST('next_num_mvt', 'alpha')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumPiece")), null, 'errors'); $error++; @@ -253,7 +253,7 @@ else if ($action == "confirm_create") { } if ($action == 'setdate') { - $datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth'), GETPOST('doc_dateday'), GETPOST('doc_dateyear')); + $datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); $result = $object->updateByMvt($piece_num,'doc_date',$db->idate($datedoc),$mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -357,7 +357,7 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; print ''; print ''; From 817920f282c517ad39cbf4d0d17392c56dde16ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 17:36:49 +0200 Subject: [PATCH 32/90] Prepare 6.0.8 --- ChangeLog | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 405aaa9ed9d..1bffab94cda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,37 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 6.0.8 compared to 6.0.7 ***** +FIX: #8762 +FIX: #9032 +FIX: case when we valid form with keyboard +FIX: clause must not be there +FIX: dol_delete_file must work in a context without db handler loaded +FIX: entity test must be on product_fourn_price table and not product table +FIX: Fetch shipping will now fetch project id +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: getEntity project and not projet +FIX: If we enable 3 steps for supplier order approbation, we must no… +FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def. +FIX: Keep supplier proposal price for supplier order +FIX: langs fr +FIX: missing filters during ordering +FIX: missing filters during reordering +FIX: need to filter on aa.entity for same accounting accounts available in several entities +FIX: page must always be 0 when we search +FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) +FIX: PDF address: handle when contact thirdparty different from document thirdparty +FIX: propal: correctly preset project when creating with origin/originid +FIX: pu_ht_devise was not converted to numeric so decimals were lost +FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise +FIX: remain to pay for credit note was wrong on invoice list +FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods +FIX: showOptionals: column mismatches +FIX: sometimes amounts are identical but php find them different. +FIX: test is_erasable() must be done before call function delete() +FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url +FIX: we must see number of all shared projects +FIX: wrong var name ***** ChangeLog for 6.0.7 compared to 6.0.6 ***** FIX: #8023 From 1ab6cd4b59b542422131cc2e52ab7d5572d5c858 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 17:51:32 +0200 Subject: [PATCH 33/90] Update card.php --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index aeb145a7ea2..6f24d1f86fb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3250,7 +3250,7 @@ if ($action == 'create') print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; $sql = "SELECT bk.numero_compte AS 'compte',"; @@ -111,11 +111,11 @@ $resql = $db->query($sql); if ($resql) { $i = 0; $num = $db->num_rows($resql); - + while ( $i < $num ) { - + $row = $db->fetch_row($resql); - + print ''; print ''; print ''; @@ -129,9 +129,9 @@ if ($resql) { print ''; print ''; print ''; - print ''; + print ''; print ''; - + $i ++; } $db->free($resql); From b2677f08a45faa8f99e78f9f31c4e40e7c2d433b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 14 Oct 2018 12:47:26 +0200 Subject: [PATCH 59/90] add links for set-up --- htdocs/accountancy/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index ac674eb95e0..431961a33bd 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -61,13 +61,13 @@ if ($conf->accounting->enabled) // STEPS $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").''.''); print "
\n"; print "
\n"; From eecc56c1a371dcfd9c97ceb669e2f8d15e921605 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 14 Oct 2018 13:00:01 +0200 Subject: [PATCH 60/90] highlight relevant text --- htdocs/accountancy/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 431961a33bd..23dcc7f9932 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -61,13 +61,13 @@ if ($conf->accounting->enabled) // STEPS $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("AccountingJournals").''.''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("Pcg_version").''.''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("Chartofaccounts").''.''.''); print "
\n"; print "
\n"; From c6163a389b8f8e27b1294017d325bba6a050fe05 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 15 Oct 2018 06:22:28 +0200 Subject: [PATCH 61/90] Revert "Remove MAIN_FEATURES_LEVEL > 1 on fiscal year access" This reverts commit 65e6b49abb30c14ceb868249fe9dde0443b52e54. --- htdocs/core/menus/standard/eldy.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 303e2813245..51a9907a16e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1019,7 +1019,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); // Fiscal year - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + if ($conf->global->MAIN_FEATURES_LEVEL > 1) // Not yet used. In a future will lock some periods. + { + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + } // Binding if (! empty($conf->facture->enabled)) From c8b9c11a011c82f01afc1ed848a3667bcfb5aaf4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 15 Oct 2018 06:53:48 +0200 Subject: [PATCH 62/90] Fix FEC Missing some subledger label on bookeeping --- .../journal/expensereportsjournal.php | 16 +++++++-------- .../accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 20 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index ef21557932b..520fd004f16 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -1,11 +1,11 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2013-2016 Olivier Geffroy - * Copyright (C) 2013-2016 Florian Henry +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -208,7 +208,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_doc = $key; $bookkeeping->fk_docdet = $val["fk_expensereportdet"]; $bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code']; - $bookkeeping->subledger_label = $tabuser[$key]['user_accountancy_code']; + $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; $bookkeeping->label_operation = $tabuser[$key]['name']; $bookkeeping->montant = $mt; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index d8be52cef90..71bdb6a5bd4 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -310,7 +310,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_fournisseur; $bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur']; - $bookkeeping->subledger_label = ''; // TODO To complete + $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount"); $bookkeeping->montant = $mt; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index b3b354be02d..dcfd11ac67a 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -1,13 +1,13 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2016 Olivier Geffroy - * Copyright (C) 2014 Raphaël Doursenaud +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -317,7 +317,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; - $bookkeeping->subledger_label = ''; // TODO To complete + $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount"); $bookkeeping->montant = $mt; From 47d98ab69d504e6259036b6850438a7a62167301 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 11:04:29 +0200 Subject: [PATCH 63/90] FIX content lost when editing a label with " --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 449242f0594..b92df257dd7 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -754,7 +754,7 @@ elseif ($object->id > 0) // Label print '
'; - print ''; + print ''; // Status print ''; print ''; - print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); + print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; $total_debit = 0; From 970c581bc9a8709f5ab9fc0806ab708fad278c98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 16:40:07 +0200 Subject: [PATCH 68/90] css --- htdocs/core/tpl/contacts.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 99ae9a699a1..cc361be5e60 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -199,12 +199,12 @@ if ($permission) { if ($tab[$i]['source']=='internal') { $userstatic->fetch($tab[$i]['id']); - echo $userstatic->getNomUrl(-1); + echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle'); } if ($tab[$i]['source']=='external') { $contactstatic->fetch($tab[$i]['id']); - echo $contactstatic->getNomUrl(1); + echo $contactstatic->getNomUrl(1, '', 0, 0, 0, 0, '', 'valignmiddle'); } ?> From 743d4d7c019a50260fd421f40b932c12270e3e11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 16:40:40 +0200 Subject: [PATCH 69/90] NEW add option PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT --- htdocs/comm/propal/card.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 4c6fbb2045c..3233dff3a4b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -348,13 +348,13 @@ if (empty($reshook)) // If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on) if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) { - if ($object->fetch(GETPOST('copie_propal')) > 0) { + if ($object->fetch(GETPOST('copie_propal','int')) > 0) { $object->ref = GETPOST('ref'); $object->datep = $datep; $object->date_livraison = $date_delivery; $object->availability_id = GETPOST('availability_id'); $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); + $object->fk_delivery_address = GETPOST('fk_address','int'); $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->duree_validite = $duration; $object->cond_reglement_id = GETPOST('cond_reglement_id'); @@ -362,9 +362,9 @@ if (empty($reshook)) $object->fk_account = GETPOST('fk_account', 'int'); $object->remise_percent = GETPOST('remise_percent'); $object->remise_absolue = GETPOST('remise_absolue'); - $object->socid = GETPOST('socid'); - $object->contactid = GETPOST('contactid'); - $object->fk_project = GETPOST('projectid'); + $object->socid = GETPOST('socid','int'); + $object->contactid = GETPOST('contactid','int'); + $object->fk_project = GETPOST('projectid','int'); $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note_private = GETPOST('note_private','none'); @@ -391,8 +391,8 @@ if (empty($reshook)) $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); - $object->contactid = GETPOST('contactid'); - $object->fk_project = GETPOST('projectid'); + $object->contactid = GETPOST('contactid','int'); + $object->fk_project = GETPOST('projectid','int'); $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note_private = GETPOST('note_private','none'); @@ -566,6 +566,16 @@ if (empty($reshook)) } } + if (! empty($conf->global->PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT)) + { + $result = $object->add_contact($user->id, 'SALESREPFOLL', 'internal'); + if ($result < 0) + { + $error++; + setEventMessages($langs->trans("ErrorFailedToAddUserAsContact"), null, 'errors'); + } + } + if (! $error) { $db->commit(); From 96ddebad4acbb2d21f76d9c2c584daf75a9ef361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 17:48:39 +0200 Subject: [PATCH 70/90] Set canonical tag --- htdocs/core/lib/website.lib.php | 1 + htdocs/website/index.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index fc2a90bbeb1..42ed566915f 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -624,6 +624,7 @@ function dolSavePageContent($filetpl, $object, $objectpage) $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e9e14c4f888..dc8209bcb01 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -459,6 +459,7 @@ if ($action == 'addcontainer') //$objectpage->htmlheader = preg_replace('/]*>\n/ims', '', $objectpage->htmlheader); + $objectpage->htmlheader = preg_replace('/]*rel="canonical[^>]*>\n/ims', '', $objectpage->htmlheader); // Now loop to fetch JS $tmp = $objectpage->htmlheader; From 7492d42ad8efd029363776ba88962f1b255e5c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 15 Oct 2018 18:47:12 +0200 Subject: [PATCH 71/90] do not trim int --- htdocs/compta/tva/class/tva.class.php | 33 ++++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index df5e8dfe76c..c78e0d8dd7a 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2011-2017 Alexandre Spangaro - * Copyright (C) 2018 Philippe Grand +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2018 Philippe Grand + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,9 +104,9 @@ class Tva extends CommonObject $this->amount=trim($this->amount); $this->label=trim($this->label); $this->note=trim($this->note); - $this->fk_bank=trim($this->fk_bank); - $this->fk_user_creat=trim($this->fk_user_creat); - $this->fk_user_modif=trim($this->fk_user_modif); + $this->fk_bank = (int) $this->fk_bank; + $this->fk_user_creat = (int) $this->fk_user_creat; + $this->fk_user_modif = (int) $this->fk_user_modif; // Check parameters // Put here code to add control on parameters values @@ -182,9 +183,9 @@ class Tva extends CommonObject $this->amount=trim($this->amount); $this->label=trim($this->label); $this->note=trim($this->note); - $this->fk_bank=trim($this->fk_bank); - $this->fk_user_creat=trim($this->fk_user_creat); - $this->fk_user_modif=trim($this->fk_user_modif); + $this->fk_bank = (int) $this->fk_bank; + $this->fk_user_creat = (int) $this->fk_user_creat; + $this->fk_user_modif = (int) $this->fk_user_modif; // Check parameters // Put here code to add control on parameters values @@ -519,9 +520,9 @@ class Tva extends CommonObject $this->amount=price2num(trim($this->amount)); $this->label=trim($this->label); $this->note=trim($this->note); - $this->fk_bank=trim($this->fk_bank); - $this->fk_user_creat=trim($this->fk_user_creat); - $this->fk_user_modif=trim($this->fk_user_modif); + $this->fk_bank = (int) $this->fk_bank; + $this->fk_user_creat = (int) $this->fk_user_creat; + $this->fk_user_modif = (int) $this->fk_user_modif; if (empty($this->datec)) $this->datec = dol_now(); // Check parameters @@ -663,8 +664,8 @@ class Tva extends CommonObject function update_fk_bank($id_bank) { // phpcs:enable - $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank; - $sql.= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.(int) $id_bank; + $sql.= ' WHERE rowid = '.(int) $this->id; $result = $this->db->query($sql); if ($result) { @@ -769,7 +770,7 @@ class Tva extends CommonObject { $sql = "SELECT t.rowid, t.tms, t.fk_user_modif, t.datec, t.fk_user_creat"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE t.rowid = ".$id; + $sql.= " WHERE t.rowid = ".(int) $id; dol_syslog(get_class($this)."::info", LOG_DEBUG); $result=$this->db->query($sql); From c246ef38c08520e9346ade49bfd2f729060acd8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 21:42:43 +0200 Subject: [PATCH 72/90] Fix canonical --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 42ed566915f..1d141fe128e 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -624,7 +624,7 @@ function dolSavePageContent($filetpl, $object, $objectpage) $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; From 568197656f52b47dcc56a0c69b1881a9b7163a85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 21:43:01 +0200 Subject: [PATCH 73/90] Fix canonical of home --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 1d141fe128e..0fe56afd9dd 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -624,7 +624,7 @@ function dolSavePageContent($filetpl, $object, $objectpage) $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; - $tplcontent.= ''."\n"; + $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; $tplcontent.= ''."\n"; From 3a6824da68b8effacbbbf3a0583d8b7152a4fc01 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 15 Oct 2018 21:50:05 +0200 Subject: [PATCH 74/90] Fix FEC Missing label_compte & label_operation --- htdocs/accountancy/journal/bankjournal.php | 77 ++++++++++++++++------ 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 4e52481b287..f0e6aa8455d 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1,12 +1,12 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2018 Alexandre Spangaro - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Olivier Geffroy +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2017-2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; @@ -155,6 +156,8 @@ $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; $journal_label = $accountingjournalstatic->label; +$accountingaccountstatic = new AccountingAccount($db); + dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -461,7 +464,12 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->fk_doc = $key; $bookkeeping->fk_docdet = $val["fk_bank"]; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = $langs->trans("Bank"); + + $accountingaccountstatic->fetch('',$k,1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; + + $bookkeeping->label_operation = $reflabel; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt >= 0 ? $mt : 0); @@ -517,6 +525,7 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->doc_type = 'bank'; $bookkeeping->fk_doc = $key; $bookkeeping->fk_docdet = $val["fk_bank"]; + $bookkeeping->label_operation = $reflabel; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt < 0 ? - $mt : 0); @@ -530,22 +539,34 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch('',$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER,1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch('',$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER,1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'payment_expensereport') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch('',$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT,1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'payment_salary') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch('',$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT,1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; @@ -555,27 +576,42 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch($k,'',1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'payment_donation') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch($k,'',1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'payment_loan') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch($k,'',1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch($k,'',1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else if ($tabtype[$key] == 'banktransfert') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch($k,'',1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } else { if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty. { @@ -583,7 +619,10 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE; - $bookkeeping->label_compte = ''; + + $accountingaccountstatic->fetch('',$conf->global->ACCOUNTING_ACCOUNT_SUSPENSE,1); + $accountingaccount_label = $accountingaccountstatic->label; + $bookkeeping->label_compte = $accountingaccount_label; } } $bookkeeping->label_operation = $reflabel; From c8607a74bfb97b149754f02e5971f4b34a3741b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 01:39:04 +0200 Subject: [PATCH 75/90] Load websitepage --- htdocs/core/lib/website.lib.php | 2 +- htdocs/core/website.inc.php | 70 ++++++++++++++++----------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 0fe56afd9dd..350014b3eb9 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -305,7 +305,7 @@ function redirectToContainer($containerref, $containeraliasalt='',$containerid=0 */ function includeContainer($containerref) { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $weblangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. global $includehtmlcontentopened; global $websitekey, $websitepagefile; diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 4e382088da5..71550d4d118 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -25,16 +25,28 @@ // Load website class include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; -// Define $website and $weblangs +// Define $website if (! is_object($website)) { $website=new Website($db); $website->fetch(0,$websitekey); } +// Define $weblangs if (! is_object($weblangs)) { $weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice } +// Define $websitepage if we have $websitepagefile defined +if (! $pageid && ! empty($websitepagefile)) +{ + $pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile)); +} +if ($pageid > 0) +{ + include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; + $websitepage=new WebsitePage($db); + $websitepage->fetch($pageid); +} // A lang was forced, so we change weblangs init if (GETPOST('l','aZ09')) $weblangs->setDefaultLang(GETPOST('l','aZ09')); @@ -44,44 +56,32 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing //print_r(get_defined_constants(true));exit; if (GETPOST('l','aZ09')) { - if (! $pageid && ! empty($websitepagefile)) - { - $pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile)); - } - if ($pageid > 0) - { - // Load tmppage if we have $websitepagefile defined - include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; - $tmppage=new WebsitePage($db); - $tmppage->fetch($pageid); + $sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page"; + $sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp"; + $sql.=" WHERE wp.fk_website = ".$website->id; + $sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid; + if (is_object($websitepage) && $websitepage->fk_page > 0) $sql.=" OR wp.fk_page = ".$websitepage->fk_page." OR wp.rowid = ".$websitepage->fk_page; + $sql.=")"; + $sql.= " AND wp.lang = '".$db->escape(GETPOST('l','aZ09'))."'"; - $sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page"; - $sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp"; - $sql.=" WHERE wp.fk_website = ".$website->id; - $sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid; - if ($tmppage->fk_page > 0) $sql.=" OR wp.fk_page = ".$tmppage->fk_page." OR wp.rowid = ".$tmppage->fk_page; - $sql.=")"; - $sql.= " AND wp.lang = '".$db->escape(GETPOST('l','aZ09'))."'"; - - $resql = $db->query($sql); - if ($resql) + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) { - $obj = $db->fetch_object($resql); - if ($obj) + $newpageid = $obj->rowid; + if ($newpageid != $pageid) // To avoid to make a redirect on same page (infinite loop) { - $newpageid = $obj->rowid; - if ($newpageid != $pageid) // To avoid to make a redirect on same page (infinite loop) + if (defined('USEDOLIBARRSERVER')) { + header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'.php&l='.GETPOST('l','aZ09')); + exit; + } + else { - if (defined('USEDOLIBARRSERVER')) { - header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'.php&l='.GETPOST('l','aZ09')); - exit; - } - else - { - $newpageref = $obj->pageurl; - header("Location: ".$newpageref.'.php?l='.GETPOST('l','aZ09')); - exit; - } + $newpageref = $obj->pageurl; + header("Location: ".$newpageref.'.php?l='.GETPOST('l','aZ09')); + exit; } } } From 12cb60040b86ae9b2339ca04e40a52a49a5125d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 01:52:22 +0200 Subject: [PATCH 76/90] Fix multilang --- htdocs/core/website.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 71550d4d118..1338104de0b 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -74,7 +74,7 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing if ($newpageid != $pageid) // To avoid to make a redirect on same page (infinite loop) { if (defined('USEDOLIBARRSERVER')) { - header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'.php&l='.GETPOST('l','aZ09')); + header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'&l='.GETPOST('l','aZ09')); exit; } else From 35f9371343a983085cfc54fb76151a750701074d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 03:30:17 +0200 Subject: [PATCH 77/90] Fix missing es translation string --- htdocs/core/class/notify.class.php | 37 ++++++++++++++++-------------- htdocs/langs/es_ES/other.lang | 1 + 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 7a1b55f5bd2..5a5356b2dd5 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -368,6 +368,7 @@ class Notify { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($obj->default_lang); + $outputlangs->load("other"); } $subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification"); @@ -377,72 +378,72 @@ class Notify $link='/compta/facture/card.php?facid='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref); break; case 'BILL_PAYED': $link='/compta/facture/card.php?facid='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed",$newref); break; case 'ORDER_VALIDATE': $link='/commande/card.php?id='.$object->id; $dir_output = $conf->commande->dir_output; $object_type = 'order'; - $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated",$newref); break; case 'PROPAL_VALIDATE': $link='/comm/propal/card.php?id='.$object->id; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated",$newref); break; case 'PROPAL_CLOSE_SIGNED': $link='/comm/propal/card.php?id='.$object->id; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref); break; case 'FICHINTER_ADD_CONTACT': $link='/fichinter/card.php?id='.$object->id; $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$object->ref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$newref); break; case 'FICHINTER_VALIDATE': $link='/fichinter/card.php?id='.$object->id; $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref); break; case 'ORDER_SUPPLIER_VALIDATE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs)); - $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs)); + $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_APPROVE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); - $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); + $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); - $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); + $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref); break; } $ref = dol_sanitizeFileName($newref); @@ -651,6 +652,8 @@ class Notify $message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; + //if ($link) $message.= "\n" . $urlwithroot . $link; // link already added around the ref into the text + $message = nl2br($message); // Replace keyword __SUPERVISOREMAIL__ diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index 137bbac42d6..acdc769a7c5 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -188,6 +188,7 @@ NumberOfUnitsSupplierInvoices=Número de unidades en las facturas de proveedores EMailTextInterventionAddedContact=Se le ha asignado la intervención %s EMailTextInterventionValidated=Ficha intervención %s validada EMailTextInvoiceValidated=Factura %s validada +EMailTextInvoicePayed=La factura %s ha sido pagada. EMailTextProposalValidated=El presupuesto %s que le concierne ha sido validado. EMailTextProposalClosedSigned=El presupuesto %s ha sido cerrado y firmado. EMailTextOrderValidated=El pedido %s que le concierne ha sido validado. From 70366e9d91fd675b7f21a80ff923b105208474bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 03:31:33 +0200 Subject: [PATCH 78/90] Missing translation --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 5a5356b2dd5..c226fb647d0 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -368,7 +368,7 @@ class Notify { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($obj->default_lang); - $outputlangs->load("other"); + $outputlangs->loadLangs(array("main","other")); } $subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification"); From a971a2afe6432a2c330aa3c70bd2e3f1e9f8d9a5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 16 Oct 2018 06:32:55 +0200 Subject: [PATCH 79/90] Fix FEC --- htdocs/accountancy/journal/bankjournal.php | 58 ++++++++----------- .../journal/expensereportsjournal.php | 13 ++++- .../accountancy/journal/purchasesjournal.php | 29 ++++++---- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index f0e6aa8455d..7b4248630ae 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -150,13 +150,14 @@ $paymentvariousstatic = new PaymentVarious($db); $paymentloanstatic = new PaymentLoan($db); $accountLinestatic=new AccountLine($db); +$accountingaccount = new AccountingAccount($db); + // Get code of finance journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; $journal_label = $accountingjournalstatic->label; -$accountingaccountstatic = new AccountingAccount($db); dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG); $result = $db->query($sql); @@ -465,9 +466,8 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->fk_docdet = $val["fk_bank"]; $bookkeeping->numero_compte = $k; - $accountingaccountstatic->fetch('',$k,1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch(null, $k, true); + $bookkeeping->label_compte = $accountingaccount->label; $bookkeeping->label_operation = $reflabel; $bookkeeping->montant = $mt; @@ -540,33 +540,29 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; - $accountingaccountstatic->fetch('',$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER,1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; - $accountingaccountstatic->fetch('',$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER,1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'payment_expensereport') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; - $accountingaccountstatic->fetch('',$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT,1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch(null ,$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'payment_salary') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; - $accountingaccountstatic->fetch('',$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT,1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch(null ,$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; @@ -577,41 +573,36 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $accountingaccountstatic->fetch($k,'',1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'payment_donation') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $accountingaccountstatic->fetch($k,'',1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'payment_loan') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $accountingaccountstatic->fetch($k,'',1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $accountingaccountstatic->fetch($k,'',1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; } else if ($tabtype[$key] == 'banktransfert') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $accountingaccountstatic->fetch($k,'',1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; } else { if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty. { @@ -620,9 +611,8 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE; - $accountingaccountstatic->fetch('',$conf->global->ACCOUNTING_ACCOUNT_SUSPENSE,1); - $accountingaccount_label = $accountingaccountstatic->label; - $bookkeeping->label_compte = $accountingaccount_label; + $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE, true); + $bookkeeping->label_compte = $accountingaccount->label; } } $bookkeeping->label_operation = $reflabel; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 520fd004f16..6fb8aed5c31 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France @@ -61,6 +61,7 @@ if ($user->societe_id > 0) /* * Actions */ +$accountingaccount = new AccountingAccount($db); // Get informations of journal $accountingjournalstatic = new AccountingJournal($db); @@ -210,6 +211,10 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; + + $accountingaccount->fetch(null ,$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true); + $bookkeeping->label_compte = $accountingaccount->label; + $bookkeeping->label_operation = $tabuser[$key]['name']; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; @@ -248,7 +253,6 @@ if ($action == 'writebookkeeping') { foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { // get compte id and label - $accountingaccount = new AccountingAccount($db); if ($accountingaccount->fetch(null, $k, true)) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -260,6 +264,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; + $bookkeeping->label_compte = $accountingaccount->label; $bookkeeping->label_operation = $accountingaccount->label; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; @@ -316,6 +321,10 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; + + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; + $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 71bdb6a5bd4..beb9891276f 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -1,11 +1,11 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2013-2016 Olivier Geffroy - * Copyright (C) 2013-2016 Florian Henry +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -66,10 +66,7 @@ $parameters=array(); */ $reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks - -/* - * Views - */ +$accountingaccount = new AccountingAccount($db); // Get informations of journal $accountingjournalstatic = new AccountingJournal($db); @@ -312,6 +309,10 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; + + $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true); + $bookkeeping->label_compte = $accountingaccount->label; + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount"); $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; @@ -352,7 +353,6 @@ if ($action == 'writebookkeeping') { foreach ( $tabht[$key] as $k => $mt ) { //if ($mt) { // get compte id and label - $accountingaccount = new AccountingAccount($db); if ($accountingaccount->fetch(null, $k, true)) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -366,6 +366,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; + $bookkeeping->label_compte = $accountingaccount->label; $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; @@ -426,6 +427,10 @@ if ($action == 'writebookkeeping') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; + + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:''); $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; From 5f37e075405db98b01f76376f9e1e848b709aed3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Oct 2018 14:42:36 +0200 Subject: [PATCH 80/90] add links and highlight relevant text --- htdocs/accountancy/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 29c05eb5516..bc09c33483c 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -76,15 +76,15 @@ if ($conf->accounting->enabled) print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''.''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("MenuBankAccounts").''.''.'')."\n"; print "
\n"; $step++; - $textlink = ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").''; + $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.''.$langs->transnoentitiesnoconv("MenuVatAccounts").''.''.''; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink); print "
\n"; if (! empty($conf->tax->enabled)) From 059c72c678e9dcbfedcd0a540740c56ba64a090e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Oct 2018 14:55:29 +0200 Subject: [PATCH 81/90] add links and highlight relevant text --- htdocs/accountancy/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index bc09c33483c..eac0f23a845 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -89,7 +89,7 @@ if ($conf->accounting->enabled) print "
\n"; if (! empty($conf->tax->enabled)) { - $textlink = ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").''; + $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.''.$langs->transnoentitiesnoconv("MenuTaxAccounts").''.''.''; $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink); print "
\n"; @@ -105,7 +105,7 @@ if ($conf->accounting->enabled) if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several. { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").''.''.''); print "
\n"; } /* @@ -123,7 +123,7 @@ if ($conf->accounting->enabled) }*/ $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("ProductsBinding").''.''.''); print "
\n"; From bd3315528eec2762768727118b1a1e941fbde681 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Oct 2018 15:08:06 +0200 Subject: [PATCH 82/90] add links and highlight relevant text --- htdocs/accountancy/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index eac0f23a845..b2dfdb91e05 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -139,18 +139,18 @@ if ($conf->accounting->enabled) $langs->loadLangs(array('bills', 'trips')); $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".''.$langs->transnoentitiesnoconv("CustomersVentilation").''.''.'')."\n"; print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".''.$langs->transnoentitiesnoconv("SuppliersVentilation").''.''.'')."\n"; print "
\n"; if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; - print "
\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".''.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").''.''.'')."\n"; + print "
\n"; } $step++; From 4bdcb17694ef6d1bbf3b033e5bb5204e80fd7559 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 15:38:26 +0200 Subject: [PATCH 83/90] Trans --- htdocs/langs/en_US/website.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index a14d05132cd..bee23264d7a 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -51,7 +51,7 @@ NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $weblangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
+YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
ClonePage=Clone page/container CloneSite=Clone site SiteAdded=Web site added From dc0aaf48d730b7ce7f7fed403be993708bc351b0 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 16 Oct 2018 16:08:20 +0200 Subject: [PATCH 84/90] FIX and dolibarize --- htdocs/stripe/class/stripe.class.php | 31 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index db2553ee167..e0928b91376 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -346,10 +346,10 @@ class Stripe extends CommonObject /** * Create charge with public/payment/newpayment.php, stripe/card.php, cronjobs or REST API * - * @param int $amount Amount to pay + * @param int $stripeamount Amount to pay * @param string $currency EUR, GPB... - * @param string $origin Object type to pay (order, invoice, contract...) - * @param int $item Object id to pay + * @param string $dol_type Object type to pay (order, invoice, contract...) + * @param int $dol_id Object id to pay * @param string $source src_xxxxx or card_xxxxx * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() * @param string $account Stripe account ref 'acc_xxxxxxxxxxxxx' via getStripeAccount() @@ -358,7 +358,7 @@ class Stripe extends CommonObject * @param boolean $capture Set capture flag to true (take payment) or false (wait) * @return Stripe */ - public function createPaymentStripe($amount, $currency, $origin, $item, $source, $customer, $account, $status=0, $usethirdpartyemailforreceiptemail=0, $capture=true) + public function createPaymentStripe($stripeamount, $currency, $dol_type, $dol_id, $source, $customer, $account, $status=0, $usethirdpartyemailforreceiptemail=0, $capture=true) { global $conf; @@ -387,29 +387,28 @@ class Stripe extends CommonObject } $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($currency, $arrayzerounitcurrency)) $stripeamount=$amount * 100; - else $stripeamount = $amount; + if (! in_array($currency, $arrayzerounitcurrency)) $stripeamount=$stripeamount * 100; $societe = new Societe($this->db); if ($key > 0) $societe->fetch($key); $description = ""; $ref = ""; - if ($origin == order) { + if ($dol_type == order) { $order = new Commande($this->db); - $order->fetch($item); + $order->fetch($dol_id); $ref = $order->ref; $description = "ORD=" . $ref . ".CUS=" . $societe->id.".PM=stripe"; - } elseif ($origin == invoice) { + } elseif ($dol_type == invoice) { $invoice = new Facture($this->db); - $invoice->fetch($item); + $invoice->fetch($dol_id); $ref = $invoice->ref; $description = "INV=" . $ref . ".CUS=" . $societe->id.".PM=stripe"; } $metadata = array( - "dol_id" => "" . $item . "", - "dol_type" => "" . $origin . "", + "dol_id" => "" . $dol_id . "", + "dol_type" => "" . $dol_type . "", "dol_thirdparty_id" => "" . $societe->id . "", 'dol_thirdparty_name' => $societe->name, 'dol_version'=>DOL_VERSION, @@ -427,7 +426,7 @@ class Stripe extends CommonObject if (preg_match('/acct_/i', $source)) { $charge = \Stripe\Charge::create(array( - "amount" => "$stripeamount", + "amount" => price2num($stripeamount, 'MU'), "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "description" => "Stripe payment: ".$description, @@ -437,7 +436,7 @@ class Stripe extends CommonObject )); } else { $paymentarray = array( - "amount" => "$stripeamount", + "amount" => price2num($stripeamount, 'MU'), "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "description" => "Stripe payment: ".$description, @@ -456,13 +455,13 @@ class Stripe extends CommonObject } } else { - $fee = round(($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); + $fee = round(($stripeamount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) { $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100); } $paymentarray = array( - "amount" => "$stripeamount", + "amount" => price2num($stripeamount, 'MU'), "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "description" => "Stripe payment: ".$description, From 96fce2828e3bd521bf42696d9b19f635f0a090c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 17:02:36 +0200 Subject: [PATCH 85/90] Prepare 9.0 --- build/rpm/dolibarr_fedora.spec | 2 ++ build/rpm/dolibarr_generic.spec | 6 ++++-- build/rpm/dolibarr_mandriva.spec | 2 ++ build/rpm/dolibarr_opensuse.spec | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index d5a9189229e..727875485b4 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -177,6 +177,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron %_datadir/dolibarr/htdocs/custom +%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm @@ -212,6 +213,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/supplier_proposal %_datadir/dolibarr/htdocs/support %_datadir/dolibarr/htdocs/theme +%_datadir/dolibarr/htdocs/takepos %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 673d5919d1a..3fb68d06a15 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -54,7 +54,7 @@ BuildRequires: desktop-file-utils Group: Applications/Productivity Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu Requires: mysql, mysql-client -%else +%else%_datadir/dolibarr/htdocs/datapolicy %if 0%{?suse_version} # Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros Group: Productivity/Office/Management @@ -124,7 +124,7 @@ cui hai bisogno ed essere facile da usare. %if 0%{?sles_version} %{__rm} -rf $RPM_BUILD_ROOT -%{__mkdir} $RPM_BUILD_ROOT +%{__mkdir} $RPM_BUILD_ROOT%_datadir/dolibarr/htdocs/datapolicy %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir} %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name} %else @@ -257,6 +257,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron %_datadir/dolibarr/htdocs/custom +%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm @@ -292,6 +293,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/supplier_proposal %_datadir/dolibarr/htdocs/support %_datadir/dolibarr/htdocs/theme +%_datadir/dolibarr/htdocs/takepos %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index e3d2a849db2..a4004273211 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -174,6 +174,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron %_datadir/dolibarr/htdocs/custom +%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm @@ -209,6 +210,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/supplier_proposal %_datadir/dolibarr/htdocs/support %_datadir/dolibarr/htdocs/theme +%_datadir/dolibarr/htdocs/takepos %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 5a64bec2e78..478a889c8d6 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -185,6 +185,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/core %_datadir/dolibarr/htdocs/cron %_datadir/dolibarr/htdocs/custom +%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm @@ -220,6 +221,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/supplier_proposal %_datadir/dolibarr/htdocs/support %_datadir/dolibarr/htdocs/theme +%_datadir/dolibarr/htdocs/takepos %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants From f5029bf52b7f3e81e935d34f70418c4a676b856f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 17:46:14 +0200 Subject: [PATCH 86/90] Fix template --- .../modulebuilder/template/core/modules/modMyModule.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index b83580f4017..e81b75c1815 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -72,7 +72,7 @@ class modMyModule extends DolibarrModules $this->version = '1.0'; //Url to the file with your last numberversion of this module - $this->url_last_version = 'http://www.example.com/versionmodule.txt'; + //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. From 502c52b78fc58a401c10826825a4ae9baabb7ea3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 18:09:43 +0200 Subject: [PATCH 87/90] Show real path of module if not into custom --- htdocs/langs/en_US/modulebuilder.lang | 1 + htdocs/modulebuilder/index.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 940088368d5..6aef75a5746 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -99,3 +99,4 @@ InitStructureFromExistingTable=Build the structure array string of an existing t UseAboutPage=Disable the about page UseDocFolder=Disable the documentation folder UseSpecificReadme=Use a specific ReadMe +RealPathOfModule=Real path of module diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d325e52a343..182cb6b08ff 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1154,9 +1154,16 @@ elseif (! empty($module)) $head2[$h][2] = 'buildpackage'; $h++; + // Link to enable / disable print $modulestatusinfo; print ' '.$linktoenabledisable; - print '

'; + print '
'; + + if (realpath($dirread.'/'.$modulelowercase) != $dirread.'/'.$modulelowercase) + { + print $langs->trans("RealPathOfModule").' : '.realpath($dirread.'/'.$modulelowercase).'
'; + } + print '
'; if ($tab == 'description') { From 08fa0deb2459a56dfe805139c199adeb151eab74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 18:41:50 +0200 Subject: [PATCH 88/90] FIX Bad label on delete button --- htdocs/expensereport/payment/card.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 2876d512c52..29ac7e38862 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -42,6 +42,13 @@ if ($user->societe_id) $socid=$user->societe_id; $object = new PaymentExpenseReport($db); +if ($id > 0) +{ + $result=$object->fetch($id); + if (! $result) dol_print_error($db,'Failed to get payment id '.$id); +} + + /* * Actions */ @@ -77,10 +84,10 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere $db->commit(); $factures=array(); // TODO Get all id of invoices linked to this payment - foreach($factures as $id) + foreach($factures as $invoiceid) { $fac = new Facture($db); - $fac->fetch($id); + $fac->fetch($invoiceid); $outputlangs = $langs; if (! empty($_REQUEST['lang_id'])) @@ -110,12 +117,6 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere llxHeader('', $langs->trans("ExpenseReportPayment")); -if ($id > 0) -{ - $result=$object->fetch($id); - if (! $result) dol_print_error($db,'Failed to get payment id '.$id); -} - $form = new Form($db); $head = payment_expensereport_prepare_head($object); @@ -265,9 +266,11 @@ if ($resql) print '
'; print "\n"; + if ($objp->paid == 1) // If at least one invoice is paid, disable delete { - $disable_delete = 1; + $disable_delete = 2; + $title_button = $langs->trans("CantRemovePaymentWithOneInvoicePaid"); } $total = $total + $objp->amount; $i++; @@ -303,7 +306,7 @@ if ($action == '') } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } } From 5a4338ad1d65c5fdebd3244c119259abb3814c35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 19:20:51 +0200 Subject: [PATCH 89/90] Revert "FIX and dolibarize" --- htdocs/stripe/class/stripe.class.php | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index e0928b91376..db2553ee167 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -346,10 +346,10 @@ class Stripe extends CommonObject /** * Create charge with public/payment/newpayment.php, stripe/card.php, cronjobs or REST API * - * @param int $stripeamount Amount to pay + * @param int $amount Amount to pay * @param string $currency EUR, GPB... - * @param string $dol_type Object type to pay (order, invoice, contract...) - * @param int $dol_id Object id to pay + * @param string $origin Object type to pay (order, invoice, contract...) + * @param int $item Object id to pay * @param string $source src_xxxxx or card_xxxxx * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() * @param string $account Stripe account ref 'acc_xxxxxxxxxxxxx' via getStripeAccount() @@ -358,7 +358,7 @@ class Stripe extends CommonObject * @param boolean $capture Set capture flag to true (take payment) or false (wait) * @return Stripe */ - public function createPaymentStripe($stripeamount, $currency, $dol_type, $dol_id, $source, $customer, $account, $status=0, $usethirdpartyemailforreceiptemail=0, $capture=true) + public function createPaymentStripe($amount, $currency, $origin, $item, $source, $customer, $account, $status=0, $usethirdpartyemailforreceiptemail=0, $capture=true) { global $conf; @@ -387,28 +387,29 @@ class Stripe extends CommonObject } $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($currency, $arrayzerounitcurrency)) $stripeamount=$stripeamount * 100; + if (! in_array($currency, $arrayzerounitcurrency)) $stripeamount=$amount * 100; + else $stripeamount = $amount; $societe = new Societe($this->db); if ($key > 0) $societe->fetch($key); $description = ""; $ref = ""; - if ($dol_type == order) { + if ($origin == order) { $order = new Commande($this->db); - $order->fetch($dol_id); + $order->fetch($item); $ref = $order->ref; $description = "ORD=" . $ref . ".CUS=" . $societe->id.".PM=stripe"; - } elseif ($dol_type == invoice) { + } elseif ($origin == invoice) { $invoice = new Facture($this->db); - $invoice->fetch($dol_id); + $invoice->fetch($item); $ref = $invoice->ref; $description = "INV=" . $ref . ".CUS=" . $societe->id.".PM=stripe"; } $metadata = array( - "dol_id" => "" . $dol_id . "", - "dol_type" => "" . $dol_type . "", + "dol_id" => "" . $item . "", + "dol_type" => "" . $origin . "", "dol_thirdparty_id" => "" . $societe->id . "", 'dol_thirdparty_name' => $societe->name, 'dol_version'=>DOL_VERSION, @@ -426,7 +427,7 @@ class Stripe extends CommonObject if (preg_match('/acct_/i', $source)) { $charge = \Stripe\Charge::create(array( - "amount" => price2num($stripeamount, 'MU'), + "amount" => "$stripeamount", "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "description" => "Stripe payment: ".$description, @@ -436,7 +437,7 @@ class Stripe extends CommonObject )); } else { $paymentarray = array( - "amount" => price2num($stripeamount, 'MU'), + "amount" => "$stripeamount", "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "description" => "Stripe payment: ".$description, @@ -455,13 +456,13 @@ class Stripe extends CommonObject } } else { - $fee = round(($stripeamount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); + $fee = round(($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) { $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100); } $paymentarray = array( - "amount" => price2num($stripeamount, 'MU'), + "amount" => "$stripeamount", "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "description" => "Stripe payment: ".$description, From f0c0c4779bd82d18dfe1713ba7a202f028cdd132 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 19:32:35 +0200 Subject: [PATCH 90/90] Fix remove yellow alert --- htdocs/accountancy/index.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index b2dfdb91e05..2d34ec816e3 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -61,13 +61,13 @@ if ($conf->accounting->enabled) // STEPS $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("AccountingJournals").''.''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("Pcg_version").''.''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("Chartofaccounts").''.''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").''.''); print "
\n"; print "
\n"; @@ -76,20 +76,20 @@ if ($conf->accounting->enabled) print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''.''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("MenuBankAccounts").''.''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").''.'')."\n"; print "
\n"; $step++; - $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.''.$langs->transnoentitiesnoconv("MenuVatAccounts").''.''.''; + $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").''.''; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink); print "
\n"; if (! empty($conf->tax->enabled)) { - $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.''.$langs->transnoentitiesnoconv("MenuTaxAccounts").''.''.''; + $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").''.''; $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink); print "
\n"; @@ -105,7 +105,7 @@ if ($conf->accounting->enabled) if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several. { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").''.''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").''.''); print "
\n"; } /* @@ -123,7 +123,7 @@ if ($conf->accounting->enabled) }*/ $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".''.$langs->transnoentitiesnoconv("ProductsBinding").''.''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").''.''); print "
\n"; @@ -139,17 +139,17 @@ if ($conf->accounting->enabled) $langs->loadLangs(array('bills', 'trips')); $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".''.$langs->transnoentitiesnoconv("CustomersVentilation").''.''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").''.'')."\n"; print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".''.$langs->transnoentitiesnoconv("SuppliersVentilation").''.''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").''.'')."\n"; print "
\n"; if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".''.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").''.''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").''.'')."\n"; print "
\n"; }
' . $langs->trans("Label") . '
' . $langs->trans("Label") . '
' . $langs->trans("DateStart") . ''; @@ -183,7 +183,7 @@ if ($action == 'create') print '
' . $langs->trans("Status") . ''; - print $form->selectarray('statut', $statut2label, GETPOST('statut')); + print $form->selectarray('statut', $statut2label, GETPOST('statut', 'int')); print '
' . $langs->trans("Codejournal") . '' . $formaccounting->select_journal(GETPOST('code_journal'),'code_journal',0,1,array(),1,1) . '' . $formaccounting->select_journal(GETPOST('code_journal', 'alpha'),'code_journal',0,1,array(),1,1) . '
' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); // We check if Origin document (id and type is known) has already at least one invoice attached to it $objectsrc->fetchObjectLinked($originid,$origin,'','facture'); - if(!empty($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture'])) + if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1) { setEventMessages('WarningBillExist', null, 'warnings'); echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; From afd9b4ea1a793ffcee8de396e24dc9a21a71ef4d Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Fri, 12 Oct 2018 18:19:17 +0200 Subject: [PATCH 34/90] FIX: propal pdf: missing parenthesis for customs code --- htdocs/comm/propal/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 2fdaadd1d59..c21e6ebec10 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -868,6 +868,7 @@ if (empty($reshook)) // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { + $tmptxt = '('; // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; From 60a5444c1408cbcd3c9f56e4d2b83349f0f63377 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 18:50:33 +0200 Subject: [PATCH 35/90] Fix app name to match Stripe advice --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index defbc620cc8..d25176c21b4 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -54,5 +54,5 @@ else } \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); -\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setAppInfo("Dolibarr StripeModule", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version \Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From 2d2b9a030cc8b3f8c477c012aa62616509813268 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:01:01 +0200 Subject: [PATCH 36/90] Fix app name to match Stripe advice --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index d25176c21b4..7aa22678d7a 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -54,5 +54,5 @@ else } \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); -\Stripe\Stripe::setAppInfo("Dolibarr StripeModule", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version \Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From d4b02c05524b89ecfb70c78b45be3e293fb484ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:03:03 +0200 Subject: [PATCH 37/90] Release 6.0.8 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 9ab5de809b9..41fcff97fd8 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.8'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.9'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From bb606df5e064351715196bd7b1528e3629c53e10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:12:20 +0200 Subject: [PATCH 38/90] Prepare 7.0.4 --- ChangeLog | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/ChangeLog b/ChangeLog index bdbb165903d..0a74e1b6f8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,63 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 7.0.4 compared to 7.0.3 ***** +FIX: #8984 button create expense report +FIX: #9032 +FIX: #9161 +FIX: #9328 +FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product +FIX: Add calls to fetchComments function +FIX: better compatibility with multicompany +FIX: case when we valid form with keyboard +FIX: character making error on bill list +FIX: check !empty exclude select element +FIX: combo into popup become crazy with IE10 +FIX: combo of stock in popup are crazy in IE +FIX: Deletion of files in migration +FIX: exclude element of the select +FIX: extrafieldkey +FIX: Fetch function will fetch comments +FIX: Fetch task will now fetch comments +FIX: filter supplier invoice list by societe name. +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: Force stripe api version to avoid trouble if we update stripe api +FIX: getEntity project and not projet +FIX: Get templates in a forced language +FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281) +FIX: Injection +FIX: invoice stats: situation invoices were not counted +FIX: keep context filter on contact list on change column displayed +FIX: Keep same project when creating shipping from order +FIX: langs fr +FIX: Lose filter on payment type or category after a sort on invoice list +FIX: Missing behavior +FIX: missing hook to edit sql +FIX: multicompany compatibility ! +FIX: need to filter on current entity on replenish +FIX: Option MAIN_DISABLE_NOTES_TAB #9611 +FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) +FIX: Pagination on related item pages +FIX: Pagination on withdraw request list +FIX: PDF address: handle when contact thirdparty different from document thirdparty +FIX: PHP warning, undefined index notnull +FIX: Product marge tabs on product card +FIX: Product margin tab and credit note +FIX: propal: correctly preset project when creating with origin/originid +FIX: remain to pay for credit note was wrong on invoice list +FIX: remove debug +FIX: Remove fetchComments from project and task fetch function +FIX: remove rowid for multicompany compatibility +FIX: Search on Ref project on order list +FIX: search on ref project on propal list +FIX: showOptionals: column mismatches +FIX: SQL Injections reported by mu shcor (ADLab of Venustech) +FIX: stock replenish with multientity +FIX: table llx_chargessociales doesn't exists +FIX: we must see number of all shared projects +FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing + ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters FIX: #8722 From 7e82e3d44c4927b65bc0c907ad904e30c0a0089a Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 12 Oct 2018 19:13:07 +0200 Subject: [PATCH 39/90] Update card.php --- htdocs/accountancy/admin/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index b64bf291955..74958d606ec 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -73,11 +73,11 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) // To manage zero or not at the end of the accounting account if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { - $account_number = GETPOST('account_number','int'); + $account_number = GETPOST('account_number','string'); } else { - $account_number = clean_account(GETPOST('account_number','int')); + $account_number = clean_account(GETPOST('account_number','string')); } if (GETPOST('account_parent','int') <= 0) @@ -138,11 +138,11 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) // To manage zero or not at the end of the accounting account if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { - $account_number = GETPOST('account_number','int'); + $account_number = GETPOST('account_number','string'); } else { - $account_number = clean_account(GETPOST('account_number','int')); + $account_number = clean_account(GETPOST('account_number','string')); } if (GETPOST('account_parent','int') <= 0) From bd60fe6ffda132beacb69bfd492c04f4212f9a61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:13:11 +0200 Subject: [PATCH 40/90] Prepare 7.0.4 --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0a74e1b6f8e..61b3f85edb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,11 @@ FIX: stock replenish with multientity FIX: table llx_chargessociales doesn't exists FIX: we must see number of all shared projects FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing +FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup +FIX: wrong function name +FIX: Wrong position of firstname lastname +FIX: wrong value for module part and return access denied +FIX: Wrong variable and trigger name ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters From d8edb1f6b864639c2ecbb40f7de104358010097a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 20:28:26 +0200 Subject: [PATCH 41/90] Fix regression in online payment --- htdocs/public/payment/newpayment.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index cedca6cae73..3afd590da53 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -413,7 +413,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $dol_type=(GETPOST('s', 'alpha') ? GETPOST('s', 'alpha') : GETPOST('source', 'alpha')); $dol_id=GETPOST('dol_id', 'int'); $vatnumber = GETPOST('vatnumber','alpha'); - $savesource=GETPOST('savesource', 'int'); + $savesource=GETPOSTISSET('savesource')?GETPOST('savesource', 'int'):1; dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe'); dol_syslog("email = ".$email, LOG_DEBUG, 0, '_stripe'); @@ -454,9 +454,11 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1); // Create Stripe card from Token - if (! empty($savesource)) { - $card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata)); - } else { $card = $stripeToken; } + if ($savesource) { + $card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata)); + } else { + $card = $stripeToken; + } if (empty($card)) { @@ -467,9 +469,9 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) } else { - if (! empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; - if (! empty($dol_id)) $metadata["dol_id"] = $dol_id; - if (! empty($dol_type)) $metadata["dol_type"] = $dol_type; + if (! empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; + if (! empty($dol_id)) $metadata["dol_id"] = $dol_id; + if (! empty($dol_type)) $metadata["dol_type"] = $dol_type; dol_syslog("Create charge on card ".$card->id, LOG_DEBUG, 0, '_stripe'); $charge = \Stripe\Charge::create(array( From b78932b9f7679cec79d97cf6b0046c6bdec3bde4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 21:11:40 +0200 Subject: [PATCH 42/90] Prepare 7.0.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index adfe8cea7e9..dbc0e4bda8c 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From e2748953c3a7e8b0de07f504124bcc183ec90efb Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 12 Oct 2018 22:31:47 +0200 Subject: [PATCH 43/90] Fix print extrafield date in list --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 855794da2d6..6d72c63ab41 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -21,7 +21,7 @@ if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'so if ($align) print ' align="'.$align.'"'; print '>'; $tmpkey='options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !preg_match('/^[0-9]{10}$/', $obj->$tmpkey)) + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { $value = $db->jdate($obj->$tmpkey); } From 0f8ac57c854c292e0349a9c247d87513d7180893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Oct 2018 22:34:23 +0200 Subject: [PATCH 44/90] remove var_dump --- htdocs/core/lib/date.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 23f4ebd1186..8985a4e7621 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -599,7 +599,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ foreach($arrayofdaystring as $daystring) { $tmp=explode('-',$daystring); - var_dump($tmp); if ($tmp[2]) { if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie=true; From 9551cb12f5eabbdc23c11304f928d0191661f62d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 09:59:33 +0200 Subject: [PATCH 45/90] Standardize and update code --- htdocs/admin/dict.php | 2 +- htdocs/contact/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index aaa4fb03706..0b5b63d35d6 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -592,7 +592,7 @@ if ($id == 10) * Actions */ -if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) +if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) { $search_country_id = ''; $search_code = ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index cd536118f8e..52a2c4bbe7f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -202,7 +202,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Did we click on purge search criteria ? - if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $sall=""; $search_id=''; From d98ebbd9ee2dec094491d52c7555df1acb862f84 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 10:39:27 +0200 Subject: [PATCH 46/90] Standardize and update code --- htdocs/compta/prelevement/create.php | 2 +- htdocs/fichinter/card-rec.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 0d07c341458..3dccc0ff912 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -46,7 +46,7 @@ $result = restrictedArea($user, 'prelevement', '', '', 'bons'); $action = GETPOST('action','alpha'); $mode = GETPOST('mode','alpha')?GETPOST('mode','alpha'):'real'; $format = GETPOST('format','aZ09'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 8ef79639e05..66f693858c9 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -60,7 +60,7 @@ $result = restrictedArea($user, 'ficheinter', $id, $objecttype); if ($page == -1) $page = 0 ; -$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit; +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $offset = $limit * $page ; if ($sortorder == "") From ec12a0d456485b992475b5accf76954efbabbbf3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:03:05 +0200 Subject: [PATCH 47/90] update resources url --- doc/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/index.html b/doc/index.html index b888b13d9a6..5c655136e3e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -11,15 +11,15 @@ informations on Dolibarr.
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this on Internet on web following sites:

-* Dolibarr wiki (documentation)
+* Dolibarr wiki (documentation)

-* Dolibarr portal (official website)
+* Dolibarr portal (official website)

-* Dolibarr demo (online)
+* Dolibarr demo (online)

-* DoliWamp, the Dolibarr for Windows
+* DoliWamp, the Dolibarr for Windows

-* DoliStore (official addons/plugins market place)
+* DoliStore (official addons/plugins market place)
\ No newline at end of file From f8fbb976f662f8f9d1b692ee945ca8838b7657ba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:06:13 +0200 Subject: [PATCH 48/90] fix typo and update resource url --- doc/user/README-FR | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/user/README-FR b/doc/user/README-FR index f3a839de008..fbf67fd89bc 100644 --- a/doc/user/README-FR +++ b/doc/user/README-FR @@ -3,9 +3,9 @@ README (french) Documentation utilisateur -------------------------------- -* Pour une prise en main et installation rapide, consulter le fichier +* Pour une prise en main et installation rapide, consultez le fichier README-FR à la racine. -* Une documentation utilisateur francophone plus consistente est disponible en +* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le site Web de Dolibarr à l'adresse: -http://www.dolibarr.fr +https://www.dolibarr.fr From 653589cc6786fcc380e99be805cf7056981d1f21 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:07:04 +0200 Subject: [PATCH 49/90] update resource url --- doc/user/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/README b/doc/user/README index 19507dba0e4..129dff11058 100644 --- a/doc/user/README +++ b/doc/user/README @@ -4,4 +4,4 @@ User guide -------------------------------- * All Dolibarr guides are available, on line, on the Dolibarr Web site: -http://www.dolibarr.org +https://www.dolibarr.org From e71a738209fa0b10aae23dd6724840ec3d4dbd57 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:08:58 +0200 Subject: [PATCH 50/90] fix typo and update resource url --- doc/install/README-FR | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/install/README-FR b/doc/install/README-FR index f954601ae0d..2cee29cf2df 100644 --- a/doc/install/README-FR +++ b/doc/install/README-FR @@ -9,19 +9,19 @@ Téléchargement * Dolibarr ERP/CRM can be downloaded at sourceforge: http://sourceforge.net/projects/dolibarr/files or from Dolibarr official web site: -http://www.dolibarr.org +https://www.dolibarr.org * Most external modules are only available on DoliStore: -http://www.dolistore.org +https://www.dolistore.org -------------------------------- Documentation utilisateur -------------------------------- -* Pour une prise en main et installation rapide, consulter le fichier +* Pour une prise en main et installation rapide, consultez le fichier README-FR à la racine. -* Une documentation utilisateur francophone plus consistente est disponible en +* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse: -http://wiki.dolibarr.org +https://wiki.dolibarr.org From a48554e8757659f20a69e6e7d66f0ef87622fd80 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:19:41 +0200 Subject: [PATCH 51/90] fix typo --- dev/dolibarr_changes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 6303eaafaae..24832103c6c 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -1,5 +1,5 @@ -This file describe changes made on external library after beeing included +This file describes changes made on external libraries after being included in Dolibarr root. From 1e0cf8dc8a785cec1377d88c017cc495f7ac7085 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:42:29 +0200 Subject: [PATCH 52/90] fix typo --- README-FR.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README-FR.md b/README-FR.md index 4435d47d30e..19d4ae25df9 100644 --- a/README-FR.md +++ b/README-FR.md @@ -16,8 +16,8 @@ Dolibarr est distribué sous les termes de la licence GNU General Public License ## INSTALLER DOLIBARR Si vous n'avez pas de connaissances techniques, et que vous recherchez -un programme d'installation qui install Dolibarr ERP/CRM en quelques clics, -vous devez vous réorienter vers DoliWamp (la version tout-en-un +un programme d'installation qui installe Dolibarr ERP/CRM en quelques clics, +vous devez vous ré-orienter vers DoliWamp (la version tout-en-un de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat, OpenSuse, Mandriva ou Mageia). @@ -25,39 +25,39 @@ OpenSuse, Mandriva ou Mageia). Vous pouvez les télécharger depuis la rubrique *download* du portail officiel: https://www.dolibarr.org/ -Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (MariaDb/MySql/PostgreSql), +Si vous avez déjà installé un serveur Web avec PHP et une base de données (MariaDb/MySql/PostgreSql), vous pouvez installer Dolibarr avec cette version de la manière suivante: -- Copier le répertoire "dolibarr" et son contenu dans la racine de votre serveur - web, ou bien copier le répertoire sur le serveur et configurer ce serveur pour +- Copiez le répertoire "dolibarr" et son contenu dans la racine de votre serveur + web, ou bien copiez le répertoire sur le serveur et configurez ce serveur pour utiliser "dolibarr/htdocs" comme racine d'un nouveau virtual host (ce second choix requiert des compétences et habilitations en administration du serveur web). -- Créer un fichier vide "htdocs/conf/conf.php" et attribuer les permissions +- Créez un fichier vide "htdocs/conf/conf.php" et attribuez les permissions en lecture et écriture pour le user du serveur web (les permissions en écriture seront supprimées une fois l'installation terminée). -- Depuis votre navigateur, appeler la page "install/" de dolibarr. L'url dépend - du choix fait à la première etape: +- Depuis votre navigateur, appelez la page "install/" de dolibarr. L'url dépend + du choix fait à la première étape: http://localhost/dolibarr/htdocs/install/ ou http://yourdolibarrvirtualhost/install/ -- Suivez les instructions fournies par l'installeur... +- Suivez les instructions fournies par l'installateur... ## METTRE A JOUR DOLIBARR -Pour mettre a jour Dolibarr depuis une vieille version vers celle ci: -- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers +Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: +- Ecrasez les vieux fichiers dans le vieux répertoire 'dolibarr' par les fichiers fournis dans ce nouveau package. -- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire). - Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents") - -*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* +- Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire). + Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents") + +*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* ## CE QUI EST NOUVEAU @@ -136,7 +136,7 @@ Dolibarr peut aussi être étendu à volonté avec l'ajout de module/application ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE -Voici un liste de fonctionnalites pas encore gérées par Dolibarr: +Voici un liste de fonctionnalités pas encore gérées par Dolibarr: - Dolibarr ne contient pas de module de Gestion de la paie. - Les tâches du module de gestion de projets n'ont pas de dépendances entre elle. - Dolibarr n'embarque pas de Webmail intégré nativement. @@ -145,7 +145,7 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr: ## DOCUMENTATION -Les documentations utilisateur, développeur et traducteur sont disponible sous forme de ressources de la communautés via la site [Wiki](https://wiki.dolibarr.org). +La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org). ## CONTRIBUER From 30630ff3686a9fdafca8f785ccf367ebe3a5e549 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 11:58:19 +0200 Subject: [PATCH 53/90] fix typo --- .../modules/commande/doc/pdf_einstein.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d3b5d12d620..37d2742c1b1 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -149,13 +149,13 @@ class pdf_einstein extends ModelePDFCommandes $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts From effd11e1f9bf9a4e875e4db68c6e55a47cda90da Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 12:42:01 +0200 Subject: [PATCH 54/90] translation --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 37d2742c1b1..273027f3b99 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/commande/doc/pdf_einstein.modules.php * \ingroup commande - * \brief Fichier de la classe permettant de generer les commandes au modele Einstein + * \brief File of Class to generate PDF orders with template Einstein */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Classe to generate PDF orders with template Einstein + * Class to generate PDF orders with template Einstein */ class pdf_einstein extends ModelePDFCommandes { From 56f5aaf1ad147d0d85c4cc9cadab75cd3d56ccb2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 13 Oct 2018 13:56:23 +0200 Subject: [PATCH 55/90] html5 --- dev/examples/mail/dolibarr_mail_simpleHTML.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/examples/mail/dolibarr_mail_simpleHTML.txt b/dev/examples/mail/dolibarr_mail_simpleHTML.txt index 5c552221ca6..391800f5095 100644 --- a/dev/examples/mail/dolibarr_mail_simpleHTML.txt +++ b/dev/examples/mail/dolibarr_mail_simpleHTML.txt @@ -4,4 +4,4 @@ X-Mailer: Dolibarr version 2.7.0-beta (using php mail) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit -Testé
fdsfsdf
fsdfsfds
fssdfsd
+Testé
fdsfsdf
fsdfsfds
fssdfsd
From e19453450dcb24a55b9e5a65aea01dd8d0133e29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Oct 2018 19:57:34 +0200 Subject: [PATCH 56/90] Fix closing tag --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d406f6918a0..f6646813843 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1564,7 +1564,7 @@ elseif (! empty($module)) print '
'; - print ' '.$langs->trans("PageForLib").' : '.($realpathtolib?'':'').$pathtolib.($realpathtodocument?'':'').''; + print ' '.$langs->trans("PageForLib").' : '.($realpathtolib?'':'').$pathtolib.($realpathtolib?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print ' '.$langs->trans("Image").' : '.($realpathtopicto?'':'').$pathtopicto.($realpathtopicto?'':'').''; From 65e6b49abb30c14ceb868249fe9dde0443b52e54 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 14 Oct 2018 08:08:55 +0200 Subject: [PATCH 57/90] Remove MAIN_FEATURES_LEVEL > 1 on fiscal year access --- htdocs/core/menus/standard/eldy.lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 51a9907a16e..303e2813245 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1019,10 +1019,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); // Fiscal year - if ($conf->global->MAIN_FEATURES_LEVEL > 1) // Not yet used. In a future will lock some periods. - { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); - } + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); // Binding if (! empty($conf->facture->enabled)) From 5dd447445a7ff8cd8c341a9e00cb505a1686e1fe Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 14 Oct 2018 09:43:33 +0200 Subject: [PATCH 58/90] html5 --- htdocs/accountancy/bookkeeping/balancebymonth.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 3a0a1f73308..a01c42b285a 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -64,7 +64,7 @@ $result = $db->query($sql); if ($result) { $row = $db->fetch_row($result); $nbfac = $row[0]; - + $db->free($result); } @@ -85,7 +85,7 @@ print '
' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . 'TotalTotal
' . length_accountg($row[0]) . '' . price($row[1]) . '' . price($row[2]) . '' . price($row[10]) . '' . price($row[11]) . '' . price($row[12]) . '' . price($row[13]) . '' . price($row[13]) . '
'.$langs->trans("Label").'
'.$langs->trans("Status").''; From 9afc53ca06f366069ad9a057c878025dff6be208 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 01:47:44 +0200 Subject: [PATCH 64/90] Fix remove step in accountancy if module expense report not used --- htdocs/accountancy/index.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 2881de98132..9a3767bd8e4 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -146,9 +146,12 @@ if ($conf->accounting->enabled) print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n"; print "
\n"; - $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; - print "
\n"; + if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled)) + { + $step++; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; + print "
\n"; + } $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n"; From aa6996e2d08ffff028304487b7a1c048b70ac24e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Oct 2018 23:47:38 +0200 Subject: [PATCH 65/90] Fix pagination show two times the same account on balance of accounts --- htdocs/accountancy/bookkeeping/balance.php | 23 ++++++++++++------- .../accountancy/class/bookkeeping.class.php | 9 ++++++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 284ead4fb56..4022b9a9407 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -41,6 +41,21 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha'); $action = GETPOST('action', 'alpha'); +if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; + +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +//if (! $sortfield) $sortfield="p.date_fin"; +//if (! $sortorder) $sortorder="DESC"; + + $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); @@ -53,14 +68,6 @@ if ($search_accountancy_code_end == - 1) { $search_accountancy_code_end = ''; } -if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; - - -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit; -if (empty($page) || $page < 0) { $page = 0; } - -$offset = $limit * $page; - $object = new BookKeeping($db); $formaccounting = new FormAccounting($db); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index f7fed2e2b5b..4a2037aa92c 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -986,16 +986,21 @@ class BookKeeping extends CommonObject } $resql = $this->db->query($sql); - if ($resql) { + if ($resql) + { $num = $this->db->num_rows($resql); - while ( $obj = $this->db->fetch_object($resql) ) { + $i = 0; + while ($obj = $this->db->fetch_object($resql) && $i < $num) + { $line = new BookKeepingLine(); $line->numero_compte = $obj->numero_compte; $line->debit = $obj->debit; $line->credit = $obj->credit; $this->lines[] = $line; + + $i++; } $this->db->free($resql); From e29fb85cec94ae39cfa775df23af8c652ba810bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Oct 2018 23:57:07 +0200 Subject: [PATCH 66/90] Fix limit --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 4a2037aa92c..e751cf1899f 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -991,7 +991,7 @@ class BookKeeping extends CommonObject $num = $this->db->num_rows($resql); $i = 0; - while ($obj = $this->db->fetch_object($resql) && $i < $num) + while (($obj = $this->db->fetch_object($resql)) && ($i < min($limit, $num))) { $line = new BookKeepingLine(); From 2684767b19f6b715953ee9fab63251d343222f44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 00:06:16 +0200 Subject: [PATCH 67/90] Fix pagination Conflicts: htdocs/accountancy/bookkeeping/balance.php --- htdocs/accountancy/bookkeeping/balance.php | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 4022b9a9407..fa1f4b396d5 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -103,23 +103,27 @@ if ($sortorder == "") if ($sortfield == "") $sortfield = "t.numero_compte"; -$options = ''; + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + $filter = array (); if (! empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; - $options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); + $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); } if (! empty($search_date_end)) { $filter['t.doc_date<='] = $search_date_end; - $options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); + $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); } if (! empty($search_accountancy_code_start)) { $filter['t.numero_compte>='] = $search_accountancy_code_start; - $options .= '&search_accountancy_code_start=' . $search_accountancy_code_start; + $param .= '&search_accountancy_code_start=' . $search_accountancy_code_start; } if (! empty($search_accountancy_code_end)) { $filter['t.numero_compte<='] = $search_accountancy_code_end; - $options .= '&search_accountancy_code_end=' . $search_accountancy_code_end; + $param .= '&search_accountancy_code_end=' . $search_accountancy_code_end; } @@ -141,8 +145,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', * View */ -if ($action == 'export_csv') { - +if ($action == 'export_csv') +{ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'balance'; @@ -194,7 +198,8 @@ else { print ''; $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; - print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0); + + print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); $moreforfilter = ''; @@ -232,12 +237,12 @@ else { print '
'.$expensereport->getLibStatut(4,$objp->amount).'