From 26c0244dbb7d9400237925cf085d7252688cab31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:13:16 +0200 Subject: [PATCH 1/7] Update ldap.class.php --- htdocs/core/class/ldap.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 71635a89233..19e7ad353b4 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -34,10 +34,16 @@ class Ldap */ public $error=''; + /** + * @var string[] Array of error strings + */ + public $errors = array(); + /** * Tableau des serveurs (IP addresses ou nom d'hotes) */ var $server=array(); + /** * Base DN (e.g. "dc=foo,dc=com") */ From d8441619ed7220623f3f3fafa624c5fb669ef3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Aug 2018 08:29:51 +0200 Subject: [PATCH 2/7] Update export.php --- htdocs/accountancy/admin/export.php | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 1463d3ae8c7..3be285674b5 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -5,7 +5,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017 Frédéric France + * Copyright (C) 2017-2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,11 +50,11 @@ $main_option = array ( $configuration = AccountancyExport::getTypeConfig(); -$listparam = $configuration[param]; +$listparam = $configuration['param']; -$listformat = $configuration[format]; +$listformat = $configuration['format']; -$listcr = $configuration[cr]; +$listcr = $configuration['cr']; $model_option = array ( @@ -117,7 +117,7 @@ if ($action == 'update') { if (! $error) { // reload $configuration = AccountancyExport::getTypeConfig(); - $listparam = $configuration[param]; + $listparam = $configuration['param']; setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -142,27 +142,27 @@ print ' {'."\n"; foreach ($listparam as $key => $param) { print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n"; print ' {'."\n"; - print ' //console.log("'.$param[label].'");'."\n"; - if (empty($param[ACCOUNTING_EXPORT_FORMAT])) { + print ' //console.log("'.$param['label'].'");'."\n"; + if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) { print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n"; } else { - print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[ACCOUNTING_EXPORT_FORMAT].'");'."\n"; + print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_SEPARATORCSV])) { + if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) { print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n"; } else { print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_ENDLINE])) { + if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) { print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n"; } else { print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_DATE])) { + if (empty($param['ACCOUNTING_EXPORT_DATE'])) { print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n"; } else { @@ -257,15 +257,15 @@ if ($num2) { print ''; // Param - $label = $key[label]; + $label = $key['label']; print '' . $langs->trans($label) . ''; // Value print ''; - if (is_array($key[param])) { - print $form->selectarray($label, $key[param], $conf->global->$label, 0); + if (is_array($key['param'])) { + print $form->selectarray($label, $key['param'], $conf->global->$label, 0); } else { - print ''; + print ''; } print ''; From 5833e6c5d818183cd565368a93297f96a22f7041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Aug 2018 08:56:00 +0200 Subject: [PATCH 3/7] Update categorie.class.php --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 3736ce58d5b..f5b491bfe9f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -798,7 +798,7 @@ class Categorie extends CommonObject * * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') * @param int $onlyids Return only ids of objects (consume less memory) - * @return mixed -1 if KO, array of instance of object if OK + * @return array|int -1 if KO, array of instance of object if OK * @see containsObject */ function getObjectsInCateg($type, $onlyids=0) From a514b97837493094c8ba5eeee07308dece92fdd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Fri, 31 Aug 2018 10:57:01 +0200 Subject: [PATCH 4/7] FIX: add global PRODUCT_DISABLE_VOLUME on create On update and view the global PRODUCT_DISABLE_VOLUME is used. But on create it does not exists. --- htdocs/product/card.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2c11b8efd86..135c4797153 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1067,11 +1067,14 @@ else print $formproduct->select_measuring_units("surface_units","surface"); print ''; } - // Volume - print ''.$langs->trans("Volume").''; - print ''; - print $formproduct->select_measuring_units("volume_units","volume"); - print ''; + if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) + { + // Volume + print ''.$langs->trans("Volume").''; + print ''; + print $formproduct->select_measuring_units("volume_units","volume"); + print ''; + } } // Units From 4f7b26186a1f67629d1297f2ffbda5d5185f6421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Aug 2018 18:33:45 +0200 Subject: [PATCH 5/7] FIX syntax propal.class.php --- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 955ee29845e..40f62b54e6b 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1574,7 +1574,7 @@ class Propal extends CommonObject $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; $sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,'; $sql.= ' d.fk_unit,'; - $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobach as product_batch,'; + $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_batch,'; $sql.= ' p.weight, p.weight_units, p.volume, p.volume_units,'; $sql.= ' d.date_start, d.date_end,'; $sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; From c288c42ee3a09865e6339e2683bd931676e59bf1 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Fri, 31 Aug 2018 18:10:59 +0100 Subject: [PATCH 6/7] Fix: No link is shown to access for bank transfers. --- htdocs/accountancy/journal/bankjournal.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 23a7e71d325..e5741e940a6 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -147,6 +147,7 @@ $paymentsalstatic = new PaymentSalary($db); $paymentexpensereportstatic = new PaymentExpenseReport($db); $paymentvariousstatic = new PaymentVarious($db); $paymentloanstatic = new PaymentLoan($db); +$accountLinestatic=new AccountLine($db); // Get code of finance journal $accountingjournalstatic = new AccountingJournal($db); @@ -370,7 +371,8 @@ if ($result) { $tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id; //$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount; } else if ($links[$key]['type'] == 'banktransfert') { - $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer"); + $accountLinestatic->fetch($links[$key]['url_id']); + $tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1); $tabtp[$obj->rowid][$account_transfer] += $obj->amount; $bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']); $tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2); From 1750bb6802daae7add387493f249835a7380e967 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 13:26:28 +0200 Subject: [PATCH 7/7] Fix column name --- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 72b7dbf5fae..f427791ff6d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1574,7 +1574,7 @@ class Propal extends CommonObject $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; $sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,'; $sql.= ' d.fk_unit,'; - $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobach as product_batch,'; + $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_batch,'; $sql.= ' p.weight, p.weight_units, p.volume, p.volume_units,'; $sql.= ' d.date_start, d.date_end,'; $sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc';