From 69e4420772841af91074503b3c6b6d31af9b79b7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 May 2019 11:53:36 +0200 Subject: [PATCH 01/95] FIX missing "dropdown-icon" replacement --- htdocs/main.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b0d34db43eb..6563e60e239 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1738,7 +1738,7 @@ function top_menu_user(User $user, Translate $langs) $userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1); $userDropDownImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'dropdown-user-image', 'small', 0, 1); } - else{ + else { $nophoto='/public/theme/common/user_anonymous.png'; if ($user->gender == 'man') $nophoto='/public/theme/common/user_man.png'; if ($user->gender == 'woman') $nophoto='/public/theme/common/user_woman.png'; @@ -1752,7 +1752,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
'; // login infos - if (!empty($user->admin)) { + if (! empty($user->admin)) { $dropdownBody.= '
' . $langs->trans("Administrator").': '.yn($user->admin); } if (! empty($user->socid)) // Add thirdparty for external users @@ -1805,7 +1805,7 @@ function top_menu_user(User $user, Translate $langs) $profilName = $user->getFullName($langs).' ('.$user->login.')'; - if($user->admin){ + if (! empty($user->admin)) { $profilName = ' '.$profilName; } @@ -1851,6 +1851,8 @@ function top_menu_user(User $user, Translate $langs) if (!$(event.target).closest("#topmenu-login-dropdown").length) { // Hide the menus. $("#topmenu-login-dropdown").removeClass("open"); + $("#dropdown-icon-down").show(); // use show/hide instead toggle for avoid conflict + $("#dropdown-icon-up").hide(); // use show/hide instead toggle for avoid conflict } }); From 71d984483d5883a1b9ac3fd928175df45bf90031 Mon Sep 17 00:00:00 2001 From: Eric Seigne <1468823+rycks@users.noreply.github.com> Date: Mon, 17 Jun 2019 14:45:49 +0200 Subject: [PATCH 02/95] Update print VAT document: remove form part and add right title --- htdocs/compta/tva/quadri_detail.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 8b58bde4199..0f359dd9721 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -5,6 +5,7 @@ * Copyright (C) 2006-2015 Yannick Warnier * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Eric Seigne * * 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 @@ -116,7 +117,8 @@ foreach ($listofparams as $param) if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); } -llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring); +$title = $langs->trans("VATReport") . " " . dol_print_date($date_start) . " -> " . dol_print_date($date_end); +llxHeader('',$title,'','',0,0,'','',$morequerystring); //print load_fiche_titre($langs->trans("VAT"),""); @@ -184,8 +186,10 @@ if ($mysoc->tva_assuj) { $vatsup.=' ('.$langs->trans("ToGetBack").')'; } - -report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); +$optioncss = GETPOST('optioncss'); +if($optioncss != "print") { + report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); +} $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); From e6ee1e70413f19e139a089f1626770b6f73e0a76 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 27 Jun 2019 14:21:38 +0200 Subject: [PATCH 03/95] FIX Force order method in order supplier before making order --- htdocs/fourn/commande/card.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 9b27810e6bb..178816bccbb 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -902,6 +902,17 @@ $result = $object->updateline( } } + // Open DSI -- Force mandatory order method -- Begin + if ($action == 'commande') { + $methodecommande = GETPOST('methodecommande'); + + if ($methodecommande <= 0) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("OrderMode")), null, 'errors'); + $action = 'makeorder'; + } + } + // Open DSI -- Force mandatory order method -- End + if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); @@ -2543,7 +2554,10 @@ elseif (! empty($object->id)) print $form->selectDate($date_com, '', 1, 1, '', "commande", 1, 1); print ''; - print ''.$langs->trans("OrderMode").''; + // Open DSI -- Force mandatory order method -- Begin + //print ''.$langs->trans("OrderMode").''; + print ''.$langs->trans("OrderMode").''; + // Open DSI -- Force mandatory order method -- End $formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1); print ''; From f4978e9473e53a4959155ae731fe4fd839097ead Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 28 Jun 2019 10:58:31 +0200 Subject: [PATCH 04/95] FIX/NEW - Force mandatory order method --- htdocs/fourn/commande/card.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 178816bccbb..ff1b1020ae6 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -902,7 +902,7 @@ $result = $object->updateline( } } - // Open DSI -- Force mandatory order method -- Begin + // Force mandatory order method if ($action == 'commande') { $methodecommande = GETPOST('methodecommande'); @@ -911,7 +911,6 @@ $result = $object->updateline( $action = 'makeorder'; } } - // Open DSI -- Force mandatory order method -- End if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { @@ -2554,10 +2553,8 @@ elseif (! empty($object->id)) print $form->selectDate($date_com, '', 1, 1, '', "commande", 1, 1); print ''; - // Open DSI -- Force mandatory order method -- Begin - //print ''.$langs->trans("OrderMode").''; + // Force mandatory order method print ''.$langs->trans("OrderMode").''; - // Open DSI -- Force mandatory order method -- End $formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1); print ''; From 3e91fdda77a6763a347c2f419aec4e945f3d4053 Mon Sep 17 00:00:00 2001 From: fbosman Date: Mon, 1 Jul 2019 12:34:27 +0200 Subject: [PATCH 05/95] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5016d10780d..b065bb27470 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5008,6 +5008,8 @@ abstract class CommonObject $attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey]; $attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey]; $attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey]; + $attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey]; + if ($attributeRequired) { @@ -5024,6 +5026,12 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); + if (!empty($attrfieldcomputed)) + { + $value = dol_eval($attrfieldcomputed, 1, 0); + $new_array_options[$key] = $value; + } + switch ($attributeType) { From 8cdb251ca5038bc2959d68b3f41991926fc18719 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 2 Jul 2019 10:13:26 +0200 Subject: [PATCH 06/95] FIX product_use_units was set to 0 each time a conf in block other was set --- htdocs/product/admin/product.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 334640e87d3..4c58591e987 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -245,12 +245,12 @@ if ($action == 'set') if (! $res > 0) $error++; } -if ($action == 'other') -{ - $value = GETPOST('activate_units', 'alpha'); - $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; -} +//if ($action == 'other') +//{ +// $value = GETPOST('activate_units', 'alpha'); +// $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity); +// if (! $res > 0) $error++; +//} if ($action) { From 6b43c325c74923158dc71a8c8a39f86a0f2adcf5 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 2 Jul 2019 10:53:47 +0200 Subject: [PATCH 07/95] Fix wrong column for filters on invoice template list --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 306106d4889..0e09cb72ab1 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -264,7 +264,7 @@ if ($search_month_date_when > 0) if ($search_year_date_when > 0 && empty($search_day_date_when)) $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,$search_month_date_when,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,$search_month_date_when,false))."'"; else if ($search_year_date_when > 0 && ! empty($search_day_date_when)) - $sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; + $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; else $sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'"; } From 1b4507f07d03555724eb3aa6e401b99432c8b0f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 11:40:05 +0200 Subject: [PATCH 08/95] Fix on a hidden option --- htdocs/projet/element.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 08351fc752f..b4d2a8b290f 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -605,6 +605,7 @@ foreach ($listofreferent as $key => $value) if ($key == 'invoice') { if (! empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice, do not include into total + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $element->type == Facture::TYPE_DEPOSIT) $qualifiedfortotal=false; // If hidden option to use deposits as payment (deprecated, not recommended to use this), deposits are not included } if ($key == 'propal') { From ab7cb7bb2e3debda6ee7c7ce5a2c8dc2e87a3a5e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 2 Jul 2019 12:01:50 +0200 Subject: [PATCH 09/95] FIX Nowrap on amount --- htdocs/compta/facture/list.php | 14 +++++++------- htdocs/don/card.php | 4 ++-- htdocs/don/class/don.class.php | 4 ++-- htdocs/fourn/facture/list.php | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6c325c865a9..284b747465d 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1143,7 +1143,7 @@ if ($resql) // Amount HT if (! empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."\n"; + print ''.price($obj->total_ht)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; $totalarray['totalht'] += $obj->total_ht; @@ -1151,7 +1151,7 @@ if ($resql) // Amount VAT if (! empty($arrayfields['f.total_vat']['checked'])) { - print ''.price($obj->total_vat)."\n"; + print ''.price($obj->total_vat)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; $totalarray['totalvat'] += $obj->total_vat; @@ -1159,7 +1159,7 @@ if ($resql) // Amount LocalTax1 if (! empty($arrayfields['f.total_localtax1']['checked'])) { - print ''.price($obj->total_localtax1)."\n"; + print ''.price($obj->total_localtax1)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; $totalarray['totallocaltax1'] += $obj->total_localtax1; @@ -1167,7 +1167,7 @@ if ($resql) // Amount LocalTax2 if (! empty($arrayfields['f.total_localtax2']['checked'])) { - print ''.price($obj->total_localtax2)."\n"; + print ''.price($obj->total_localtax2)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; $totalarray['totallocaltax2'] += $obj->total_localtax2; @@ -1175,7 +1175,7 @@ if ($resql) // Amount TTC if (! empty($arrayfields['f.total_ttc']['checked'])) { - print ''.price($obj->total_ttc)."\n"; + print ''.price($obj->total_ttc)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; @@ -1183,7 +1183,7 @@ if ($resql) if (! empty($arrayfields['dynamount_payed']['checked'])) { - print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''; // TODO Use a denormalized field + print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; $totalarray['totalam'] += $totalpay; @@ -1191,7 +1191,7 @@ if ($resql) if (! empty($arrayfields['rtp']['checked'])) { - print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''; // TODO Use a denormalized field + print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; $totalarray['totalrtp'] += $remaintopay; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index cd92d8d02f5..6e6bab0cf57 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -154,7 +154,7 @@ if ($action == 'add') if (! $error) { - $object->socid = GETPOST("socid", 'int'); + $object->socid = GETPOST("socid", 'int'); $object->firstname = GETPOST("firstname", 'alpha'); $object->lastname = GETPOST("lastname", 'alpha'); $object->societe = GETPOST("societe", 'alpha'); @@ -164,7 +164,7 @@ if ($action == 'add') $object->town = GETPOST("town", 'alpha'); $object->country_id = GETPOST('country_id', 'int'); $object->email = GETPOST('email', 'alpha'); - $object->date = $donation_date; + $object->date = $donation_date; $object->note_private = GETPOST("note_private", 'none'); $object->note_public = GETPOST("note_public", 'none'); $object->public = GETPOST("public", 'alpha'); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index d75e658a191..caeb70aca94 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -392,11 +392,11 @@ class Don extends CommonObject $sql.= ", phone"; $sql.= ", phone_mobile"; $sql.= ") VALUES ("; - $sql.= " '".$this->db->idate($now)."'"; + $sql.= "'".$this->db->idate($now)."'"; $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); - $sql.= ", '".$this->db->escape($this->socid)."'"; + $sql.= ", ".($this->socid?$this->socid:"null"); $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index ed7caf0061d..7d51f3783c1 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -986,7 +986,7 @@ if ($resql) // Amount HT if (! empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."\n"; + print ''.price($obj->total_ht)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; $totalarray['totalht'] += $obj->total_ht; @@ -994,7 +994,7 @@ if ($resql) // Amount VAT if (! empty($arrayfields['f.total_vat']['checked'])) { - print ''.price($obj->total_vat)."\n"; + print ''.price($obj->total_vat)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; $totalarray['totalvat'] += $obj->total_vat; @@ -1002,7 +1002,7 @@ if ($resql) // Amount LocalTax1 if (! empty($arrayfields['f.total_localtax1']['checked'])) { - print ''.price($obj->total_localtax1)."\n"; + print ''.price($obj->total_localtax1)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; $totalarray['totallocaltax1'] += $obj->total_localtax1; @@ -1010,7 +1010,7 @@ if ($resql) // Amount LocalTax2 if (! empty($arrayfields['f.total_localtax2']['checked'])) { - print ''.price($obj->total_localtax2)."\n"; + print ''.price($obj->total_localtax2)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; $totalarray['totallocaltax2'] += $obj->total_localtax2; @@ -1018,7 +1018,7 @@ if ($resql) // Amount TTC if (! empty($arrayfields['f.total_ttc']['checked'])) { - print ''.price($obj->total_ttc)."\n"; + print ''.price($obj->total_ttc)."\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; @@ -1026,7 +1026,7 @@ if ($resql) if (! empty($arrayfields['dynamount_payed']['checked'])) { - print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''; // TODO Use a denormalized field + print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; $totalarray['totalam'] += $totalpay; @@ -1034,7 +1034,7 @@ if ($resql) if (! empty($arrayfields['rtp']['checked'])) { - print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''; // TODO Use a denormalized field + print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; $totalarray['totalrtp'] += $remaintopay; From 028833836445f5553e4a9a9b3140464b363090ec Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 2 Jul 2019 14:38:09 +0200 Subject: [PATCH 10/95] Fix column price display --- htdocs/product/price.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index c636deab22b..4b777feb6ef 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1554,12 +1554,12 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ { print ''; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type != 'TTC' ? price($objp->price) : ''); + print price($objp->price); } print ""; print ''; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : ''); + print price($objp->price_ttc); } print ""; if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled @@ -1569,13 +1569,13 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print ''; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type != 'TTC' ? price($objp->price_min) : ''); + print price($objp->price_min); } print ''; print ''; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : ''); + print price($objp->price_min_ttc); } print ''; From 8a25c854e9b75c9134e5232a0640799e9badaa9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 14:38:26 +0200 Subject: [PATCH 11/95] Hide sensitive data --- .../DataCollector/DolRequestDataCollector.php | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php index e4d8e89159a..d6e939a9964 100644 --- a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php @@ -8,6 +8,31 @@ use \DebugBar\DataCollector\RequestDataCollector; class DolRequestDataCollector extends RequestDataCollector { + public function collect() + { + $vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER'); + $data = array(); + + foreach ($vars as $var) { + if (isset($GLOBALS[$var])) { + $arrayofvalues = $GLOBALS[$var]; + + if ($var == '_COOKIE') + { + foreach($arrayofvalues as $key => $val) + { + if (preg_match('/^DOLSESSID_/', $key)) $arrayofvalues[$key]='*****hidden*****'; + } + //var_dump($arrayofvalues); + } + + $data["$" . $var] = $this->getDataFormatter()->formatVar($arrayofvalues); + } + } + + return $data; + } + /** * Return widget settings * @@ -20,7 +45,7 @@ class DolRequestDataCollector extends RequestDataCollector $langs->load("other"); return array( - $langs->transnoentities('Request') => array( + $langs->transnoentities('Variables') => array( "icon" => "tags", "widget" => "PhpDebugBar.Widgets.VariableListWidget", "map" => "request", From 3b0f1c733f36d6a6de2181da60783fdd71624da7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 15:00:17 +0200 Subject: [PATCH 12/95] Fix missing token --- htdocs/core/boxes/box_graph_invoices_permonth.php | 1 + htdocs/core/boxes/box_graph_invoices_supplier_permonth.php | 1 + htdocs/core/boxes/box_graph_orders_permonth.php | 1 + htdocs/core/boxes/box_graph_orders_supplier_permonth.php | 1 + htdocs/core/boxes/box_graph_product_distribution.php | 1 + htdocs/core/boxes/box_graph_propales_permonth.php | 1 + htdocs/main.inc.php | 1 + 7 files changed, 7 insertions(+) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 4323661370c..91416452609 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -224,6 +224,7 @@ class box_graph_invoices_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index bba5185c94a..b95cffdb499 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -221,6 +221,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index b06558393aa..271ed4911b4 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -220,6 +220,7 @@ class box_graph_orders_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 9cb11aed7c1..b7589e0efd2 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -219,6 +219,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 0fe5c66d532..0cdffafa050 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -338,6 +338,7 @@ class box_graph_product_distribution extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index b21381473c2..42643fb72bc 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -223,6 +223,7 @@ class box_graph_propales_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d283abd7d15..5456e2ce1eb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -374,6 +374,7 @@ if (! defined('NOTOKENRENEWAL')) //var_dump(GETPOST('token').' '.$_SESSION['token'].' - '.$_SESSION['newtoken'].' '.$_SERVER['SCRIPT_FILENAME']); // Check token +//var_dump((! defined('NOCSRFCHECK')).' '.empty($dolibarr_nocsrfcheck).' '.(! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)).' '.$_SERVER['REQUEST_METHOD'].' '.(! GETPOSTISSET('token'))); if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set { From a75a2ae8e45a730e9a74ac9944acb43aac4c4ee2 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 2 Jul 2019 15:44:42 +0200 Subject: [PATCH 13/95] Fix missing hidden input and short label --- htdocs/admin/dict.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d160793b735..6bffb7fe535 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1889,6 +1889,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') { print ''; } + else{ + print ''; + } print ''; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { @@ -1951,7 +1954,13 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } else { - if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position'; + + $fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''; + + if ($fieldlist[$field]=='sortorder') + { + $fieldlist[$field]='position'; + } $classtd=''; $class=''; if ($fieldlist[$field]=='code') $classtd='width100'; @@ -1972,7 +1981,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { $langs->load("bills"); - $transkey="PaymentCondition".strtoupper($obj->code); + $transkey="PaymentConditionShort".strtoupper($obj->code); } if ($transkey && $langs->trans($transkey) != $transkey) { @@ -1982,8 +1991,11 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } if (! $transfound) { - print ''; + print ''; } + else{ + print ''; + } print ''; } } From d9560dbb6187a26c6badf7af3be04e467cccc1bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 18:02:06 +0200 Subject: [PATCH 14/95] Fix var not initialized --- htdocs/core/modules/export/export_csv.modules.php | 3 +++ htdocs/core/modules/export/export_excel.modules.php | 2 ++ htdocs/core/modules/export/export_excel2007new.modules.php | 2 ++ 3 files changed, 7 insertions(+) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index c3c8431962e..9d606aadc33 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -261,6 +261,9 @@ class ExportCsv extends ModeleExports } $this->col=0; + + $reg=array(); + foreach($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code); diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index ffb1fd83cce..0e7fd0f1169 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -345,6 +345,8 @@ class ExportExcel extends ModeleExports // Define first row $this->col=0; + $reg=array(); + foreach($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code); diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 266cedc1310..038446643a2 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -304,6 +304,8 @@ class ExportExcel2007new extends ModeleExports // Define first row $this->col=0; + $reg=array(); + foreach($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code); From 9d50c672088b16a6208358e4f1e890ca3ab0eaab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 18:06:51 +0200 Subject: [PATCH 15/95] FIX option EXPORT_LABEL_FOR_SELECT to restore compatibility in export --- htdocs/core/extrafieldsinexport.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 13b2d1ae520..78dbba9934e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -34,6 +34,15 @@ if ($resql) // This can fail when class is used on old database (during migra case 'boolean': $typeFilter="Boolean"; break; + case 'select': + if (! empty($conf->global->EXPORT_LABEL_FOR_SELECT)) + { + $tmpparam=unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) + if ($tmpparam['options'] && is_array($tmpparam['options'])) { + $typeFilter="Select:".$obj->param; + } + } + break; case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null From 126479b5a9408bc3c6c55fa640e276fc44d36c4e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 2 Jul 2019 21:46:00 +0200 Subject: [PATCH 16/95] Fix paymentmethod detach --- htdocs/societe/paymentmodes.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6a3596f6e24..21af1f0a35c 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -637,6 +637,16 @@ if (empty($reshook)) elseif ($action == 'deletecard' && $source) { try { + if (preg_match('/pm_/', $source)) + { + $payment_method = \Stripe\PaymentMethod::retrieve($source); + if ($payment_method) + { + $payment_method->detach(); + } + } + else + { $cu=$stripe->customerStripe($object, $stripeacc, $servicestatus); $card=$cu->sources->retrieve("$source"); if ($card) @@ -645,6 +655,7 @@ if (empty($reshook)) if (method_exists($card, 'detach')) $card->detach(); else $card->delete(); } + } $url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; header('Location: '.$url); From 03938e21239396b44353f234a2d8219694722332 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 2 Jul 2019 21:56:50 +0200 Subject: [PATCH 17/95] Update paymentmodes.php --- htdocs/societe/paymentmodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 21af1f0a35c..0e41e11cbaa 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -639,7 +639,7 @@ if (empty($reshook)) try { if (preg_match('/pm_/', $source)) { - $payment_method = \Stripe\PaymentMethod::retrieve($source); + $payment_method = \Stripe\PaymentMethod::retrieve($source, ["stripe_account" => $stripeacc]); if ($payment_method) { $payment_method->detach(); From ff68b110b27aca9c0f76b12d0ddc38acdd73726a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 23:14:22 +0200 Subject: [PATCH 18/95] Fix phpcs --- .../debugbar/class/DataCollector/DolRequestDataCollector.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php index d6e939a9964..ebf9e2bfbd2 100644 --- a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php @@ -8,6 +8,11 @@ use \DebugBar\DataCollector\RequestDataCollector; class DolRequestDataCollector extends RequestDataCollector { + /** + * Collects the data from the collectors + * + * @return array + */ public function collect() { $vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER'); From 221c202add5821ed95c81d855446fbdac86df68e Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 06:59:52 +0200 Subject: [PATCH 19/95] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b065bb27470..8949dbc5f97 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5026,7 +5026,7 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); - if (!empty($attrfieldcomputed)) + if ((!empty($attrfieldcomputed) && (! empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS))) { $value = dol_eval($attrfieldcomputed, 1, 0); $new_array_options[$key] = $value; From 9064737930307a62f75c0f406794925ddf7056df Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 07:08:53 +0200 Subject: [PATCH 20/95] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8949dbc5f97..d164761366d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5026,7 +5026,7 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); - if ((!empty($attrfieldcomputed) && (! empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS))) + if ((!empty($attrfieldcomputed)) && (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS))) { $value = dol_eval($attrfieldcomputed, 1, 0); $new_array_options[$key] = $value; From 818a8c7d5963c719f26ebaa92f069aef345c8ab4 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Wed, 3 Jul 2019 10:44:12 +0200 Subject: [PATCH 21/95] Fix missing form end tag in prelevement --- htdocs/compta/prelevement/create.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index d9298c9f607..747bbdf828d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -181,6 +181,7 @@ else print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; } +print "\n"; print "
\n"; print '
'; From 116c6d7a6a9b03eb61ba8564646b4a22fe1a7cc1 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 11:09:24 +0200 Subject: [PATCH 22/95] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d164761366d..67d75a62169 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5026,10 +5026,19 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); - if ((!empty($attrfieldcomputed)) && (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS))) + + if (!empty($attrfieldcomputed)) { + if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) + { $value = dol_eval($attrfieldcomputed, 1, 0); + dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); $new_array_options[$key] = $value; + } + else + { + $new_array_options[$key] = null; + } } From 433835860c2cbf470b9421d75f035a2567c33aee Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 3 Jul 2019 13:12:41 +0200 Subject: [PATCH 23/95] FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized --- htdocs/comm/action/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 470a90c355f..8989807a645 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2019 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -246,7 +247,10 @@ if ($action == 'add') { $object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n"; } - else $object->label = $cactioncomm->libelle; + else { + $cactioncomm->fetch($object->type_code); + $object->label = $cactioncomm->label; + } } } $object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0; From 135e47892bcd7f62b27c801feec835b02be84692 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 16:15:20 +0200 Subject: [PATCH 24/95] Update admin_extrafields_add.tpl.php --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 04720004492..a7ae00b9ac9 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -179,7 +179,7 @@ $langs->load("modulebuilder"); trans("LanguageFile"); ?> -textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> +textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning', '', 0, 2, 'tooltipcompute'); ?> trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> From 123cf7ce502d494915c25ba03b1bd71f2faa8169 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 16:16:45 +0200 Subject: [PATCH 25/95] Update admin_extrafields_add.tpl.php --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index a7ae00b9ac9..5bd161c9893 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -179,7 +179,7 @@ $langs->load("modulebuilder"); trans("LanguageFile"); ?> -textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning', '', 0, 2, 'tooltipcompute'); ?> +textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> From 3e53a06b2ef93b487dbb4b18ffb3b4c82292ad40 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Wed, 3 Jul 2019 16:17:47 +0200 Subject: [PATCH 26/95] minor spelling issues --- htdocs/fourn/commande/dispatch.php | 4 ++-- htdocs/langs/fr_FR/stocks.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 77fd4b1aa69..dd6fd76a46a 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -245,7 +245,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) // We ask to move a qty if (GETPOST($qty) != 0) { if (! (GETPOST($ent, 'int') > 0)) { - dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); + dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); $error ++; @@ -282,7 +282,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) // We ask to move a qty if (GETPOST($qty) > 0) { if (! (GETPOST($ent, 'int') > 0)) { - dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); + dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline) . '-' . ($reg[1] + 1); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); $error ++; diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 5898f7384e5..df9f738f4d8 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -65,7 +65,7 @@ RuleForStockManagementIncrease=Règle de gestion des incrémentations de stock ( DeStockOnBill=Décrémenter les stocks physiques sur validation des factures/avoirs clients DeStockOnValidateOrder=Décrémenterr les stocks physiques sur validation des commandes clients DeStockOnShipment=Décrémenter les stocks physiques sur validation des expéditions -DeStockOnShipmentOnClosing=Décrémenter les stocks phisiques au classement "clôturée" de l'expédition +DeStockOnShipmentOnClosing=Décrémenter les stocks physiques au classement "clôturée" de l'expédition ReStockOnBill=Incrémenter les stocks physiques sur validation des factures/avoirs fournisseurs ReStockOnValidateOrder=Incrémenter les stocks physiques sur approbation des commandes fournisseurs ReStockOnDispatchOrder=Incrémenter les stocks physiques sur ventilation manuelle dans les entrepôts, après réception de la marchandise From 9962243df3b772c64018c782bc15195856a8906f Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 16:19:51 +0200 Subject: [PATCH 27/95] Update admin_extrafields_edit.tpl.php --- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 7ed41af9281..2acdf7e864f 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -243,7 +243,7 @@ else trans("LanguageFile"); ?> -textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> +textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> From f8a5ae90e3cf8ac89feae9f4eb8d8e616528931e Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 16:43:47 +0200 Subject: [PATCH 28/95] Update admin.lang --- htdocs/langs/en_US/admin.lang | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7480550195a..73d825d8320 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -422,6 +422,8 @@ ExtrafieldCheckBoxFromList=Checkboxes from table ExtrafieldLink=Link to an object ComputedFormula=Computed field ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: $db, $conf, $langs, $mysoc, $user, $object.
WARNING: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example.
Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.

Example of formula:
$object->id < 10 ? round($object->id / 2, 2): ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)

Example to reload object
(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id: ($obj->rowid ? $obj->rowid: $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5: '-1'

Other example of formula to force load of object and its parent object:
(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: 'Parent project not found' +Computedpersistent=Store computed field +ComputedpersistentDesc=Computed extra fields will be stored in the database, however, the value will only be recalculated when the object of this field is changed. If the computed field depends on other objects or global data this value might be wrong!! ExtrafieldParamHelpPassword=Leaving this field blank means this value will be stored without encryption (field must be only hidden with star on screen).
Set 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retrieve original value) ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
code3,value3
...

In order to have the list depending on another complementary attribute list:
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key

In order to have the list depending on another list:
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... @@ -1924,4 +1926,4 @@ UrlForIFTTT=URL endpoint for IFTTT YouWillFindItOnYourIFTTTAccount=You will find it on your IFTTT account EndPointFor=End point for %s : %s DeleteEmailCollector=Delete email collector -ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? \ No newline at end of file +ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? From cd7d4de6ecae99d7723ed55d7e9e1141242c6bbc Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 3 Jul 2019 16:53:26 +0200 Subject: [PATCH 29/95] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 67d75a62169..0a300476fb5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5029,7 +5029,7 @@ abstract class CommonObject if (!empty($attrfieldcomputed)) { - if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) + if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { $value = dol_eval($attrfieldcomputed, 1, 0); dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); From 2f5b9ccb22b9bcd3cce64d3a234bdf3e945b6d1e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 3 Jul 2019 17:00:18 +0200 Subject: [PATCH 30/95] fix case objecttmp is an invoice --- htdocs/core/class/html.form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fe8a812a8a2..a8d96ed4b34 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5558,7 +5558,8 @@ class Form if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company'; $confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT - $fieldstoshow='t.ref'; + if (DOL_VERSION < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber'; + else $fieldstoshow='t.ref'; if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...) { $tmpfieldstoshow=''; From 75aa11e5269efcccf6d3b4de08ebfa7f7dc6a217 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 01:58:25 +0200 Subject: [PATCH 31/95] Code comment --- htdocs/core/triggers/interface_20_all_Logevents.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 1ce13ff2193..92d93eef10f 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; /** - * Class of triggers for security events + * Class of triggers for security audit events */ class InterfaceLogevents extends DolibarrTriggers { @@ -47,7 +47,7 @@ class InterfaceLogevents extends DolibarrTriggers public $version = self::VERSION_DOLIBARR; /** - * Function called when a Dolibarrr business event is done. + * Function called when a Dolibarrr security audit event is done. * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code From 10e3e37c6c2d560b283263e673ad46d86cc6981a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 10:39:30 +0200 Subject: [PATCH 32/95] Update don.class.php --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index caeb70aca94..638de5580e4 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -396,7 +396,7 @@ class Don extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); - $sql.= ", ".($this->socid?$this->socid:"null"); + $sql.= ", ".($this->socid > 0 ? $this->socid : "null"); $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; From cf458c77dccb086aae2cb485e72c3f1fbba7be1a Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Thu, 4 Jul 2019 11:43:17 +0200 Subject: [PATCH 33/95] FIX: hook added on fileupload.class.php to enable modules to override upload options --- htdocs/core/class/fileupload.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index c3a40599877..17444cb5358 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -45,6 +45,8 @@ class FileUpload { global $db, $conf; global $object; + global $hookmanager; + $hookmanager->initHooks(array('fileupload')); $this->fk_element=$fk_element; $this->element=$element; @@ -183,6 +185,18 @@ class FileUpload ) ) ); + + $hookmanager->executeHooks( + 'overrideUploadOptions', + array( + 'options' => &$options, + 'element' => $element + ), + $object, + $action, + $hookmanager + ); + if ($options) { $this->options = array_replace_recursive($this->options, $options); } From b065cbc6f88023a7f6bef9a2c225bd3098c7a5e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 12:09:04 +0200 Subject: [PATCH 34/95] FIX #11446 --- htdocs/product/class/product.class.php | 39 ++++++++++++++------------ test/phpunit/ProductTest.php | 27 +++++++++++++++++- 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 69cd6ba077c..c0038ac17d8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3716,7 +3716,7 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Fonction recursive uniquement utilisee par get_arbo_each_prod, recompose l'arborescence des sousproduits - * Define value of this->res + * Define value of this->res * * @param array $prod Products array * @param string $compl_path Directory path of parents to add before @@ -3730,7 +3730,7 @@ class Product extends CommonObject // phpcs:enable global $conf,$langs; - $product = new Product($this->db); + $tmpproduct = null; //var_dump($prod); foreach($prod as $id_product => $desc_pere) // $id_product is 0 (first call starting with root top) or an id of a sub_product { @@ -3746,23 +3746,26 @@ class Product extends CommonObject } //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; - $this->fetch($id); // Load product - $this->load_stock('nobatch,novirtual'); // Load stock to get true this->stock_reel + if (is_null($tmpproduct)) $tmpproduct = new Product($this->db); // So we initialize tmpproduct only once for all loop. + $tmpproduct->fetch($id); // Load product to get ->ref + $tmpproduct->load_stock('nobatch,novirtual'); // Load stock to get true ->stock_reel + //$this->fetch($id); // Load product to get ->ref + //$this->load_stock('nobatch,novirtual'); // Load stock to get true ->stock_reel $this->res[]= array( - 'id'=>$id, // Id product - 'id_parent'=>$id_parent, - 'ref'=>$this->ref, // Ref product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_reel, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'label'=>$label, - 'fullpath'=>$compl_path.$label, // Label - 'type'=>$type, // Nb of units that compose parent product - 'desiredstock'=>$this->desiredstock, - 'level'=>$level, - 'incdec'=>$incdec, - 'entity'=>$this->entity + 'id'=>$id, // Id product + 'id_parent'=>$id_parent, + 'ref'=>$tmpproduct->ref, // Ref product + 'nb'=>$nb, // Nb of units that compose parent product + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$tmpproduct->stock_reel, // Stock + 'stock_alert'=>$tmpproduct->seuil_stock_alerte, // Stock alert + 'label'=>$label, + 'fullpath'=>$compl_path.$label, // Label + 'type'=>$type, // Nb of units that compose parent product + 'desiredstock'=>$tmpproduct->desiredstock, + 'level'=>$level, + 'incdec'=>$incdec, + 'entity'=>$tmpproduct->entity ); // Recursive call if there is childs to child diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index c57ef426d0b..782d5f076e8 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ProductTest extends PHPUnit_Framework_TestCase +class ProductTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; @@ -168,6 +168,31 @@ class ProductTest extends PHPUnit_Framework_TestCase return $localobject; } + /** + * testProductGetArboEachProd + * + * @return void + */ + public function testProductGetArboEachProd() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + /* + $localobject=new Product($db); + $localobject->fetch(208); + $localobject->get_sousproduits_arbo(); + $localobject->get_arbo_each_prod(); + + var_dump($localobject->res); print (json_encode($localobject->res)); exit; + */ + + return; + } + /** * testProductUpdate * From fb69f23bbaaa9270f0f3fd2cd78ca2c281e0ff79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 12:10:29 +0200 Subject: [PATCH 35/95] Fix phpunit --- test/phpunit/ProductTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 782d5f076e8..115475113fa 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ProductTest extends PHPUnit\Framework\TestCase +class ProductTest extends PHPUnit_Framework_TestCase { protected $savconf; protected $savuser; From 63c93be94e0a28be0cb05fb08ecc3c76c2f2e7cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 12:20:34 +0200 Subject: [PATCH 36/95] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a8d96ed4b34..a462f40ebdc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5558,7 +5558,7 @@ class Form if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company'; $confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT - if (DOL_VERSION < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber'; + if (((float) DOL_VERSION) < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber'; else $fieldstoshow='t.ref'; if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...) { From 657a3ae4c5bfd5d9f7c8d0f561a87922832e979b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 12:43:32 +0200 Subject: [PATCH 37/95] FIX permission to delete a draft purchase order --- htdocs/fourn/commande/card.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index da2930ed667..3e42552a942 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2516,7 +2516,7 @@ elseif (! empty($object->id)) } // Delete - if ($user->rights->fournisseur->commande->supprimer) + if (! empty($user->rights->fournisseur->commande->supprimer) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && ! empty($user->rights->fournisseur->commande->creer))) { print ''.$langs->trans("Delete").''; } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cc2eb5062cb..28c817658f6 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -434,7 +434,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '' . $langs->trans('SendMail') . ''."\n"; // Modify - if ($user->rights->mymodule->write) + if (! empty($user->rights->mymodule->write)) { print ''.$langs->trans("Modify").''."\n"; } @@ -444,7 +444,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if ($user->rights->mymodule->write) + if (! empty($user->rights->mymodule->write)) { print ''; } @@ -463,7 +463,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - if ($user->rights->mymodule->delete) + // Delete (need delete permission, or if draft, just need create/modify permission) + if (! empty($user->rights->mymodule->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mymodule->write))) { print ''.$langs->trans('Delete').''."\n"; } From 512b832c77bd1247cd0684f54b7d77e4aca457bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 13:26:20 +0200 Subject: [PATCH 38/95] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 15b986d4bff..6f4fd4fa660 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1349,7 +1349,7 @@ img.photorefnoborder { } .trextrafieldseparator td { /* border-bottom: 2px solid rgb() !important; */ - border-bottom: 2px solid rgb() !important; + border-bottom: 2px dashed rgb() !important; } .tdhrthin { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6fd50fa42b3..332b4964a94 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1562,6 +1562,10 @@ img.photorefnoborder { .underbanner { border-bottom: px solid rgb(); } + +.trextrafieldseparator td { + border-bottom: 1px solid rgb() !important; +} .tdhrthin { margin: 0; padding-bottom: 0 !important; From bfa7f22209ecc36cb4c12bd2b0ab20b742645974 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 May 2019 11:53:36 +0200 Subject: [PATCH 39/95] FIX missing "dropdown-icon" replacement --- htdocs/main.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5456e2ce1eb..4e1a6ecf01d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1741,7 +1741,7 @@ function top_menu_user(User $user, Translate $langs) $userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1); $userDropDownImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'dropdown-user-image', 'small', 0, 1); } - else{ + else { $nophoto='/public/theme/common/user_anonymous.png'; if ($user->gender == 'man') $nophoto='/public/theme/common/user_man.png'; if ($user->gender == 'woman') $nophoto='/public/theme/common/user_woman.png'; @@ -1755,7 +1755,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
'; // login infos - if (!empty($user->admin)) { + if (! empty($user->admin)) { $dropdownBody.= '
' . $langs->trans("Administrator").': '.yn($user->admin); } if (! empty($user->socid)) // Add thirdparty for external users @@ -1808,7 +1808,7 @@ function top_menu_user(User $user, Translate $langs) $profilName = $user->getFullName($langs).' ('.$user->login.')'; - if($user->admin){ + if (! empty($user->admin)) { $profilName = ' '.$profilName; } @@ -1868,6 +1868,8 @@ function top_menu_user(User $user, Translate $langs) if (!$(event.target).closest("#topmenu-login-dropdown").length) { // Hide the menus. $("#topmenu-login-dropdown").removeClass("open"); + $("#dropdown-icon-down").show(); // use show/hide instead toggle for avoid conflict + $("#dropdown-icon-up").hide(); // use show/hide instead toggle for avoid conflict } }); From f2c1568d0939125d81007dec93f1cced15ac285f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 15:43:05 +0200 Subject: [PATCH 40/95] NEW Extrafields separator can be collapsed or not --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 31 ++++++++------- .../core/tpl/admin_extrafields_edit.tpl.php | 39 +++++++++++-------- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 04720004492..5d55009737e 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -44,7 +44,7 @@ $langs->load("modulebuilder"); jQuery(document).ready(function() { function init_typeoffields(type) { - console.log("We select a new type = "+type); + console.log("select a new type (add) = "+type); var size = jQuery("#size"); var computed_value = jQuery("#computed_value"); var langfile = jQuery("#langfile"); @@ -68,7 +68,6 @@ $langs->load("modulebuilder"); ?> // Case of computed field - console.log(type); if (type == '' || type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { jQuery("tr.extra_computed_value").show(); } else { @@ -96,18 +95,19 @@ $langs->load("modulebuilder"); else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'html') { size.val('2000').removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } - else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").show();} + else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();} + else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} + else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpchkbxlst").show();} + else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helplink").show();} else if (type == 'separate') { langfile.val('').prop('disabled',true);size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); - jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide(); + jQuery("#value_choice").show(); + jQuery(".spanforparamtooltip").hide(); jQuery("#helpseparate").show(); } else { // type = string size.val('').prop('disabled', true); @@ -165,11 +165,12 @@ $langs->load("modulebuilder"); - textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 7ed41af9281..119d3db7478 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -43,7 +43,7 @@ $langs->load("modulebuilder"); jQuery(document).ready(function() { function init_typeoffields(type) { - console.log("select new type "+type); + console.log("select a new type (edit) = "+type); var size = jQuery("#size"); var computed_value = jQuery("#computed_value"); var langfile = jQuery("#langfile"); @@ -54,7 +54,7 @@ $langs->load("modulebuilder"); var list = jQuery("#list"); var totalizable = jQuery("#totalizable"); load("modulebuilder"); else if (type == 'text') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'html') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'varchar') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } - else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").show();} - else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();} - else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} + else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} + else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} + else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} + else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} + else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpchkbxlst").show();} + else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helplink").show();} + else if (type == 'separate') { + size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); + jQuery("#value_choice").show(); + jQuery(".spanforparamtooltip").hide(); jQuery("#helpseparate").show(); + } else { // type = string size.val('').prop('disabled', true); unique.removeAttr('disabled'); @@ -229,11 +233,12 @@ else - textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7480550195a..e3aec89e613 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -429,6 +429,7 @@ ExtrafieldParamHelpradio=List of values must be lines with format key,value (whe ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

- idfilter is necessarly a primary int key
- filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax: ObjectName:Classpath
Examples:
Societe:societe/class/societe.class.php
Contact:contact/class/contact.class.php +ExtrafieldParamHelpSeparator=Keep empty for a simple separator
Set this to 1 for a collapsing separator (open by default)
Set this to 2 for a collapsing separator (collapsed by default) LibraryToBuildPDF=Library used for PDF generation LocalTaxDesc=Some countries may apply two or three taxes on each invoice line. If this is the case, choose the type for the second and third tax and its rate. Possible type are:
1: local tax apply on products and services without vat (localtax is calculated on amount without tax)
2: local tax apply on products and services including vat (localtax is calculated on amount + main tax)
3: local tax apply on products without vat (localtax is calculated on amount without tax)
4: local tax apply on products including vat (localtax is calculated on amount + main vat)
5: local tax apply on services without vat (localtax is calculated on amount without tax)
6: local tax apply on services including vat (localtax is calculated on amount + tax) SMS=SMS From 1de499a320f7ca5bd4726ebe3d4f3eafdab1cfa8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 15:52:03 +0200 Subject: [PATCH 41/95] Update card.php --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ff1b1020ae6..2c3df524109 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2547,7 +2547,7 @@ elseif (! empty($object->id)) print load_fiche_titre($langs->trans("ToOrder"), '', ''); print ''; //print ''; - print '\n"; - print "'; } // Town - if (! empty($arrayfields['s.town']['checked'])) print ''; + if (! empty($arrayfields['s.town']['checked'])) print ''; // Zip - if (! empty($arrayfields['s.zip']['checked'])) print ''; + if (! empty($arrayfields['s.zip']['checked'])) print ''; // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; } // Country @@ -1004,7 +1004,7 @@ if ($resql) // Town if (! empty($arrayfields['s.town']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; @@ -1012,7 +1012,7 @@ if ($resql) // Zip if (! empty($arrayfields['s.zip']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; From b691396fceedcda48a57550efd694c3e9724bf44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 16:19:24 +0200 Subject: [PATCH 45/95] Update admin_extrafields_add.tpl.php --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 5bd161c9893..0db5d6afb68 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -179,7 +179,11 @@ $langs->load("modulebuilder"); - +global->STORE_COMPUTED_EXTRAFIELDS)) { > + + + + From f14b0b4fcc79fa01ff5b1fb514ce6bb9c78550f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 16:20:01 +0200 Subject: [PATCH 46/95] Update admin_extrafields_add.tpl.php --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 0db5d6afb68..834462aab5f 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -179,7 +179,7 @@ $langs->load("modulebuilder"); -global->STORE_COMPUTED_EXTRAFIELDS)) { > +global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { > From 0d738a04f9d617b4efe0a6b1d2d24e48feaeab0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 16:22:10 +0200 Subject: [PATCH 47/95] Update admin_extrafields_edit.tpl.php --- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 2acdf7e864f..17399b0a824 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -243,7 +243,11 @@ else - +global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> + + + + From 4c03aa6547bd927da00d023746ca26a84b2c9f4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 17:03:36 +0200 Subject: [PATCH 48/95] Fix selection of profile for demo --- htdocs/public/demo/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 0f6e21f0984..62de885eac6 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -97,7 +97,7 @@ if (empty($reshook)) ), // All demo profile array('default'=>'0', 'key'=>'profdemoall','label'=>'ChooseYourDemoProfilMore', - 'disablemodules'=>'adherent,don,externalsite,mailmanspip', + 'disablemodules'=>'adherent,don,externalsite,mailmanspip,takepos', //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png' 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-all.jpg' ) @@ -106,10 +106,10 @@ if (empty($reshook)) // Visible $alwayscheckedmodules=array('barcode','bookmark','categorie','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want - $alwaysuncheckedmodules=array('dav','dynamicprices','incoterm','loan','multicurrency','paybox','paypal','stripe','google','printing','scanner','skype','takepos','workflow','website'); // Module we dont want by default + $alwaysuncheckedmodules=array('dav','dynamicprices','incoterm','loan','multicurrency','paybox','paypal','stripe','google','printing','scanner','skype','website'); // Module we dont want by default // Not visible $alwayshiddencheckedmodules=array('accounting','api','barcode','blockedlog','bookmark','clicktodial','comptabilite','cron','document','domain','externalrss','externalsite','fckeditor','geoipmaxmind','gravatar','label','ldap', - 'mailmanspip','notification','oauth','syslog','user','webservices', + 'mailmanspip','notification','oauth','syslog','user','webservices','workflow', // Extended modules 'memcached','numberwords','zipautofillfr'); $alwayshiddenuncheckedmodules=array('debugbar','emailcollector','ftp','hrm','modulebuilder','webservicesclient','websites', @@ -392,10 +392,10 @@ foreach ($demoprofiles as $profilearray) //if ($modulo == 0) print ''; print ''; print '
'; - print '
'.$val->getName().'

'; + print '>
'; print '
'; //if ($modulo == ($nbcolsmod - 1)) print ''; $j++; From 01b1b2e4a7879319cc46c81b818f3dda3b6aa9c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 17:07:26 +0200 Subject: [PATCH 49/95] Fix syntax error --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 552d74955b2..360db1e94b0 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -180,9 +180,9 @@ $langs->load("modulebuilder"); -global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { > +global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> - + From c3715646e746bd8b4ebeaee71b4b8b314d4857df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 21:29:27 +0200 Subject: [PATCH 50/95] Missing trans --- htdocs/langs/en_US/companies.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index ae189111c15..616b565496a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -287,6 +287,7 @@ SupplierAbsoluteDiscountAllUsers=Absolute vendor discounts (entered by all users SupplierAbsoluteDiscountMy=Absolute vendor discounts (entered by yourself) DiscountNone=None Vendor=Vendor +Supplier=Vendor AddContact=Create contact AddContactAddress=Create contact/address EditContact=Edit contact From 3d076d8bf91d3b0512de2d34588144afcace2757 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Fri, 5 Jul 2019 11:15:43 +0200 Subject: [PATCH 51/95] FIX : We must save code instead of value in database for template invoice modelpdf --- htdocs/compta/facture/fiche-rec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 8c45012085d..31a4affb95d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1423,8 +1423,8 @@ else include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; $list = array(); $models = ModelePDFFactures::liste_modeles($db); - foreach ($models as $model) { - $list[] = $model . ':' . $model; + foreach ($models as $k => $model) { + $list[] = $k . ':' . $model; } $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); From e3359c6f0fd861515e3c87b3fff52b1519e19da9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 11:21:04 +0200 Subject: [PATCH 52/95] FIX Can't submit a ticket from public interface --- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/public/ticket/create_ticket.php | 35 +++++++++++-------- htdocs/public/ticket/index.php | 8 ++--- htdocs/public/ticket/list.php | 15 ++++---- htdocs/public/ticket/view.php | 14 ++++---- htdocs/theme/eldy/global.inc.php | 3 ++ htdocs/theme/md/style.css.php | 38 +++++++++++---------- 8 files changed, 65 insertions(+), 52 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 1d681d2672b..6f712fa6c4d 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -419,7 +419,7 @@ class FormTicket if ($withdolfichehead) dol_fiche_end(); - print '
'; + print '
'; print ''; if ($this->withcancel) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index c5791e5c89e..9e0c357be05 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -159,7 +159,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; + print ''; if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { print '
'; diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 42774772eb5..b663aaa43c3 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -59,7 +59,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); */ // Add file in email form -if (GETPOST('addfile') && !GETPOST('add_ticket')) { +if (GETPOST('addfile', 'alpha') && ! GETPOST('add', 'alpha')) { ////$res = $object->fetch('','',GETPOST('track_id')); ////if($res > 0) ////{ @@ -77,7 +77,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) { } // Remove file -if (GETPOST('removedfile') && !GETPOST('add_ticket')) { +if (GETPOST('removedfile', 'alpha') && !GETPOST('add', 'alpha')) { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; @@ -89,7 +89,7 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) { dol_remove_file_process($_POST['removedfile'], 0, 0); $action = 'create_ticket'; } -if ($action == 'create_ticket' && GETPOST('add_ticket')) { +if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { $error = 0; $origin_email = GETPOST('email', 'alpha'); if (empty($origin_email)) { @@ -311,7 +311,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $formmail->remove_attached_files($i); } - setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); + //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); + + // Make a redirect to avoid to have ticket submitted twice if we make back + setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '' . $object->track_id . ''), null, 'warnings'); + setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); + header("Location: index.php"); + exit; } } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -324,21 +330,23 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { * View */ -$arrayofjs = array(); -$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php'); - -llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); - $form = new Form($db); $formticket = new FormTicket($db); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) +{ print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; $db->close(); exit(); } -print '
'; +$arrayofjs = array(); +$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php'); + +llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); + + +print '
'; if ($action != "infos_success") { $formticket->withfromsocid = isset($socid) ? $socid : $user->societe_id; @@ -361,11 +369,8 @@ if ($action != "infos_success") { print '
' . $langs->trans('TicketPublicInfoCreateTicket') . '
'; $formticket->showForm(); -} else { - print '
' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '' . $object->track_id . ''); - print '
'; - print $langs->trans('PleaseRememberThisId'); } + print '
'; // End of page diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index a3e4d63a4bc..2e138312102 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -55,18 +55,18 @@ $action = GETPOST('action', 'alpha'); $form = new Form($db); $formticket = new FormTicket($db); -$arrayofjs = array(); -$arrayofcss = array('/ticket/css/styles.css.php'); - if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print $langs->trans('TicketPublicInterfaceForbidden'); exit; } +$arrayofjs = array(); +$arrayofcss = array('/ticket/css/styles.css.php'); + llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -print '
'; +print '
'; print '

' . ($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")) . '

'; print '
'; print '
' . dol_escape_htmltag($langs->trans("CreateTicket")) . '
'; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 443af658cb5..9da0a4272e1 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -155,21 +155,23 @@ $user_assign = new User($db); $user_create = new User($db); $formTicket = new FormTicket($db); +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; + $db->close(); + exit(); +} + $arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; - $db->close(); - exit(); -} -print '
'; +print '
'; if ($action == "view_ticketlist") { + print '
'; if ($display_ticket_list) { // Filters $search_fk_status = GETPOST("search_fk_status", 'alpha'); @@ -676,6 +678,7 @@ if ($action == "view_ticketlist") } } else { print '

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

'; + print '
'; print '
'; print ''; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index a0311ce1430..4886a0cc3be 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -133,18 +133,18 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | $form = new Form($db); $formticket = new FormTicket($db); +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; + $db->close(); + exit(); +} + $arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; - $db->close(); - exit(); -} - -print '
'; +print '
'; if ($action == "view_ticket" || $action == "add_message" || $action == "close" || $action == "confirm_public_close") { if ($display_ticket) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6f4fd4fa660..44c66a979d5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5248,6 +5248,9 @@ div.tabsElem a.tab { /* Ticket module */ /* ============================================================================== */ +.publicnewticketform { + margin-top: 25px !important; +} #cd-timeline { position: relative; padding: 2em 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 332b4964a94..c15bbf26eef 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1936,7 +1936,6 @@ a.tmenuimage:focus { } - /* Login */ .bodylogin @@ -5388,7 +5387,6 @@ border-top-right-radius: 6px; } - /* ============================================================================== */ /* Public */ /* ============================================================================== */ @@ -5402,26 +5400,14 @@ border-top-right-radius: 6px; } - -::-webkit-scrollbar { - width: 12px; -} -::-webkit-scrollbar-button { - background: #aaa -} -::-webkit-scrollbar-track-piece { - background: #fff -} -::-webkit-scrollbar-thumb { - background: #ddd -}​ - - - /* ============================================================================== */ /* Ticket module */ /* ============================================================================== */ +.publicnewticketform { + margin-top: 25px !important; +} + #cd-timeline { position: relative; padding: 2em 0; @@ -5833,6 +5819,22 @@ border-top-right-radius: 6px; +/* This must be at end */ +::-webkit-scrollbar { + width: 12px; +} +::-webkit-scrollbar-button { + background: #aaa; +} +::-webkit-scrollbar-track-piece { + background: #fff; +} +::-webkit-scrollbar-thumb { + background: #ddd; +}​ + + + global->MAIN_DISABLE_FONT_AWESOME_5)) { ?> Date: Fri, 5 Jul 2019 11:45:10 +0200 Subject: [PATCH 53/95] Fix css --- htdocs/public/ticket/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 4886a0cc3be..69a77413b2e 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -298,7 +298,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | print ''; } } else { - print '

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

'; + print '

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

'; print '
'; print ''; From 5c6684bb734fc963838cda82d9d82f40e7bcee25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 11:53:33 +0200 Subject: [PATCH 54/95] Fix setup of ticket module --- htdocs/admin/ticket_public.php | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 1bcff705aef..4e6b6d75e85 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -185,12 +185,6 @@ if ($action == 'setvarother') { if (!$res > 0) { $error++; } - - $param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } } @@ -260,7 +254,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print ''; // Check if email exists - print '
'; + print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; } - // Auto assign ticket at user who created it - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("ToOrder").'
'.$langs->trans("OrderDate").''; + print '
'.$langs->trans("OrderDate").''; $date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($date_com)) $date_com=dol_now(); print $form->selectDate($date_com, '', 1, 1, '', "commande", 1, 1); From fb8c93a69ded1430d62baedf987707be0cec45a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 16:00:14 +0200 Subject: [PATCH 42/95] FIX Bad sql request --- 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 f4a25334e00..3e9b2ba8797 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2568,7 +2568,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed=1; } $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$db->escape($refname)."' AND entity=".$conf->entity; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } // Wrapping pour les rapport de paiements elseif ($modulepart == 'supplier_payment') From 4e00cfb455d93861e50a770619d5ae2780b6cc9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 16:02:04 +0200 Subject: [PATCH 43/95] Clean code --- htdocs/core/lib/files.lib.php | 2 +- htdocs/fourn/commande/card.php | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8fe5f5b0db4..b578a6f5b8a 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2568,7 +2568,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed=1; } $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$db->escape($refname)."' AND entity=".$conf->entity; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } // Wrapping pour les rapport de paiements elseif ($modulepart == 'supplier_payment') diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d96ce6cbd17..bae5741d4ea 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2536,11 +2536,11 @@ elseif (! empty($object->id)) - if ($user->rights->fournisseur->commande->commander && $object->statut == 2 && $action == 'makeorder') + if ($user->rights->fournisseur->commande->commander && $object->statut == CommandeFournisseur::STATUS_ACCEPTED && $action == 'makeorder') { // Set status to ordered (action=commande) print ''."\n"; - print '
'; + print ''; print ''; print ''; @@ -2574,9 +2574,7 @@ elseif (! empty($object->id)) { print '
'; - /* - * Documents generes - */ + // Generated documents $comfournref = dol_sanitizeFileName($object->ref); $file = $conf->fournisseur->dir_output . '/commande/' . $comfournref . '/' . $comfournref . '.pdf'; $relativepath = $comfournref.'/'.$comfournref.'.pdf'; @@ -2594,10 +2592,10 @@ elseif (! empty($object->id)) print '
'; - if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4)) + if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) { // Set status to received (action=livraison) - print ''."\n"; + print ''."\n"; print ''; print ''; print ''; @@ -2610,7 +2608,7 @@ elseif (! empty($object->id)) print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); print "
".$langs->trans("Delivery")."\n"; + print '
'.$langs->trans("Delivery")."\n"; $liv = array(); $liv[''] = ' '; $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); From ed39849d335252923059502df9f1e857b1d13505 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 16:14:10 +0200 Subject: [PATCH 44/95] Fix css --- htdocs/fourn/commande/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 80645e2a486..18ba697bc20 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -777,14 +777,14 @@ if ($resql) print ''; - print ''; + print ''; print ''; + print ''; print $obj->town; print ''; + print ''; print $obj->zip; print '
trans("LanguageFile"); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
trans("LanguageFile"); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
trans("LanguageFile"); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
trans("LanguageFile"); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
' . $langs->trans("TicketsEmailMustExist") . '
' . $langs->trans("TicketsEmailMustExist") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_EMAIL_MUST_EXISTS'); @@ -277,7 +271,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) /*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // Show logo for module - print '
' . $langs->trans("TicketsShowModuleLogo") . '
' . $langs->trans("TicketsShowModuleLogo") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO'); @@ -293,7 +287,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) }*/ // Show logo for company - print '
' . $langs->trans("TicketsShowCompanyLogo") . '
' . $langs->trans("TicketsShowCompanyLogo") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO'); @@ -310,7 +304,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) // Also send to main email address if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); @@ -330,21 +324,6 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print '
' . $langs->trans("TicketsAutoAssignTicket") . ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE); - } - print ''; - print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help'); - print '

'; if (!$conf->use_javascript_ajax) { From 575dce2dffb7cb0e2aee91d4a9b802c3ed0298eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 12:17:36 +0200 Subject: [PATCH 55/95] Fix css --- htdocs/compta/bank/bankentries_list.php | 5 +++-- htdocs/user/hierarchy.php | 2 +- htdocs/user/list.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 811fe663f8c..5609bb6b598 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -603,12 +603,13 @@ if ($resql) print $langs->trans("EventualyAddCategory").': '; print Form::selectarray('cat', $options, GETPOST('cat'), 1); } - print '
'.$langs->trans("ThenCheckLinesAndConciliate").' '; + print '
'.$langs->trans("ThenCheckLinesAndConciliate").' '; print ''; print ' '.$langs->trans("or").' '; print ''; print ' '.$langs->trans("or").' '; print ''; + print '
'; // Show last bank statements $nbmax=15; // We accept to show last 15 receipts (so we can have more than one year) @@ -617,7 +618,7 @@ if ($resql) $sql.= " WHERE fk_account=".$object->id." AND num_releve IS NOT NULL"; $sql.= $db->order("num_releve", "DESC"); $sql.= $db->plimit($nbmax+1); - print '

'; + print '
'; print $langs->trans("LastAccountStatements").' : '; $resqlr=$db->query($sql); if ($resqlr) diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index be18cb4051a..ca5e0b1862b 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -150,7 +150,7 @@ if ($canadduser) $newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu='); } -$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); +$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ad310b0041e..8c780c703f7 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -304,7 +304,7 @@ print ''; print ''; -$morehtmlright.= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-sitemap', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); +$morehtmlright.= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-sitemap paddingleft', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_generic', 0, $morehtmlright.' '.$newcardbutton, '', $limit); From 675b7b2e3215a950ff47415c449d0483b7d72e1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 13:11:30 +0200 Subject: [PATCH 56/95] Fix link to reconcile --- htdocs/compta/bank/releve.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ac4d17e4c49..b93f381c555 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -415,7 +415,7 @@ if (empty($numref)) if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } else { print ''.$langs->trans("Conciliate").''; } From 9b327639197692f9eb5cf3ac970d594f6f79107f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 15:25:29 +0200 Subject: [PATCH 57/95] Fix label for report n ledger for transitionnal bank account on tranfer --- htdocs/accountancy/journal/bankjournal.php | 32 ++++++++++++++++++---- htdocs/core/lib/accounting.lib.php | 5 ++-- htdocs/langs/en_US/accountancy.lang | 1 + 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index cfe49764c74..d4a9ff0d3f6 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -573,7 +573,14 @@ if (! $error && $action == 'writebookkeeping') { { $reflabel = ''; if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":""); - $reflabel.= dol_string_nohtmltag($val['soclib']); + if ($tabtype[$key] == 'banktransfert') + { + $reflabel.= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); + } + else + { + $reflabel.= dol_string_nohtmltag($val['soclib']); + } $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -702,7 +709,7 @@ if (! $error && $action == 'writebookkeeping') { } } } - else { // If thirdparty unkown, output the waiting account + else { // If thirdparty unknown, output the waiting account foreach ($tabbq[$key] as $k => $mt) { if ($mt) { @@ -831,7 +838,6 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $langs->transnoentitiesnoconv("Note") . '"' . $sep; print "\n"; - foreach ($tabpay as $key => $val) { $date = dol_print_date($db->jdate($val["date"]), 'day'); @@ -869,7 +875,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! { $reflabel = ''; if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":""); - $reflabel.= dol_string_nohtmltag($val['soclib']); + if ($tabtype[$key] == 'banktransfert') + { + $reflabel.= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); + } + else + { + $reflabel.= dol_string_nohtmltag($val['soclib']); + } print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -1087,7 +1100,14 @@ if (empty($action) || $action == 'view') { { $reflabel = ''; if (! empty($val['lib'])) $reflabel .= $val['lib'] . ($val['soclib']?" - ":""); - $reflabel.= $val['soclib']; + if ($tabtype[$key] == 'banktransfert') + { + $reflabel.= $langs->trans('TransitionalAccount').' '.$account_transfer; + } + else + { + $reflabel.= $val['soclib']; + } print ''; print ''; @@ -1115,7 +1135,7 @@ if (empty($action) || $action == 'view') { } else { - print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will a waiting account + print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account } } else diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 9545b6961fd..d6bd38b5030 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -175,7 +175,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build { global $langs; - print "\n\n\n"; + print "\n\n\n"; if(! is_empty($varlink)) $varlink = '?'.$varlink; @@ -186,6 +186,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build $head[$h][2] = 'journal'; print ''; + print ''; dol_fiche_head($head, 'journal'); @@ -240,5 +241,5 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build print ''; - print "\n\n\n"; + print "\n\n\n"; } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 3bb0df59812..ece95cfca29 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -158,6 +158,7 @@ ACCOUNTING_RESULT_LOSS=Result accounting account (Loss) ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal of closure ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transitional bank transfer +TransitionalAccount=Transitional bank transfer account ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations From 42576eb27a820cae0a756e932b6a0e02c6beac04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 17:22:13 +0200 Subject: [PATCH 58/95] Fix status of email templates not visible for non admin users --- htdocs/admin/mails_templates.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index e2f36f96fe9..b62009c2ba6 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -873,6 +873,7 @@ if ($resql) // Status / Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; + else print ''.$actl[$obj->active].''; print ""; // Modify link / Delete link From 93d9f73f1d03c7786d3927c20247cd7bcb630cbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 17:44:31 +0200 Subject: [PATCH 59/95] Trans --- htdocs/langs/en_US/accountancy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index ece95cfca29..6dfe4fc8c4f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -301,7 +301,7 @@ ChartofaccountsId=Chart of accounts Id InitAccountancy=Init accountancy InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases. DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set. -DefaultClosureDesc=This page can be used to set parameters to use to enclose a balance sheet. +DefaultClosureDesc=This page can be used to set parameters used for accounting closures. Options=Options OptionModeProductSell=Mode sales OptionModeProductSellIntra=Mode sales exported in EEC From 69db6e6aa7e834740eb3eb72ae325058aa2fb299 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 18:45:13 +0200 Subject: [PATCH 60/95] Fix look and feel v10 --- htdocs/admin/supplier_proposal.php | 2 +- .../supplier_proposal/admin/supplier_proposal_extrafields.php | 2 +- .../admin/supplier_proposaldet_extrafields.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 8b17c860fd4..e627068b692 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -220,7 +220,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal'); +dol_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal'); /* * Module numerotation diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 1b5c08119d1..c97ea508448 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -64,7 +64,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("CommRequests"), 0, 'supplier_proposal'); +dol_fiche_head($head, 'attributes', $langs->trans("CommRequests"), -1, 'supplier_proposal'); print $langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index b3b0e482f62..c54e65ad825 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -69,7 +69,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("CommRequests"), 0, 'supplier_proposal'); +dol_fiche_head($head, 'attributeslines', $langs->trans("CommRequests"), -1, 'supplier_proposal'); print $langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; From 709b738d7579b7ebda9365182b3b9bd31666771c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 18:54:51 +0200 Subject: [PATCH 61/95] Fix regression --- htdocs/core/class/conf.class.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 6e3fc66f89a..9c403b98104 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -364,6 +364,7 @@ class Conf $this->livraison_bon->enabled=(! empty($this->global->MAIN_SUBMODULE_LIVRAISON)?$this->global->MAIN_SUBMODULE_LIVRAISON:0); // Module fournisseur + // TODO To split into module supplier_invoice and supplier_order if (! empty($this->fournisseur)) { $this->fournisseur->commande=new stdClass(); @@ -376,11 +377,7 @@ class Conf $this->fournisseur->facture->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp"); $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; // For backward compatibility $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; // For backward compatibility - $this->supplierproposal=new stdClass(); - $this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal"); - $this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp"); - $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility - $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility + $this->fournisseur->payment=new stdClass(); $this->fournisseur->payment->multidir_output=array($this->entity => $rootfordata."/fournisseur/payment"); $this->fournisseur->payment->multidir_temp =array($this->entity => $rootfordata."/fournisseur/payment/temp"); @@ -409,15 +406,6 @@ class Conf $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; // For backward compatibility $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; // For backward compatibility } - - if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists - { - $this->supplier_proposal=new stdClass(); - $this->supplier_proposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal"); - $this->supplier_proposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp"); - $this->supplier_proposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility - $this->supplier_proposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility - } } } From bbb5b43e948367a8428df1ff3e5f95354299f0ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 19:03:16 +0200 Subject: [PATCH 62/95] Fix duplicate trans --- htdocs/fourn/commande/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index bae5741d4ea..4742774b868 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -392,7 +392,7 @@ if (empty($reshook)) } if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise === '') // Unit price can be 0 but not '' { - setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice')), null, 'errors'); $error++; } if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) @@ -2281,14 +2281,13 @@ elseif (! empty($object->id)) print ''; // Add free products/services form - global $forceall, $senderissupplier, $dateSelector; - $forceall=1; $dateSelector=0; + global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=0; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. //if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; if (! empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; // Show object lines - $inputalsopricewithtax=0; if (! empty($object->lines)) $ret = $object->printObjectLines($action, $societe, $mysoc, $lineid, 1); From d3b4a91f41b763ff07551b94383d3accf1031bdb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 20:24:22 +0200 Subject: [PATCH 63/95] NEW Can enter price tax incl on vendor proposal and purchase orders --- htdocs/fourn/commande/card.php | 39 ++++---- htdocs/fourn/facture/card.php | 4 +- htdocs/supplier_proposal/card.php | 96 ++++++++++++++----- .../class/supplier_proposal.class.php | 20 +++- 4 files changed, 106 insertions(+), 53 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4742774b868..ff33a42e2a9 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -114,6 +114,7 @@ elseif (! empty($socid) && $socid > 0) $permissionnote=$user->rights->fournisseur->commande->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->fournisseur->commande->creer; // Used by the include of actions_dellink.inc.php $permissiontoedit=$user->rights->fournisseur->commande->creer; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd=$user->rights->fournisseur->commande->creer; // Used by the include of actions_addupdatedelete.inc.php /* @@ -432,7 +433,7 @@ if (empty($reshook)) if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice', 'alpha'), $reg)) { $idprod=$reg[1]; - $res=$productsupplier->fetch($idprod); // Load product from its ID + $res=$productsupplier->fetch($idprod); // Load product from its id // Call to init some price properties of $productsupplier // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) @@ -494,7 +495,7 @@ if (empty($reshook)) 0, // We already have the $idprod always defined $ref_supplier, $remise_percent, - 'HT', + $price_base_type, $pu_ttc, $type, $tva_npr, @@ -511,7 +512,7 @@ if (empty($reshook)) // Product not selected $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); } if ($idprod == -1) { @@ -523,8 +524,6 @@ if (empty($reshook)) } elseif (empty($error)) // $price_ht is already set { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); $tva_tx = str_replace('*', '', $tva_tx); $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); @@ -552,7 +551,7 @@ if (empty($reshook)) $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result=$object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, '', '', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); + $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, '', '', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); } //print "xx".$tva_tx; exit; @@ -652,28 +651,28 @@ if (empty($reshook)) if (preg_match('/\*/', $vat_rate)) $info_bits |= 0x01; - // Define vat_rate + // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty); $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); if (GETPOST('price_ht') != '') { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); } else { - $vatratecleaned = $vat_rate; - if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" - { - $vatratecleaned = trim($reg[1]); - $vatratecode = $reg[2]; - } + $vatratecleaned = $vat_rate; + if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" + { + $vatratecleaned = trim($reg[1]); + $vatratecode = $reg[2]; + } - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($vatratecleaned / 100)); - $price_base_type = 'HT'; + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($vatratecleaned / 100)); + $price_base_type = 'HT'; } $pu_ht_devise = GETPOST('multicurrency_subprice'); @@ -689,7 +688,7 @@ if (empty($reshook)) } } -$result = $object->updateline( + $result = $object->updateline( $lineid, $_POST['product_desc'], $ht, @@ -2282,7 +2281,7 @@ elseif (! empty($object->id)) // Add free products/services form global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; - $forceall=1; $dateSelector=0; $inputalsopricewithtax=0; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. //if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; if (! empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a0a966e7210..ae042b4c4b8 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1175,7 +1175,7 @@ if (empty($reshook)) } if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise==='') // Unit price can be 0 but not '' { - setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice')), null, 'errors'); $error++; } if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) @@ -1332,7 +1332,7 @@ if (empty($reshook)) $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise, $ref_supplier); + $result = $object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise, $ref_supplier); } //print "xx".$tva_tx; exit; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 56473959a39..60034cc7bc0 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -77,6 +77,9 @@ $NBLINES = 4; if (! empty($user->societe_id)) $socid = $user->societe_id; $result = restrictedArea($user, 'supplier_proposal', $id); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('supplier_proposalcard','globalcard')); + $object = new SupplierProposal($db); $extrafields = new ExtraFields($db); @@ -92,9 +95,6 @@ if ($id > 0 || ! empty($ref)) { dol_print_error('', $object->error); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('supplier_proposalcard','globalcard')); - $permissionnote = $user->rights->supplier_proposal->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->supplier_proposal->creer; // Used by the include of actions_dellink.inc.php $permissiontoedit=$user->rights->supplier_proposal->creer; // Used by the include of actions_lineupdown.inc.php @@ -565,9 +565,9 @@ if (empty($reshook)) $error ++; } - if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. + if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise === '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPrice")), null, 'errors'); $error ++; } if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { @@ -585,7 +585,7 @@ if (empty($reshook)) // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit - if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' + if (($prod_entry_mode != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { $productsupplier = new ProductFournisseur($db); @@ -595,7 +595,7 @@ if (empty($reshook)) if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice', 'alpha'), $reg)) { $idprod=$reg[1]; - $res=$productsupplier->fetch($idprod); + $res=$productsupplier->fetch($idprod); // Load product from its ID // Call to init some price properties of $productsupplier // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) @@ -632,23 +632,21 @@ if (empty($reshook)) if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); - $pu_ht = $productsupplier->fourn_pu; - $type = $productsupplier->type; $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); $ref_supplier = $productsupplier->ref_supplier; - $fk_unit = $productsupplier->fk_unit; - $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); - if (empty($tva_tx)) $tva_npr=0; $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); - $result=$object->addline( + $pu_ht = $productsupplier->fourn_pu; + if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value + + $result=$object->addline( $desc, $pu_ht, $qty, @@ -669,7 +667,7 @@ if (empty($reshook)) $label, $array_options, $ref_supplier, - $fk_unit, + $productsupplier->fk_unit, '', 0, $productsupplier->fourn_multicurrency_unitprice @@ -730,6 +728,8 @@ if (empty($reshook)) { $db->commit(); + $ret=$object->fetch($object->id); // Reload to get new records + // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -798,32 +798,52 @@ if (empty($reshook)) // Mise a jour d'une ligne dans la demande de prix elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) { + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + // Define info_bits $info_bits = 0; - if (preg_match('/\*/', GETPOST('tva_tx'))) + if (preg_match('/\*/', $vat_rate)) $info_bits |= 0x01; - // Clean parameters + // Clean parameters $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'none')); // Define vat_rate - $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); - $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); - $pu_ht = GETPOST('price_ht') ? GETPOST('price_ht') : 0; + $localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); + + if (GETPOST('price_ht') != '') + { + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); + } + else + { + $vatratecleaned = $vat_rate; + if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" + { + $vatratecleaned = trim($reg[1]); + $vatratecode = $reg[2]; + } + + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($vatratecleaned / 100)); + $price_base_type = 'HT'; + } + + $pu_ht_devise = GETPOST('multicurrency_subprice'); // Add buying price $fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : ''); $buyingprice = (GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value - // Extrafields + // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); - // Unset extrafield + // Unset extrafield POST Data if (is_array($extralabelsline)) { - // Get extra fields foreach ($extralabelsline as $key => $value) { unset($_POST["options_" . $key]); } @@ -869,9 +889,33 @@ if (empty($reshook)) if (! $error) { $db->begin(); + $ref_supplier = GETPOST('fourn_ref', 'alpha'); $fk_unit = GETPOST('units'); - $result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $array_options, $ref_supplier, $fk_unit); + + $result = $object->updateline( + GETPOST('lineid'), + $ht, + GETPOST('qty'), + GETPOST('remise_percent'), + $vat_rate, + $localtax1_rate, + $localtax2_rate, + $description, + $price_base_type, + $info_bits, + $special_code, + GETPOST('fk_parent_line'), + 0, + $fournprice, + $buyingprice, + $label, + $type, + $array_options, + $ref_supplier, + $fk_unit, + $pu_ht_devise + ); if ($result >= 0) { $db->commit(); @@ -1705,8 +1749,8 @@ if ($action == 'create') print '
'; // Add free products/services form - global $forceall, $senderissupplier, $dateSelector; - $forceall=1; $dateSelector=0; + global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty. if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 74073c0d7e4..2725cd18190 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -655,9 +655,10 @@ class SupplierProposal extends CommonObject * @param array $array_option extrafields array * @param string $ref_supplier Supplier price reference * @param int $fk_unit Id of the unit to use. + * @param double $pu_ht_devise Unit price in currency * @return int 0 if OK, <0 if KO */ - public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $array_option = 0, $ref_supplier = '', $fk_unit = '') + public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $array_option = 0, $ref_supplier = '', $fk_unit = '', $pu_ht_devise = 0) { global $conf,$user,$langs, $mysoc; @@ -684,10 +685,17 @@ class SupplierProposal extends CommonObject // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); - $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. + $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx); + // Clean vat code + $vat_src_code=''; + if (preg_match('/\((.*)\)/', $txtva, $reg)) + { + $vat_src_code = $reg[1]; + $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. + } + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -726,7 +734,9 @@ class SupplierProposal extends CommonObject $this->line->label = $label; $this->line->desc = $desc; $this->line->qty = $qty; - $this->line->product_type = $type; + $this->line->product_type = $type; + + $this->line->vat_src_code = $vat_src_code; $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; From ac9282667dfbc908d52e976f80be87e0cf49272e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 21:09:21 +0200 Subject: [PATCH 64/95] Try new phpunit syntax --- test/phpunit/ActionCommTest.php | 2 +- test/phpunit/AdherentTest.php | 2 +- test/phpunit/AdminLibTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index f9c0928bad2..921d0e6d70d 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ActionCommTest extends PHPUnit_Framework_TestCase +class ActionCommTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index bd5ae5571cc..c83df4da0d2 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class AdherentTest extends PHPUnit_Framework_TestCase +class AdherentTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index bbf5ae2da00..21133d21072 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class AdminLibTest extends PHPUnit_Framework_TestCase +class AdminLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; From 3af4ad7fc36f4861f54f104f01d321e0eff933c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 21:28:27 +0200 Subject: [PATCH 65/95] Compatibility with phpunit v6 --- test/phpunit/BOMTest.php | 2 +- test/phpunit/BankAccountTest.php | 2 +- test/phpunit/BonPrelevementTest.php | 2 +- test/phpunit/BuildDocTest.php | 2 +- test/phpunit/CMailFileTest.php | 2 +- test/phpunit/CategorieTest.php | 2 +- test/phpunit/ChargeSocialesTest.php | 2 +- test/phpunit/CodingPhpTest.php | 2 +- test/phpunit/CommandeFournisseurTest.php | 2 +- test/phpunit/CommandeTest.php | 2 +- test/phpunit/CommonObjectTest.php | 2 +- test/phpunit/CompanyBankAccountTest.php | 2 +- test/phpunit/CompanyLibTest.php | 2 +- test/phpunit/ContactTest.php | 2 +- test/phpunit/ContratTest.php | 2 +- test/phpunit/CoreTest.php | 2 +- test/phpunit/DateLibTest.php | 2 +- test/phpunit/DateLibTzFranceTest.php | 2 +- test/phpunit/DiscountTest.php | 2 +- test/phpunit/EntrepotTest.php | 2 +- test/phpunit/ExpenseReportTest.php | 2 +- test/phpunit/ExportTest.php | 2 +- test/phpunit/FactureFournisseurTest.php | 2 +- test/phpunit/FactureRecTest.php | 2 +- test/phpunit/FactureTest.php | 2 +- test/phpunit/FactureTestRounding.php | 2 +- test/phpunit/FichinterTest.php | 2 +- test/phpunit/FilesLibTest.php | 2 +- test/phpunit/FormAdminTest.php | 2 +- test/phpunit/Functions2LibTest.php | 2 +- test/phpunit/HolidayTest.php | 2 +- test/phpunit/ImagesLibTest.php | 2 +- test/phpunit/ImportTest.php | 2 +- test/phpunit/JsonLibTest.php | 2 +- test/phpunit/LangTest.php | 2 +- test/phpunit/LoanTest.php | 2 +- test/phpunit/MarginsLibTest.php | 2 +- test/phpunit/ModulesTest.php | 2 +- test/phpunit/MouvementStockTest.php | 2 +- test/phpunit/NumberingModulesTest.php | 2 +- test/phpunit/PaypalTest.php | 2 +- test/phpunit/PdfDocTest.php | 2 +- test/phpunit/PgsqlTest.php | 2 +- test/phpunit/PricesTest.php | 2 +- test/phpunit/ProductTest.php | 2 +- test/phpunit/ProjectTest.php | 2 +- test/phpunit/PropalTest.php | 2 +- test/phpunit/RestAPIDocumentTest.php | 2 +- test/phpunit/RestAPIUserTest.php | 2 +- test/phpunit/ScriptsTest.php | 2 +- test/phpunit/SecurityTest.php | 2 +- test/phpunit/SocieteTest.php | 2 +- test/phpunit/SupplierProposalTest.php | 2 +- test/phpunit/TicketTest.php | 2 +- test/phpunit/UserGroupTest.php | 2 +- test/phpunit/UserTest.php | 2 +- test/phpunit/UtilsTest.php | 2 +- test/phpunit/WebservicesInvoicesTest.php | 2 +- test/phpunit/WebservicesOrdersTest.php | 2 +- test/phpunit/WebservicesOtherTest.php | 2 +- test/phpunit/WebservicesProductsTest.php | 2 +- test/phpunit/WebservicesThirdpartyTest.php | 2 +- test/phpunit/WebservicesUserTest.php | 2 +- test/phpunit/XCalLibTest.php | 2 +- 64 files changed, 64 insertions(+), 64 deletions(-) diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index ace04f7ba71..1179b35e6e1 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -28,7 +28,7 @@ namespace test\unit; * Class BillOfMaterialsTest * @package Testbillofmaterials */ -class BOMTest extends \PHPUnit_Framework_TestCase +class BOMTest extends \PHPUnit\Framework\TestCase { /** * Global test setup diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index fa150742c4b..94149bd0ad5 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -46,7 +46,7 @@ $langs->load("main"); * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class BankAccountTest extends PHPUnit_Framework_TestCase +class BankAccountTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index 4ba05b2c0b6..d65d2066c2a 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -47,7 +47,7 @@ $langs->load("main"); * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class BonPrelevementTest extends PHPUnit_Framework_TestCase +class BonPrelevementTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index e8fa72a8f40..442b76091ff 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -74,7 +74,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class BuildDocTest extends PHPUnit_Framework_TestCase +class BuildDocTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index b664b345c26..9941eaa67da 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CMailFileTest extends PHPUnit_Framework_TestCase +class CMailFileTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 80761a6e594..46d8dbe875b 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CategorieTest extends PHPUnit_Framework_TestCase +class CategorieTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index b037e50752d..9eabbf20fa0 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ChargeSocialesTest extends PHPUnit_Framework_TestCase +class ChargeSocialesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index db6b3299bd5..b7636a5c934 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CodingPhpTest extends PHPUnit_Framework_TestCase +class CodingPhpTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 277328339ee..c249c47bd91 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CommandeFournisseurTest extends PHPUnit_Framework_TestCase +class CommandeFournisseurTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 00a0a4983c9..570165f3382 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CommandeTest extends PHPUnit_Framework_TestCase +class CommandeTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 549540bb0d0..e4bd0f73518 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CommonObjectTest extends PHPUnit_Framework_TestCase +class CommonObjectTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 58eebfd0207..08749d12619 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CompanyBankAccountTest extends PHPUnit_Framework_TestCase +class CompanyBankAccountTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CompanyLibTest.php b/test/phpunit/CompanyLibTest.php index 0fb1722aee9..9e211441103 100644 --- a/test/phpunit/CompanyLibTest.php +++ b/test/phpunit/CompanyLibTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CompanyLibTest extends PHPUnit_Framework_TestCase +class CompanyLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index ef43bd06311..c0ed8d7843f 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -53,7 +53,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ContactTest extends PHPUnit_Framework_TestCase +class ContactTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index c5342865979..c763a976172 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ContratTest extends PHPUnit_Framework_TestCase +class ContratTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index 51a0f54698f..4720df9014c 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -47,7 +47,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CoreTest extends PHPUnit_Framework_TestCase +class CoreTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 6424cb4d8df..cc4f50705e0 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class DateLibTest extends PHPUnit_Framework_TestCase +class DateLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index fa7aef2bed8..8913c56a77d 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class DateLibTzFranceTest extends PHPUnit_Framework_TestCase +class DateLibTzFranceTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index cd73a7ad173..8c461aba88a 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class DiscountTest extends PHPUnit_Framework_TestCase +class DiscountTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index a2c0e78ee96..61bb5fe1b49 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class EntrepotTest extends PHPUnit_Framework_TestCase +class EntrepotTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index c4b3e2a707a..570afd8bb18 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ExpenseReportTest extends PHPUnit_Framework_TestCase +class ExpenseReportTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 7403cba3ddf..5497f88cd67 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -49,7 +49,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ExportTest extends PHPUnit_Framework_TestCase +class ExportTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 33d503825ac..4d7df1f0ed7 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureFournisseurTest extends PHPUnit_Framework_TestCase +class FactureFournisseurTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index de1bb164451..5d9021032a2 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureRecTest extends PHPUnit_Framework_TestCase +class FactureRecTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 4f680ba32db..3c066380b09 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureTest extends PHPUnit_Framework_TestCase +class FactureTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index a0df47cd97f..1716bd51153 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureTestRounding extends PHPUnit_Framework_TestCase +class FactureTestRounding extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index 35680559581..c81e1c99e1a 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FichinterTest extends PHPUnit_Framework_TestCase +class FichinterTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 2411c5c9cf3..cbe6ad948d8 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FilesLibTest extends PHPUnit_Framework_TestCase +class FilesLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 8532d6ac283..20c22a76cd8 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FormAdminTest extends PHPUnit_Framework_TestCase +class FormAdminTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 50efabf9403..a83ba0f4859 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -48,7 +48,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class Functions2LibTest extends PHPUnit_Framework_TestCase +class Functions2LibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index a352a1722b9..7e3fc6a8069 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class HolidayTest extends PHPUnit_Framework_TestCase +class HolidayTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 4ecaab49d39..445fe572b61 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ImagesLibTest extends PHPUnit_Framework_TestCase +class ImagesLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 10d906f2ede..5a11a770842 100644 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -47,7 +47,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ImportTest extends PHPUnit_Framework_TestCase +class ImportTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index a84a78a7c75..c123f2e6ff6 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -47,7 +47,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class JsonLibTest extends PHPUnit_Framework_TestCase +class JsonLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 228cde51901..71d467b78d3 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class LangTest extends PHPUnit_Framework_TestCase +class LangTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php index b0ecd583514..e0cc1f5b5ff 100644 --- a/test/phpunit/LoanTest.php +++ b/test/phpunit/LoanTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class LoanTest extends PHPUnit_Framework_TestCase +class LoanTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/MarginsLibTest.php b/test/phpunit/MarginsLibTest.php index 81f4a512e4f..84fb59c81ec 100644 --- a/test/phpunit/MarginsLibTest.php +++ b/test/phpunit/MarginsLibTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class MarginsLibTest extends PHPUnit_Framework_TestCase +class MarginsLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index ea16813d873..38a630b46e0 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ModulesTest extends PHPUnit_Framework_TestCase +class ModulesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index cac49f34a7a..ba7b093596f 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class MouvementStockTest extends PHPUnit_Framework_TestCase +class MouvementStockTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 66c4c670128..57c376b702b 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class NumberingModulesTest extends PHPUnit_Framework_TestCase +class NumberingModulesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PaypalTest.php b/test/phpunit/PaypalTest.php index 98300a6a86a..54913b1e5f9 100644 --- a/test/phpunit/PaypalTest.php +++ b/test/phpunit/PaypalTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PaypalTest extends PHPUnit_Framework_TestCase +class PaypalTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 634a931da56..bece387b93f 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PdfDocTest extends PHPUnit_Framework_TestCase +class PdfDocTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index a1fcc180528..743328abb71 100644 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PgsqlTest extends PHPUnit_Framework_TestCase +class PgsqlTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 0203a1d4275..32babae209c 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -52,7 +52,7 @@ if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT)) * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PricesTest extends PHPUnit_Framework_TestCase +class PricesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 115475113fa..782d5f076e8 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ProductTest extends PHPUnit_Framework_TestCase +class ProductTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index faa533e2c00..886463be104 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ProjectTest extends PHPUnit_Framework_TestCase +class ProjectTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 6a3d17d7806..b0331a5575f 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PropalTest extends PHPUnit_Framework_TestCase +class PropalTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/RestAPIDocumentTest.php b/test/phpunit/RestAPIDocumentTest.php index f0d3efe34e6..08ea79352d3 100644 --- a/test/phpunit/RestAPIDocumentTest.php +++ b/test/phpunit/RestAPIDocumentTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_UMASK = '0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class RestAPIDocumentTest extends PHPUnit_Framework_TestCase +class RestAPIDocumentTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index 39f924e7e04..b44fb7aaccc 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class RestAPIUserTest extends PHPUnit_Framework_TestCase +class RestAPIUserTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index 4e43a036c7e..e4a2263e849 100644 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ScriptsTest extends PHPUnit_Framework_TestCase +class ScriptsTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 636fa923bc0..b457c4c0fa7 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class SecurityTest extends PHPUnit_Framework_TestCase +class SecurityTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 11eb6711862..f823d8a4803 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class SocieteTest extends PHPUnit_Framework_TestCase +class SocieteTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 14a63776444..ee95e882572 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class SupplierProposalTest extends PHPUnit_Framework_TestCase +class SupplierProposalTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index e5367d03fbe..4d7ce3363ed 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class TicketTest extends PHPUnit_Framework_TestCase +class TicketTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index e524b989172..be230655fe1 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class UserGroupTest extends PHPUnit_Framework_TestCase +class UserGroupTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index b87dfd84494..e993ed981a6 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class UserTest extends PHPUnit_Framework_TestCase +class UserTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index 58074af1c1f..5a913977ccc 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class UtilsTest extends PHPUnit_Framework_TestCase +class UtilsTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index fb8e36af6a1..77ad0902ec2 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase +class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index 8b989df273f..8e6312ac039 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesOrdersTest extends PHPUnit_Framework_TestCase +class WebservicesOrdersTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index bdc3a15b2b9..5c19414966b 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesOtherTest extends PHPUnit_Framework_TestCase +class WebservicesOtherTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index 90147a429a4..ff78d9d91bb 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -55,7 +55,7 @@ if (empty($conf->service->enabled)) * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesProductsTest extends PHPUnit_Framework_TestCase +class WebservicesProductsTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index cb1f26d1980..4effe555d2f 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase +class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index 7ca0d9e8ee8..d7df632e413 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesUserTest extends PHPUnit_Framework_TestCase +class WebservicesUserTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 4783bf4bc8f..602ec11e46d 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class XCalLibTest extends PHPUnit_Framework_TestCase +class XCalLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; From 0a7d70829f566b63eb1c1d1b3674c3462ec6f20f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 21:37:25 +0200 Subject: [PATCH 66/95] Translation of some comments --- htdocs/adherents/type.php | 2 +- htdocs/admin/tools/listevents.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/commande/customer.php | 2 +- htdocs/commande/orderstoinvoice.php | 2 +- htdocs/compta/clients.php | 2 +- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/expedition/list.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/commande/orderstoinvoice.php | 2 +- htdocs/fourn/product/list.php | 2 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/movement_card.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/replenish.php | 2 +- htdocs/reception/list.php | 2 +- htdocs/supplier_proposal/list.php | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 19790159c22..2c8c108b3d5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -603,7 +603,7 @@ if ($rowid > 0) print '
'; print '
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index d508afe63d2..39ed6162f0f 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -233,7 +233,7 @@ if ($result) print '
'; print ''; - // Lignes des champs de filtres + // Fields title search print ''; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 555e89e7a61..241f22cfe38 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -446,7 +446,7 @@ if ($resql) $newcardbutton.= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create'); } - // Lignes des champs de filtre + // Fields title search print ''; if ($optioncss != '') print ''; print ''; diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 8b7fef878ed..3fa3f90774f 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -133,7 +133,7 @@ if ($resql) print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder); print "\n"; - // Lignes des champs de filtre + // Fields title search print ''; print ''; - // Lignes des champs de filtre + // Fields title search print ''; print ''; print ''; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 36cc40c851c..58631937955 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -151,7 +151,7 @@ if ($resql) print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", '', $sortfield, $sortorder, 'right '); print "\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'.$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0).'
'; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 0d0b202a8c3..33acc2b4969 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -615,7 +615,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"'); print '
'; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 11de8aa48a2..64ae1dea1f2 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -157,7 +157,7 @@ if ($resql) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; print ''; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index f5c111f2268..8bd8c702d03 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -318,7 +318,7 @@ if ($resql) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; // Ref if (! empty($arrayfields['e.ref']['checked'])) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 18ba697bc20..475d42f66dc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -635,7 +635,7 @@ if ($resql) $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/commande/card.php?action=create'); } - // Lignes des champs de filtre + // Fields title search print ''; if ($optioncss != '') print ''; print ''; diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 093e0fd331b..6775e9f9b65 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -509,7 +509,7 @@ if (($action != 'create' && $action != 'add') && !$error) { print_liste_field_titre('GenerateBill', '', '', '', '', '', '', '', 'center '); print "\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; // REF diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 7b319490815..8fd7b809587 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -228,7 +228,7 @@ if ($resql) print ''; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; print ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 476fec36c2a..f75ba10a03c 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -274,7 +274,7 @@ if ($resql) print '
'; print ''; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; print ''; diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index faf91184dd1..d0803f40b95 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -271,7 +271,7 @@ if ($resql) print '
'; print ''; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; print ''; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 8178df6b03c..8e19242d1c1 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -187,7 +187,7 @@ if ($result) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index b75042c7cca..85065e8ec2b 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -766,7 +766,7 @@ if ($resql) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; if (! empty($arrayfields['m.rowid']['checked'])) { diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 836bb97e50c..efcbc534c08 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -742,7 +742,7 @@ if ($resql) print '
'; print '
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; if (! empty($arrayfields['m.rowid']['checked'])) { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 069be8aca96..b9799865e20 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -551,7 +551,7 @@ print '' ''. ''; -// Lignes des champs de filtre +// Fields title search print ''; print ''; print ''; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index e40be9f0d10..17518df8ab6 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -628,7 +628,7 @@ if ($resql) print '
'; print '
 
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; // Ref if (! empty($arrayfields['e.ref']['checked'])) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index fe010c95e9c..dabf49215fd 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -391,7 +391,7 @@ if ($resql) $newcardbutton.= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create'); } - // Lignes des champs de filtre + // Fields title search print ''; if ($optioncss != '') print ''; print ''; From f5cc29417d8f550c1265844de8c9f543a20b9f00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 21:50:35 +0200 Subject: [PATCH 67/95] Translation lignes -> lines --- htdocs/compta/facture/card.php | 4 ++-- .../class/ligneprelevement.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 +- .../commande/doc/pdf_einstein.modules.php | 2 +- .../expensereport/doc/pdf_standard.modules.php | 4 ++-- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../modules/facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/modFournisseur.class.php | 4 ++-- .../product/doc/pdf_standard.modules.php | 2 +- .../reception/doc/pdf_squille.modules.php | 2 +- .../modules/stock/doc/pdf_standard.modules.php | 2 +- htdocs/expedition/contact.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/product/list.php | 2 +- .../tables/llx_commande_fournisseurdet.sql | 2 +- .../mysql/tables/llx_expensereport_det.sql | 2 +- .../mysql/tables/llx_facture_fourn_det.sql | 2 +- .../mysql/tables/llx_facturedet_rec.sql | 2 +- htdocs/install/step2.php | 2 +- htdocs/install/upgrade2.php | 18 +++++++++--------- htdocs/livraison/class/livraison.class.php | 4 +--- .../product/actions_card_product.class.php | 2 +- .../canvas/product/tpl/card_view.tpl.php | 2 +- .../service/actions_card_service.class.php | 2 +- .../canvas/service/tpl/card_view.tpl.php | 2 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/reception/contact.php | 2 +- 28 files changed, 39 insertions(+), 41 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0adfb4e7ac2..968469ff1e0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -638,7 +638,7 @@ if (empty($reshook)) $resteapayer = $object->total_ttc - $totalpaye; - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + // We check that invlice lines are transferred into accountancy $ventilExportCompta = $object->getVentilExportCompta(); // On verifie si aucun paiement n'a ete effectue @@ -4616,7 +4616,7 @@ elseif ($id > 0 || ! empty($ref)) // Editer une facture deja validee, sans paiement effectue et pas exporte en compta if ($object->statut == Facture::STATUS_VALIDATED) { - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + // We check that invlice lines are transferred into accountancy $ventilExportCompta = $object->getVentilExportCompta(); if ($ventilExportCompta == 0) diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index e76cc9d184d..c0e6921c95d 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/prelevement/class/ligneprelevement.class.php * \ingroup prelevement - * \brief Fichier de la classe des lignes de prelevements + * \brief File of class to manage lines of Direct Debit orders */ diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7273ffc3a8e..e7461e2a053 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -862,7 +862,7 @@ class Contrat extends CommonObject } else { - dol_syslog(get_class($this)."::Fetch Erreur lecture des lignes de contrats liees aux produits"); + dol_syslog(get_class($this)."::Fetch Error when reading lines of contracts linked to products"); return -3; } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 0e064991444..0d95646c441 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -549,7 +549,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetLineStyle(array('dash'=>0)); } - $nexY+=2; // Passe espace entre les lignes + $nexY+=2; // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 99d2ab322e0..e322ef1aa84 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -414,8 +414,8 @@ class pdf_standard extends ModeleExpenseReport // $nblineFollowComment = max($nbLineCommentNeed, $nbLineTypeNeed); // } - //$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Passe espace entre les lignes - $nexY += ($pdf->getFontSize()*1.3); // Passe espace entre les lignes + //$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Add space between lines + $nexY += ($pdf->getFontSize()*1.3); // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4536add16bb..53929f28e75 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -318,7 +318,7 @@ class pdf_crabe extends ModelePDFFactures global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $nbpayments = count($object->getListOfPayments()); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 422060ab30b..b5529c78d8e 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -329,7 +329,7 @@ class pdf_sponge extends ModelePDFFactures global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $nbpayments = count($object->getListOfPayments()); diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index a545ce1378b..8ba2f173ffd 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -276,7 +276,7 @@ class modFournisseur extends DolibarrModules $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Factures fournisseurs et lignes de facture'; + $this->export_label[$r]='Vendor invoices and lines of invoices'; $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_fields_array[$r]=array( @@ -484,7 +484,7 @@ class modFournisseur extends DolibarrModules // Order $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Commandes fournisseurs et lignes de commandes'; + $this->export_label[$r]='Purchase Orders and lines of purchase orders'; $this->export_icon[$r]='order'; $this->export_permission[$r]=array(array("fournisseur","commande","export")); $this->export_fields_array[$r]=array( diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 6089a9fe66e..a9bc06f1021 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -493,7 +493,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetLineStyle(array('dash'=>0)); } - $nexY+=2; // Passe espace entre les lignes + $nexY+=2; // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 10be4430aea..71e78368d9c 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -216,7 +216,7 @@ class pdf_squille extends ModelePdfReception global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $pdf=pdf_getInstance($this->format); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 4be99b07c11..6c222f96dca 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -461,7 +461,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetLineStyle(array('dash'=>0)); } - $nexY+=2; // Passe espace entre les lignes + $nexY+=2; // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 4acb2fce932..9310df52ddf 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -255,7 +255,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); - // Lignes de contacts + // Lines of contacts echo '
'; // Contacts lines (modules that overwrite templates must declare this into descriptor) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 807b547a4bc..d9e01a6579f 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1386,7 +1386,7 @@ class Fichinter extends CommonObject } /** - * Classe permettant la gestion des lignes d'intervention + * Class to manage intervention lines */ class FichinterLigne extends CommonObjectLine { diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 8fd7b809587..bd5c0f1fd1e 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -249,7 +249,7 @@ if ($resql) print ''; print '
'; - // Lignes des titres + // Line for title print ''; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "ppf.ref_fourn", $param, "", "", $sortfield, $sortorder); diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql index dfbf4e261eb..f107e348bbe 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql @@ -47,7 +47,7 @@ create table llx_commande_fournisseurdet date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines rang integer DEFAULT 0, import_key varchar(14), fk_unit integer DEFAULT NULL, diff --git a/htdocs/install/mysql/tables/llx_expensereport_det.sql b/htdocs/install/mysql/tables/llx_expensereport_det.sql index 75d503ac181..ee583852deb 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_det.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_det.sql @@ -43,7 +43,7 @@ CREATE TABLE llx_expensereport_det total_ttc double(24,8) DEFAULT 0 NOT NULL, date date NOT NULL, info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines fk_multicurrency integer, multicurrency_code varchar(255), multicurrency_subprice double(24,8) DEFAULT 0, diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql index 2f75f9ff54e..57097f600c0 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql @@ -47,7 +47,7 @@ create table llx_facture_fourn_det date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, -- TVA NPR ou non fk_code_ventilation integer DEFAULT 0 NOT NULL, - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines rang integer DEFAULT 0, import_key varchar(14), fk_unit integer DEFAULT NULL, diff --git a/htdocs/install/mysql/tables/llx_facturedet_rec.sql b/htdocs/install/mysql/tables/llx_facturedet_rec.sql index 267abcd5053..8bb0c06e8f8 100644 --- a/htdocs/install/mysql/tables/llx_facturedet_rec.sql +++ b/htdocs/install/mysql/tables/llx_facturedet_rec.sql @@ -52,7 +52,7 @@ create table llx_facturedet_rec buy_price_ht double(24,8) DEFAULT 0, -- buying price. Note: this value is saved as an always positive value, even on credit notes (it is price we bought the product before selling it). fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created) - special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales + special_code integer UNSIGNED DEFAULT 0, -- code for special lines rang integer DEFAULT 0, -- ordre d'affichage fk_contract_line integer NULL, -- id of contract line when template invoice comes from contract lines fk_unit integer DEFAULT NULL, diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 1a8a4108827..4e645bb6934 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -311,7 +311,7 @@ if ($action == "set") { $buf = fgets($fp, 4096); - // Cas special de lignes autorisees pour certaines versions uniquement + // Special case of lines allowed for some version only if ($choix == 1 && preg_match('/^--\sV([0-9\.]+)/i', $buf, $reg)) { $versioncommande=explode('.', $reg[1]); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index c932b2631e8..11bfe9ff99f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1432,7 +1432,7 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de facture + * Update total of invoice lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1453,7 +1453,7 @@ function migrate_price_facture($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationInvoice')."
\n"; - // Liste des lignes facture non a jour + // List of invoice lines not up to date $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as vatrate, fd.total_ttc, fd.info_bits,"; $sql.= " f.rowid as facid, f.remise_percent as remise_percent_global, f.total_ttc as total_ttc_f"; $sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd, ".MAIN_DB_PREFIX."facture as f"; @@ -1551,7 +1551,7 @@ function migrate_price_facture($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de propal + * Update total of proposal lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1570,7 +1570,7 @@ function migrate_price_propal($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationProposal')."
\n"; - // Liste des lignes propal non a jour + // List of proposal lines not up to date $sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as vatrate, pd.info_bits,"; $sql.= " p.rowid as propalid, p.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."propal as p"; @@ -1679,7 +1679,7 @@ function migrate_price_contrat($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationContract')."
\n"; - // Liste des lignes contrat non a jour + // List of contract lines not up to date $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as contratid"; $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; @@ -1748,7 +1748,7 @@ function migrate_price_contrat($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de commande + * Update total of sales order lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1767,7 +1767,7 @@ function migrate_price_commande($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationOrder')."
\n"; - // Liste des lignes commande non a jour + // List of sales orders lines not up to date $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."commande as c"; @@ -1865,7 +1865,7 @@ function migrate_price_commande($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de commande fournisseur + * Update total of purchase order lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1884,7 +1884,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationSupplierOrder')."
\n"; - // Liste des lignes commande non a jour + // List of purchase order lines not up to date $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd, ".MAIN_DB_PREFIX."commande_fournisseur as c"; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 5d01dffa886..9021faf7542 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -322,9 +322,7 @@ class Livraison extends CommonObject // fetch optionals attributes and labels $this->fetch_optionals(); - /* - * Lignes - */ + // Load lines $result=$this->fetch_lines(); if ($result < 0) { diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index db7ad4d2b70..6247d84b045 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -199,7 +199,7 @@ class ActionsCardProduct if ($action == 'view') { // Photo - $this->tpl['nblignes'] = 4; + $this->tpl['nblines'] = 4; if ($this->object->is_photo_available($conf->product->multidir_output[$this->object->entity])) { $this->tpl['photos'] = $this->object->show_photos('product', $conf->product->multidir_output[$this->object->entity], 1, 1, 0, 0, 0, 80); diff --git a/htdocs/product/canvas/product/tpl/card_view.tpl.php b/htdocs/product/canvas/product/tpl/card_view.tpl.php index 06d9faf05b7..1f330257073 100644 --- a/htdocs/product/canvas/product/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_view.tpl.php @@ -56,7 +56,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); photos) { ?> - diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index fab5794c82a..85b1feb6795 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -195,7 +195,7 @@ class ActionsCardService if ($action == 'view') { // Photo - $this->tpl['nblignes'] = 4; + $this->tpl['nblines'] = 4; if ($this->object->is_photo_available($conf->service->multidir_output[$this->object->entity])) { $this->tpl['photos'] = $this->object->show_photos('product', $conf->service->multidir_output[$this->object->entity], 1, 1, 0, 0, 0, 80); diff --git a/htdocs/product/canvas/service/tpl/card_view.tpl.php b/htdocs/product/canvas/service/tpl/card_view.tpl.php index 8d2409ba5e2..29a0e18a8b7 100644 --- a/htdocs/product/canvas/service/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_view.tpl.php @@ -56,7 +56,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); photos) { ?> - diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index f75ba10a03c..1ecb136d817 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -303,7 +303,7 @@ if ($resql) print ''; print ''; - // Lignes des titres + //Line for column titles print ""; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index d0803f40b95..5d569fc41be 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -299,7 +299,7 @@ if ($resql) print ''; print ''; - // Lignes des titres + //Line for column titles print ""; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder); diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index d51062ef7ef..c3deb28c4bc 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -257,7 +257,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); - // Lignes de contacts + // Lines of contacts echo '
'; // Contacts lines (modules that overwrite templates must declare this into descriptor) From 4387d40b9a5f243ecc48cbc70885201d1ab3ad9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2019 21:55:08 +0200 Subject: [PATCH 68/95] Translation lignes -> lines --- htdocs/core/class/commonstickergenerator.class.php | 2 +- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/expensereport/doc/pdf_standard.modules.php | 2 +- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 18bcfcee8d5..a1d0d7f8728 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -267,7 +267,7 @@ abstract class CommonStickerGenerator protected function _Get_Height_Chars($pt) { // phpcs:enable - // Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes + // Array for link between height of characters and space between lines $_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10); if (in_array($pt, array_keys($_Table_Hauteur_Chars))) { return $_Table_Hauteur_Chars[$pt]; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 745c09c8130..5bcd6d153d0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -253,7 +253,7 @@ class pdf_espadon extends ModelePdfExpedition global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $pdf=pdf_getInstance($this->format); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d255c4486fd..44d0e3a5dda 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -282,7 +282,7 @@ class pdf_rouget extends ModelePdfExpedition global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $pdf=pdf_getInstance($this->format); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index e322ef1aa84..b85ca573188 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -400,7 +400,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. //$nblineFollowComment = 1; - // Cherche nombre de lignes a venir pour savoir si place suffisante + // Search number of lines coming to know if there is enough room // if ($i < ($nblines - 1)) // If it's not last line // { // //Fetch current description to know on which line the next one should be placed diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index ebcca580870..ca677fc5224 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -284,7 +284,7 @@ CREATE TABLE llx_expensereport_det total_ttc double(24,8) DEFAULT 0 NOT NULL, date date NOT NULL, info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines rang integer DEFAULT 0, -- position of line import_key varchar(14) ) ENGINE=innodb; From 266ed86194b0ac6be2f19d72f7613597b3cda876 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 8 Jul 2019 12:37:24 +0200 Subject: [PATCH 69/95] NEW Add a category to a contact in API --- htdocs/societe/class/api_contacts.class.php | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 772d8d3fe10..f94e182b010 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -378,6 +378,48 @@ class Contacts extends DolibarrApi return $result; } + /** + * Add a category to a contact + * + * @url POST {id}/categories/{category_id} + * + * @param int $id Id of contact + * @param int $category_id Id of category + * + * @return mixed + * + * @throws 401 RestException Insufficient rights + * @throws 401 RestException Access not allowed for login + * @throws 404 RestException Category not found + * @throws 404 RestException Contact not found + */ + public function addCategory($id, $category_id) + { + if(! DolibarrApiAccess::$user->rights->societe->contact->creer) { + throw new RestException(401, 'Insufficient rights'); + } + + $result = $this->contact->fetch($id); + if (! $result) { + throw new RestException(404, 'Contact not found'); + } + $category = new Categorie($this->db); + $result = $category->fetch($category_id); + if (! $result) { + throw new RestException(404, 'category not found'); + } + + if (! DolibarrApi::_checkAccessToResource('contact', $this->contact->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + if (! DolibarrApi::_checkAccessToResource('category', $category->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $category->add_type($this->contact, 'contact'); + + return $this->_cleanObjectDatas($this->contact); + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** From e5d34de877fe194c096fa83b5cb62f5b10aded42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2019 00:14:01 +0200 Subject: [PATCH 70/95] FIX compatibility mysql 8. rank is reserved FIX Permission for BOM menu --- htdocs/bom/class/bom.class.php | 6 +++--- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 3 ++- htdocs/install/mysql/tables/llx_bom_bomline.sql | 2 +- htdocs/modulebuilder/template/class/myobject.class.php | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 73682c7698c..10601303a61 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -889,7 +889,7 @@ class BOM extends CommonObject $this->lines=array(); $objectline = new BOMLine($this->db); - $result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); if (is_numeric($result)) { @@ -1044,7 +1044,7 @@ class BOMLine extends CommonObject 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',), 'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'), - 'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), + 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), ); public $rowid; @@ -1053,7 +1053,7 @@ class BOMLine extends CommonObject public $description; public $qty; public $efficiency; - public $rank; + public $position; public $import_key; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c966f39680b..b6fa5e419b1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2443,9 +2443,9 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { - $fieldposition = 'rang'; // @TODO Rename 'rang' and 'position' into 'rank' + $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position' if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; - if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'rank'; + if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'position'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang; $sql.= ' WHERE rowid = '.$rowid; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7518093bf77..88595cd366a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1579,7 +1579,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom'); $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); } diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index bf08e794a65..c2d4809f958 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -252,12 +252,13 @@ CREATE TABLE llx_bom_bomline( import_key varchar(14), qty double(24,8) NOT NULL, efficiency double(8,4) NOT NULL DEFAULT 1, - rank integer NOT NULL + position integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; ALTER TABLE llx_bom_bomline ADD COLUMN efficiency double(8,4) DEFAULT 1; ALTER TABLE llx_bom_bomline ADD COLUMN fk_bom_child integer NULL; +ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL; create table llx_bom_bomline_extrafields ( diff --git a/htdocs/install/mysql/tables/llx_bom_bomline.sql b/htdocs/install/mysql/tables/llx_bom_bomline.sql index bafaaf73694..4b0aa515950 100644 --- a/htdocs/install/mysql/tables/llx_bom_bomline.sql +++ b/htdocs/install/mysql/tables/llx_bom_bomline.sql @@ -23,6 +23,6 @@ CREATE TABLE llx_bom_bomline( import_key varchar(14), qty double(24,8) NOT NULL, efficiency double(8,4) NOT NULL DEFAULT 1, - rank integer NOT NULL + position integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 13157b2c18f..f6020882502 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -696,7 +696,7 @@ class MyObject extends CommonObject $this->lines=array(); $objectline = new MyObjectLine($this->db); - $result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_myobject = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_myobject = '.$this->id)); if (is_numeric($result)) { @@ -781,5 +781,5 @@ class MyObject extends CommonObject class MyObjectLine { // To complete with content of an object MyObjectLine - // We should have a field rowid, fk_myobject and rank + // We should have a field rowid, fk_myobject and position } From 61c83117fe3a98d473239a9dda5af68aae130d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Jul 2019 15:18:51 +0200 Subject: [PATCH 71/95] Update ihm.php --- htdocs/admin/ihm.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 8a065190373..509a04494d2 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -60,6 +60,7 @@ if (GETPOST('cancel', 'alpha')) if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND; @@ -81,6 +82,7 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); From 96723db86f284f2ddb09bf10158cdc7584a1f34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Jul 2019 15:20:43 +0200 Subject: [PATCH 72/95] Update main.inc.php --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 458e6649d8a..ee2b14fdf11 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1200,7 +1200,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (! is_object($hookmanager)) $hookmanager = new HookManager($db); $hookmanager->initHooks(array("main")); - $ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); + $ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); print "\n"; @@ -1246,7 +1246,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (GETPOST('version', 'int')) $ext='version='.GETPOST('version', 'int'); // usefull to force no cache on css/js $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09')?'&optioncss='.GETPOST('optioncss', 'aZ09', 1):'').'&userid='.$user->id.'&entity='.$conf->entity; - $themeparam.=($ext?'&'.$ext:''); + $themeparam.=($ext?'&'.$ext:'').'&revision='.$conf->global->MAIN_IHM_PARAMS_REV; if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; if (GETPOST('dol_hide_topmenu', 'int')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu', 'int'); } if (GETPOST('dol_hide_leftmenu', 'int')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu', 'int'); } From 0aa42fefae40fabaff529fde7a082e4ff20da613 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 9 Jul 2019 18:13:06 +0200 Subject: [PATCH 73/95] Fix : use RUM if defined in bank account --- htdocs/compta/prelevement/class/bonprelevement.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 2187b99eaf3..89aa09523e7 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1349,7 +1349,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; + $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum"; $sql.= " FROM"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,"; @@ -1375,7 +1375,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum); $this->total = $this->total + $obj->somme; $i++; } @@ -1586,9 +1586,10 @@ class BonPrelevement extends CommonObject * @param string $row_bic rib.bic AS bic, * @param string $row_datec rib.datec, * @param string $row_drum rib.rowid used to generate rum + * @param string $row_rum rib.rum Rum defined on company bank account * @return string Return string with SEPA part DrctDbtTxInf */ - function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) + function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum) { // phpcs:enable global $conf; @@ -1597,7 +1598,7 @@ class BonPrelevement extends CommonObject // Define value for RUM // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) - $Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum); + $Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum; // Define date of RUM signature $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); From 41b004c2b837806eaaa29ffa4b63204e3c7a230e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jul 2019 12:16:32 +0200 Subject: [PATCH 74/95] FIX better compatibility with multicompany transverse mode --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 1883ffd0304..28683d23771 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -421,7 +421,7 @@ class FormOther if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users } else { - $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))"; + $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('usergroup')."))"; $sql_usr.= " OR u.entity = 0"; // Show always superadmin } } @@ -444,7 +444,7 @@ class FormOther if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users } else { - $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))"; + $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('usergroup')."))"; } } else From cebf81a5146a6d02b4c9f1ebd736e6298e29b769 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Jul 2019 15:18:25 +0200 Subject: [PATCH 75/95] FIX helpp text --- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index ce41cff24d0..d23b9f09c2a 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -47,7 +47,7 @@ foreach($object->fields as $key => $val) if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; print '">'; - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); else print $langs->trans($val['label']); print ''; print ''; print ''; print ''; if (! $i) $totalarray['nbfield']++; From 332abd2a9f845ab0cfe969698ac0dbf38759853c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 13 Jul 2019 11:02:45 +0200 Subject: [PATCH 81/95] FIX __INFOS__ tag not exists --- htdocs/install/mysql/data/llx_c_email_templates.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 0c64fcf7d0d..87741d1054b 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -24,7 +24,7 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__INFOS__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__(FirstName)__ : __MEMBER_FIRSTNAME__
__(LastName)__ : __MEMBER_LASTNAME__
__(ID)__ : __MEMBER_ID__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); From b7df4a2cd04b6b8c13f78162e85a3ee660355dc6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 13 Jul 2019 11:21:07 +0200 Subject: [PATCH 82/95] FIX this function can not be private --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 115d1fb8ab4..2001959240d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2447,7 +2447,7 @@ class Adherent extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index de9494fca8b..74ff7bf5fb4 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -507,7 +507,7 @@ class Contact extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; From 4dab57b4947a4d965f253a824582db656239fd24 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 13 Jul 2019 11:24:25 +0200 Subject: [PATCH 83/95] FIX phpcs --- htdocs/adherents/class/adherent.class.php | 1 + htdocs/contact/class/contact.class.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 2001959240d..d20fc34ec9d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2438,6 +2438,7 @@ class Adherent extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 74ff7bf5fb4..d6053a46b35 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -498,6 +498,7 @@ class Contact extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * From f041110a7ef88cd8057d515bce96946c0242bf3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2019 22:29:50 +0200 Subject: [PATCH 84/95] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 43f78b571de..579deec88e3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2615,7 +2615,7 @@ abstract class CommonObject $MODULE = ""; if ($this->element == 'propal') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL"; - elseif ($this->element == 'commande') + elseif ($this->element == 'commande' || $this->element == 'order') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER"; elseif ($this->element == 'facture') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE"; From b6571d9fc3a27f147ace6d6794f6d58a9690a749 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2019 22:39:25 +0200 Subject: [PATCH 85/95] Update byratecountry.php --- htdocs/compta/stats/byratecountry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index cd41649cc89..045f5e6429c 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy")); -$modecompta = $conf->global->ACCOUNTING_MODE; +$modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE); // Date range $year=GETPOST("year",'int'); From 8090a8abb66619753ea5cca54d04ce92d71eae1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:07:27 +0200 Subject: [PATCH 86/95] Fix param [] -> null --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0fbee667522..f0d8df454cf 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -646,7 +646,7 @@ if (empty($reshook)) if (empty($labeltouse) || (int) $labeltouse === -1) { //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); $error++; } else { From b66ad24d85577a95b2280285c6dc946fecffe0c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:10:15 +0200 Subject: [PATCH 87/95] Fix save of doc template for recuring invoices. --- htdocs/compta/facture/fiche-rec.php | 2 +- htdocs/core/class/html.form.class.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 31a4affb95d..f195ab84324 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1424,7 +1424,7 @@ else $list = array(); $models = ModelePDFFactures::liste_modeles($db); foreach ($models as $k => $model) { - $list[] = $k . ':' . $model; + $list[] = str_replace(':', '|', $k) . ':' . $model; } $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a462f40ebdc..d2130e24291 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -152,7 +152,7 @@ class Form * @param string $value Value to show/edit * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter - * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...') * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') @@ -172,7 +172,7 @@ class Form if (empty($typeofdata)) return 'ErrorBadParameter'; // When option to edit inline is activated - if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker + if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker and support select { $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); } @@ -229,7 +229,8 @@ class Form foreach($arraydata as $val) { $tmp=explode(':',$val); - $arraylist[$tmp[0]]=$tmp[1]; + $tmpkey=str_replace('|', ':', $tmp[0]); + $arraylist[$tmpkey]=$tmp[1]; } $ret.=$this->selectarray($htmlname,$arraylist,$value); } @@ -298,7 +299,7 @@ class Form * @param string $value Value to show/edit * @param string $htmlname DIV ID (field name) * @param int $condition Condition to edit - * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') + * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly') * @param string $editvalue When in edit mode, use this value as $value instead of value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') From 2a05164bb119520e8a68c43aea99c399d10a8e43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:31:28 +0200 Subject: [PATCH 88/95] FIX Better PHP compatibility --- htdocs/adherents/card.php | 2 +- .../class/DataCollector/DolLogsCollector.php | 6 +++--- htdocs/public/stripe/confirm_payment.php | 20 ++++++++++--------- .../societe/class/api_thirdparties.class.php | 16 +++++++-------- htdocs/societe/paymentmodes.php | 2 +- htdocs/stripe/class/stripe.class.php | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 1e777d003d9..373e8b953f6 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -734,7 +734,7 @@ if (empty($reshook)) if (empty($labeltouse) || (int) $labeltouse === -1) { //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); $error++; } else { diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index 8e39c68b6b7..dd6fabd508f 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -144,7 +144,7 @@ class DolLogsCollector extends MessagesCollector $linecounter = $lines; $pos = -2; $beginning = false; - $text = []; + $text = array(); while ($linecounter > 0) { $t = " "; while ($t != "\n") { @@ -179,12 +179,12 @@ class DolLogsCollector extends MessagesCollector $pattern = "/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*/"; $log_levels = $this->getLevels(); preg_match_all($pattern, $file, $matches); - $log = []; + $log = array(); foreach ($matches as $lines) { foreach ($lines as $line) { foreach ($log_levels as $level_key => $level) { if (strpos(strtolower($line), strtolower($level_key)) == 20) { - $log[] = ['level' => $level, 'line' => $line]; + $log[] = array('level' => $level, 'line' => $line); } } } diff --git a/htdocs/public/stripe/confirm_payment.php b/htdocs/public/stripe/confirm_payment.php index ea59b13dcb9..9ff9662ff84 100644 --- a/htdocs/public/stripe/confirm_payment.php +++ b/htdocs/public/stripe/confirm_payment.php @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +// TODO Do we really need this page. We alread have a ipn.php page ! + define("NOLOGIN", 1); // This means this output page does not require to be logged. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -105,13 +107,13 @@ $intent = null; try { if (isset($json_obj->payment_method_id)) { // Create the PaymentIntent - $intent = \Stripe\PaymentIntent::create([ + $intent = \Stripe\PaymentIntent::create(array( 'payment_method' => $json_obj->payment_method_id, 'amount' => 1099, 'currency' => 'eur', 'confirmation_method' => 'manual', 'confirm' => true, - ]); + )); } if (isset($json_obj->payment_intent_id)) { $intent = \Stripe\PaymentIntent::retrieve( @@ -122,9 +124,9 @@ try { generatePaymentResponse($intent); } catch (\Stripe\Error\Base $e) { // Display error on client - echo json_encode([ + echo json_encode(array( 'error' => $e->getMessage() - ]); + )); } /* @@ -138,22 +140,22 @@ function generatePaymentResponse($intent) if ($intent->status == 'requires_source_action' && $intent->next_action->type == 'use_stripe_sdk') { // Tell the client to handle the action - echo json_encode([ + echo json_encode(array( 'requires_action' => true, 'payment_intent_client_secret' => $intent->client_secret - ]); + )); } elseif ($intent->status == 'succeeded') { // The payment didn’t need any additional actions and completed! // Handle post-payment fulfillment // TODO - echo json_encode([ + echo json_encode(array( "success" => true - ]); + )); } else { // Invalid status http_response_code(500); - echo json_encode(['error' => 'Invalid PaymentIntent status']); + echo json_encode(array('error' => 'Invalid PaymentIntent status')); } } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index adae31e7677..95aad3a003b 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1041,7 +1041,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i=0; - $accounts =[]; + $accounts = array(); if ($result) { @@ -1061,12 +1061,12 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( } - $fields = ['socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id', 'rum']; + $fields = array('socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id', 'rum'); - $returnAccounts = []; + $returnAccounts = array(); foreach($accounts as $account){ - $object= []; + $object= array(); foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; @@ -1308,7 +1308,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i=0; - $accounts =[]; + $accounts = array(); $num = $db->num_rows($result); while ($i < $num) @@ -1322,12 +1322,12 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i++; } - $fields = ['id', 'fk_soc', 'key_account', 'site', 'date_creation', 'tms']; + $fields = array('id', 'fk_soc', 'key_account', 'site', 'date_creation', 'tms'); - $returnAccounts = []; + $returnAccounts = array(); foreach($accounts as $account){ - $object= []; + $object= array(); foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 0e41e11cbaa..51a7ccb24bb 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -639,7 +639,7 @@ if (empty($reshook)) try { if (preg_match('/pm_/', $source)) { - $payment_method = \Stripe\PaymentMethod::retrieve($source, ["stripe_account" => $stripeacc]); + $payment_method = \Stripe\PaymentMethod::retrieve($source, array("stripe_account" => $stripeacc)); if ($payment_method) { $payment_method->detach(); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index d8d0c656dab..6b910236e96 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -389,7 +389,7 @@ class Stripe extends CommonObject "confirmation_method" => $mode, "amount" => $stripeamount, "currency" => $currency_code, - "payment_method_types" => ["card"], + "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) //"save_payment_method" => true, From e1d49177040c197c6027e53bd302e031ee46ab12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jul 2019 00:39:42 +0200 Subject: [PATCH 89/95] FIX Missing field "Conciliated" into bank transaction export --- htdocs/core/modules/modBanque.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index fb2c818043e..21c33d35170 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -150,14 +150,15 @@ class modBanque extends DolibarrModules $this->export_fields_array[$r]=array( 'b.rowid'=>'IdTransaction','ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.dateo'=>'DateOperation','b.label'=>'Label', 'b.num_chq'=>'ChequeOrTransferNumber','b.fk_bordereau'=>'ChequeBordereau','-b.amount'=>'Debit','b.amount'=>'Credit', - 'b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty", - "s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode" + 'b.num_releve'=>'AccountStatement','b.rappro'=>'Conciliated','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty", + "s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode" ); - $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Numeric','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text"); + $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Numeric','b.amount'=>'Numeric','b.num_releve'=>'Text','b.rappro'=>'Boolean','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text"); $this->export_entities_array[$r]=array( 'b.rowid'=>'account','ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.dateo'=>'account','b.label'=>'account', - 'b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account','b.num_releve'=>'account', - 'b.datec'=>"account","bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company" + 'b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account', + 'b.num_releve'=>'account','b.rappro'=>'account','b.datec'=>"account","bu.url_id"=>"company", + "s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company" ); $this->export_special_array[$r]=array('-b.amount'=>'NULLIFNEG','b.amount'=>'NULLIFNEG'); if (empty($conf->fournisseur->enabled)) From b0d46d492fdd738cab5b15202abb4414da373828 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 18:40:42 +0200 Subject: [PATCH 90/95] FIX #11509 --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index e3eb9b595ee..e7967aa4782 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -229,7 +229,7 @@ if ($search_type) $param.="&search_type=".urlencode($search_type); if ($date_select) $param.="&date_select=".urlencode($date_select); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_login) $param.="&search_login=".urlencode($search_login); -if ($search_acount) $param.="&search_account=".urlencode($search_account); +if ($search_account) $param.="&search_account=".urlencode($search_account); if ($search_amount) $param.="&search_amount=".urlencode($search_amount); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields From 5778a02ee1f195ad457a07de6b4f986d6e4cb49a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 18:44:33 +0200 Subject: [PATCH 91/95] FIX #11505 --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d4a9ff0d3f6..8003cf1c523 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -964,7 +964,7 @@ if (empty($action) || $action == 'view') { $varlink = 'id_journal=' . $id_journal; - journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); + journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); // Test that setup is complete From e3968241335b6dea66c1b5b2e7ed0d7768c40ae1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 19:08:57 +0200 Subject: [PATCH 92/95] FIX #11507 --- htdocs/accountancy/admin/productaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 562dfd1505b..1c72ea61abd 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -462,7 +462,7 @@ if ($result) // print '
'; // TODO: we shoul set a user defined value to adjust user square / wide screen size $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print ''; + print ''; } if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') From b9771db13116b9a685b8d7536c1ed25a0791909c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Jul 2019 17:16:49 +0300 Subject: [PATCH 93/95] Fix phpcs --- htdocs/compta/tva/quadri_detail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 0f359dd9721..c48bc385c53 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -118,7 +118,7 @@ foreach ($listofparams as $param) } $title = $langs->trans("VATReport") . " " . dol_print_date($date_start) . " -> " . dol_print_date($date_end); -llxHeader('',$title,'','',0,0,'','',$morequerystring); +llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring); //print load_fiche_titre($langs->trans("VAT"),""); From 61a574701ba43a9a64eef9ed7ceb6e13ee3879b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Jul 2019 01:11:10 +0200 Subject: [PATCH 94/95] New Add field prefix_session in llx_events --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_events.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index b10ab3b9a85..4ec9fbdaffb 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -48,3 +48,5 @@ ALTER TABLE llx_facture_fourn DROP COLUMN total; ALTER TABLE llx_user ADD COLUMN iplastlogin varchar(250); ALTER TABLE llx_user ADD COLUMN ippreviouslogin varchar(250); + +ALTER TABLE llx_events ADD COLUMN prefix_session varchar(250) NULL; diff --git a/htdocs/install/mysql/tables/llx_events.sql b/htdocs/install/mysql/tables/llx_events.sql index f906cf0fcbd..c9f8f034a34 100644 --- a/htdocs/install/mysql/tables/llx_events.sql +++ b/htdocs/install/mysql/tables/llx_events.sql @@ -27,6 +27,7 @@ create table llx_events tms timestamp, -- date creation/modification type varchar(32) NOT NULL, -- action type entity integer DEFAULT 1 NOT NULL, -- multi company id + prefix_session varchar(255) NULL, -- prefix of session, obtained with dol_getprefix dateevent datetime, -- date event fk_user integer, -- id user description varchar(250) NOT NULL, -- full description of action From fed598236c185406f59a504ed57181464c26b1b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Jul 2019 01:12:48 +0200 Subject: [PATCH 95/95] Add field --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 4ec9fbdaffb..f8cc3062bde 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -49,4 +49,4 @@ ALTER TABLE llx_facture_fourn DROP COLUMN total; ALTER TABLE llx_user ADD COLUMN iplastlogin varchar(250); ALTER TABLE llx_user ADD COLUMN ippreviouslogin varchar(250); -ALTER TABLE llx_events ADD COLUMN prefix_session varchar(250) NULL; +ALTER TABLE llx_events ADD COLUMN prefix_session varchar(255) NULL;
label; ?> + photos; ?> label; ?> + photos; ?>
'; From a3f5397988c7437e34d1435ff86feec19104e0e6 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Jul 2019 15:55:50 +0200 Subject: [PATCH 76/95] FIX help text 2 --- htdocs/core/tpl/commonfields_view.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index b6b2e572e49..86a58d346fe 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -52,7 +52,7 @@ foreach($object->fields as $key => $val) if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; print '">'; - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); else print $langs->trans($val['label']); print ''; @@ -91,7 +91,7 @@ foreach($object->fields as $key => $val) if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; print '">'; - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); else print $langs->trans($val['label']); print ''; From cce8f98afc7638becb92e2a4e9344c7de40c2b21 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 10 Jul 2019 16:33:03 +0200 Subject: [PATCH 77/95] FIX : accounting mode must be taken from global conf, because there's no way to choose a mode with interface --- htdocs/compta/stats/byratecountry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 2c43db42d13..cd41649cc89 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy")); -$modecompta = GETPOST('modecompta','alpha'); +$modecompta = $conf->global->ACCOUNTING_MODE; // Date range $year=GETPOST("year",'int'); From abd0abf11531b196fe07e8bac545ea95071b95ef Mon Sep 17 00:00:00 2001 From: Nicolas ZABOURI Date: Wed, 10 Jul 2019 18:36:12 +0200 Subject: [PATCH 78/95] FIX element name in update_price --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f0fe7bf437c..43f78b571de 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Bahfir abbes * Copyright (C) 2017 ATM Consulting - * Copyright (C) 2017 Nicolas ZABOURI + * Copyright (C) 2017-2019 Nicolas ZABOURI * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Frederic France * @@ -2615,7 +2615,7 @@ abstract class CommonObject $MODULE = ""; if ($this->element == 'propal') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL"; - elseif ($this->element == 'order') + elseif ($this->element == 'commande') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER"; elseif ($this->element == 'facture') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE"; From 694be619b26adfa705b2fd92675a4599da1f3fe7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jul 2019 22:16:32 +0200 Subject: [PATCH 79/95] Fix doxygen --- htdocs/product/class/product.class.php | 30 +++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fc966f7f19a..9c515d619c6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -272,13 +272,26 @@ class Product extends CommonObject public $accountancy_code_buy; /** - * Main barcode - * barcode value + * Main Barcode value * * @var string */ public $barcode; + /** + * Main Barcode type ID + * + * @var int + */ + public $barcode_type; + + /** + * Main Barcode type code + * + * @var string + */ + public $barcode_type_code; + /** * Additional barcodes (Some products have different barcodes according to the country of origin of manufacture) * @@ -294,7 +307,7 @@ class Product extends CommonObject public $multilangs=array(); - //! Taille de l'image + //! Size of image public $imgWidth; public $imgHeight; @@ -348,16 +361,7 @@ class Product extends CommonObject public $fields = array( - 'rowid' => array( - 'type'=>'integer', - 'label'=>'TechnicalID', - 'enabled'=>1, - 'visible'=>-2, - 'notnull'=>1, - 'index'=>1, - 'position'=>1, - 'comment'=>'Id', - ), + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), From b1e21ed5fc302ebef8fe6b63dc336074ec997233 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jul 2019 22:18:44 +0200 Subject: [PATCH 80/95] FIX Computed field were not calculated into lists. --- htdocs/core/class/extrafields.class.php | 2 ++ .../core/tpl/extrafields_list_print_fields.tpl.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index eeb653aec8a..9e83a1d836b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1627,6 +1627,8 @@ class ExtraFields if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method. + //if ($computed) $value = // $value is already calculated into $value before calling this method + $showsize=0; if ($type == 'date') { diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 1dad8a6739d..35aefb9f719 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -40,7 +40,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ { $value = $obj->$tmpkey; } - + // If field is a computed field, we make computation to get value + if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) + { + //global $obj, $object; + //var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]); + //var_dump($obj); + //var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]); + $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1); + //var_dump($value); + } + print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print '' . $obj->description . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . '