From 43ada3fcd44b35bdbf8771ec409146848bd158b7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Jun 2019 09:36:00 +0200 Subject: [PATCH 01/33] FIX better method to check if pdf is protected/encrypted --- htdocs/core/lib/pdf.lib.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 14c0435b4ad..1932fca31a2 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -175,18 +175,29 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P') /** * Return if pdf file is protected/encrypted * - * @param TCPDF $pdf PDF initialized object * @param string $pathoffile Path of file * @return boolean True or false */ -function pdf_getEncryption(&$pdf, $pathoffile) +function pdf_getEncryption($pathoffile) { + require_once TCPDF_PATH.'tcpdf_parser.php'; + $isencrypted = false; - $pdfparser = $pdf->_getPdfParser($pathoffile); - $data = $pdfparser->getParsedData(); - if (isset($data[0]['trailer'][1]['/Encrypt'])) { - $isencrypted = true; + $content = file_get_contents($pathoffile); + + ob_start(); + @($parser = new \TCPDF_PARSER(ltrim($content))); + list($xref, $data) = $parser->getParsedData(); + unset($parser); + ob_end_clean(); + + if (isset($xref['trailer']['encrypt'])) { + $isencrypted = true; // Secured pdf file are currently not supported + } + + if (empty($data)) { + $isencrypted = true; // Object list not found. Possible secured file } return $isencrypted; From 3afd4e15ad135b74b781a0170d79547fde4208da Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 17 Jun 2019 07:09:19 +0200 Subject: [PATCH 02/33] FIX try to remove ob_* functions --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1932fca31a2..56ca215e118 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -186,11 +186,11 @@ function pdf_getEncryption($pathoffile) $content = file_get_contents($pathoffile); - ob_start(); + //ob_start(); @($parser = new \TCPDF_PARSER(ltrim($content))); list($xref, $data) = $parser->getParsedData(); unset($parser); - ob_end_clean(); + //ob_end_clean(); if (isset($xref['trailer']['encrypt'])) { $isencrypted = true; // Secured pdf file are currently not supported From a399e3f63de7b2c652789a069886decd3777c51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Jun 2019 13:33:44 +0200 Subject: [PATCH 03/33] Update companies.lang --- htdocs/langs/fr_FR/companies.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 7a423b0b007..dc2cf3b95b2 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -318,7 +318,7 @@ CompanyDeleted=La société "%s" a été supprimée de la base. ListOfContacts=Liste des contacts ListOfContactsAddresses=Liste des contacts/adresses ListOfThirdParties=Liste des tiers -ShowCompany=Affichier tiers +ShowCompany=Afficher tiers ShowContact=Afficher contact ContactsAllShort=Tous (pas de filtre) ContactType=Type de contact From c62f37095909cc179b3c1b10fdf120b85e2fb395 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 17 Jun 2019 16:30:56 +0200 Subject: [PATCH 04/33] FIX: Wrong stock movement on supplier credit notes --- htdocs/fourn/class/fournisseur.facture.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 3a27690e7ac..f96caf89207 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2019 Ferran Marcet * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * @@ -1318,7 +1318,8 @@ class FactureFournisseur extends CommonInvoice // We increase stock for product $up_ht_disc=$this->lines[$i]->pu_ht; if (! empty($this->lines[$i]->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) $up_ht_disc=price2num($up_ht_disc * (100 - $this->lines[$i]->remise_percent) / 100, 'MU'); - $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $up_ht_disc, $langs->trans("InvoiceValidatedInDolibarr",$num)); + if ($this->type == FactureFournisseur::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $up_ht_disc, $langs->trans("InvoiceValidatedInDolibarr",$num)); + else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $up_ht_disc, $langs->trans("InvoiceValidatedInDolibarr",$num)); if ($result < 0) { $error++; } unset($this->line); } @@ -1441,7 +1442,8 @@ class FactureFournisseur extends CommonInvoice $mouvP = new MouvementStock($this->db); $mouvP->origin = &$this; // We increase stock for product - $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr", $this->ref)); + if ($this->type == FactureFournisseur::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr", $this->ref)); + else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr", $this->ref)); } } } From 80d4d8754d5e548902878c50fca8a7571349e2a2 Mon Sep 17 00:00:00 2001 From: Eric Seigne <1468823+rycks@users.noreply.github.com> Date: Mon, 17 Jun 2019 18:28:11 +0200 Subject: [PATCH 05/33] allow zero as accountancy code nomber (replace all empty tests by != '') --- .../accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/accountancy/class/lettering.class.php | 30 +++++++++--------- htdocs/accountancy/journal/bankjournal.php | 14 ++++----- .../journal/expensereportsjournal.php | 14 ++++----- .../accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 14 ++++----- htdocs/compta/journal/purchasesjournal.php | 4 +-- htdocs/compta/journal/sellsjournal.php | 2 +- .../core/class/html.formaccounting.class.php | 2 +- htdocs/core/lib/accounting.lib.php | 31 ++++++++++++++----- .../societe/mod_codecompta_panicum.php | 4 +-- htdocs/societe/class/societe.class.php | 4 +-- 12 files changed, 70 insertions(+), 53 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index d1ef1377994..bacfdcb714a 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -348,7 +348,7 @@ while ($i < min($num, $limit)) $colspan = 9; print ""; print ''; - if (! empty($line->numero_compte) && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); + if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); else print ''.$langs->trans("Unknown").''; print ''; print ''; diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index a0c977a8d5a..2a89c6c1c96 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -67,11 +67,11 @@ class Lettering extends BookKeeping $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) "; $sql .= " WHERE ( "; - if (! empty($object->code_compta)) + if ($object->code_compta != "") $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; - if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) + if ($object->code_compta != "" && $object->code_compta_fournisseur != "") $sql .= " OR "; - if (! empty($object->code_compta_fournisseur)) + if ($object->code_compta_fournisseur != "") $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; $sql .= " ) AND (bk.date_lettering ='' OR bk.date_lettering IS NULL) "; @@ -99,13 +99,13 @@ class Lettering extends BookKeeping $sql .= " AND facf.entity = ".$conf->entity; $sql .= " AND code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4 AND entity=".$conf->entity.") "; $sql .= " AND ( "; - if (! empty($object->code_compta)) { + if ($object->code_compta != "") { $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } - if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { + if ($object->code_compta != "" && $object->code_compta_fournisseur != "") { $sql .= " OR "; } - if (! empty($object->code_compta_fournisseur)) { + if ($object->code_compta_fournisseur != "") { $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; @@ -127,13 +127,13 @@ class Lettering extends BookKeeping $sql .= " WHERE bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=3 AND entity=".$conf->entity.") "; $sql .= " AND facf.entity = ".$conf->entity; $sql .= " AND ( "; - if (! empty($object->code_compta)) { + if ($object->code_compta != "") { $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } - if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { + if ($object->code_compta != "" && $object->code_compta_fournisseur != "") { $sql .= " OR "; } - if (! empty($object->code_compta_fournisseur)) { + if ($object->code_compta_fournisseur != "") { $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= ") "; @@ -159,13 +159,13 @@ class Lettering extends BookKeeping $sql .= " AND bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4 AND entity=".$conf->entity.") "; $sql .= " AND fac.entity IN (".getEntity('invoice', 0).")";// We don't share object for accountancy $sql .= " AND ( "; - if (! empty($object->code_compta)) { + if ($object->code_compta != "") { $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } - if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { + if ($object->code_compta != "" && $object->code_compta_fournisseur != "") { $sql .= " OR "; } - if (! empty($object->code_compta_fournisseur)) { + if ($object->code_compta_fournisseur != "") { $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; @@ -187,13 +187,13 @@ class Lettering extends BookKeeping $sql .= " WHERE code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=2 AND entity=".$conf->entity.") "; $sql .= " AND fac.entity IN (".getEntity('invoice', 0).")";// We don't share object for accountancy $sql .= " AND ( "; - if (! empty($object->code_compta)) { + if ($object->code_compta != "") { $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } - if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { + if ($object->code_compta != "" && $object->code_compta_fournisseur != "") { $sql .= " OR "; } - if (! empty($object->code_compta_fournisseur)) { + if ($object->code_compta_fournisseur != "") { $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index e4e07831b44..0f22789d630 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -171,8 +171,8 @@ if ($result) { //print $sql; // Variables - $account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word - $account_customer = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word + $account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word + $account_customer = ($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word $account_employee = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word $account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word $account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word @@ -218,7 +218,7 @@ if ($result) { // Set accountancy code for thirdparty $compta_soc = 'NotDefined'; if ($lineisapurchase > 0) - $compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier); + $compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier); if ($lineisasale > 0) $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer); @@ -938,8 +938,8 @@ if (empty($action) || $action == 'view') { // Button to write into Ledger - if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' - || empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1' + if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' + || ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1' || empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { print '
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); @@ -950,8 +950,8 @@ if (empty($action) || $action == 'view') { if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; - if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' - || empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { + if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' + || ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { print ''; } else { diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 4c50015a2ba..d82381533cf 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -444,10 +444,10 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! foreach ($taber as $key => $val) { $date = dol_print_date($val["date"], 'day'); - + $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; - + // Fees foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); @@ -474,7 +474,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print "\n"; } } - + // Third party foreach ($tabttc[$key] as $k => $mt) { print '"' . $date . '"' . $sep; @@ -585,7 +585,7 @@ if (empty($action) || $action == 'view') { // Account print ""; $accountoshow = length_accountg($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("FeeAccountNotDefined").''; } @@ -615,7 +615,7 @@ if (empty($action) || $action == 'view') { // Account print ""; $accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("MainAccountForUsersNotDefined").''; } @@ -624,7 +624,7 @@ if (empty($action) || $action == 'view') { // Subledger account print ""; $accountoshow = length_accounta($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("UserAccountNotDefined").''; } @@ -652,7 +652,7 @@ if (empty($action) || $action == 'view') { // Account print ""; $accountoshow = length_accountg($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("VATAccountNotDefined").''; } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index cab5069e1f8..cd82e9f2f27 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -749,7 +749,7 @@ if (empty($action) || $action == 'view') { } print '
'; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; - if (empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { + if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { print ''; } else { diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 8f82fd95afb..3b0607d34a7 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -146,7 +146,7 @@ if ($result) { $num = $db->num_rows($result); // Variables - $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'; + $cptcli = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "")) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'; $cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : 'NotDefined'; $i = 0; @@ -679,14 +679,14 @@ if (empty($action) || $action == 'view') { journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); // Button to write into Ledger - if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { + if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { print '
'; print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); } print '
'; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; - if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { + if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') { print ''; } else { @@ -813,7 +813,7 @@ if (empty($action) || $action == 'view') { // Account print ""; $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("MainAccountForCustomersNotDefined").''; } @@ -822,7 +822,7 @@ if (empty($action) || $action == 'view') { // Subledger account print ""; $accountoshow = length_accounta($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("ThirdpartyAccountNotDefined").''; } @@ -849,7 +849,7 @@ if (empty($action) || $action == 'view') { // Account print ""; $accountoshow = length_accountg($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("ProductNotDefined").''; } @@ -884,7 +884,7 @@ if (empty($action) || $action == 'view') { // Account print ""; $accountoshow = length_accountg($k); - if (empty($accountoshow) || $accountoshow == 'NotDefined') + if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')'.''; } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index cd3bf06f43a..5b4e54fd807 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -123,7 +123,7 @@ if ($result) { $num = $db->num_rows($result); // les variables - $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)?$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef")); + $cptfour = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "")?$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef")); $cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)?$conf->global->ACCOUNTING_VAT_BUY_ACCOUNT:$langs->trans("CodeNotDef")); $tabfac = array(); @@ -139,7 +139,7 @@ if ($result) { $obj = $db->fetch_object($result); // contrôles - $compta_soc = (! empty($obj->code_compta_fournisseur)?$obj->code_compta_fournisseur:$cptfour); + $compta_soc = (($obj->code_compta_fournisseur != "")?$obj->code_compta_fournisseur:$cptfour); $compta_prod = $obj->accountancy_code_buy; if (empty($compta_prod)) { diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index fe51665163e..123bb3c7770 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -146,7 +146,7 @@ if ($result) { $obj = $db->fetch_object($result); // les variables - $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)?$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER:$langs->trans("CodeNotDef")); + $cptcli = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "")?$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER:$langs->trans("CodeNotDef")); $compta_soc = (! empty($obj->code_compta)?$obj->code_compta:$cptcli); $compta_prod = $obj->accountancy_code_sell; if (empty($compta_prod)) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 87b32902684..cf95e471ddd 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -392,7 +392,7 @@ class FormAccounting extends Form $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { - if (!empty($obj->code_compta_fournisseur)) { + if ($obj->code_compta_fournisseur != "") { $aux_account[$obj->code_compta_fournisseur] = $obj->code_compta_fournisseur.' ('.$obj->nom.')'; } } diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 889d9da8a2c..4b5345da62b 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry + * 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 @@ -23,6 +24,22 @@ * \brief Library of accountancy functions */ + /** + * Check if a value is empty with some options + * + * @param allow_false : setting this to true will make the function consider a boolean value of false as NOT empty. This parameter is false by default. + * @param allow_ws : setting this to true will make the function consider a string with nothing but white space as NOT empty. This parameter is false by default. + * @return array Bool + * @author Michael - https://www.php.net/manual/fr/function.empty.php#90767 + */ + function is_empty($var, $allow_false = false, $allow_ws = false) { + if (!isset($var) || is_null($var) || ($allow_ws == false && trim($var) == "" && !is_bool($var)) || ($allow_false === false && is_bool($var) && $var === false) || (is_array($var) && empty($var))) { + return true; + } else { + return false; + } + } + /** * Prepare array with list of tabs * @@ -75,12 +92,12 @@ function length_accountg($account) { global $conf; - if ($account < 0 || empty($account)) return ''; + if ($account < 0 || is_empty($account)) return ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; + if (! is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; - if (! empty($g)) { + if (! is_empty($g)) { // Clean parameters $i = strlen($account); @@ -110,12 +127,12 @@ function length_accounta($accounta) { global $conf; - if ($accounta < 0 || empty($accounta)) return ''; + if ($accounta < 0 || is_empty($accounta)) return ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta; + if (! is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta; $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; - if (! empty($a)) { + if (! is_empty($a)) { // Clean parameters $i = strlen($accounta); @@ -158,7 +175,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build print "\n\n\n"; - if(! empty($varlink)) $varlink = '?'.$varlink; + if(! is_empty($varlink)) $varlink = '?'.$varlink; $head=array(); $h=0; diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php index 4c5ffcd66c5..f3106cef761 100644 --- a/htdocs/core/modules/societe/mod_codecompta_panicum.php +++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php @@ -96,8 +96,8 @@ class mod_codecompta_panicum extends ModeleAccountancyCode $this->code=''; if (is_object($societe)) { - if ($type == 'supplier') $this->code = (! empty($societe->code_compta_fournisseur)?$societe->code_compta_fournisseur:''); - else $this->code = (! empty($societe->code_compta)?$societe->code_compta:''); + if ($type == 'supplier') $this->code = (($societe->code_compta_fournisseur != "")?$societe->code_compta_fournisseur:''); + else $this->code = (($societe->code_compta != "")?$societe->code_compta:''); } return 0; // return ok diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 84bda8abd54..ce7617f003d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -928,7 +928,7 @@ class Societe extends CommonObject if (! empty($allowmodcodefournisseur) && ! empty($this->fournisseur)) { // Attention get_codecompta peut modifier le code suivant le module utilise - if (empty($this->code_compta_fournisseur)) + if ($this->code_compta_fournisseur == "") { $ret=$this->get_codecompta('supplier'); if ($ret < 0) return -1; @@ -1085,7 +1085,7 @@ class Societe extends CommonObject if ($supplier) { $sql .= ", code_fournisseur = ".(! empty($this->code_fournisseur)?"'".$this->db->escape($this->code_fournisseur)."'":"null"); - $sql .= ", code_compta_fournisseur = ".(! empty($this->code_compta_fournisseur)?"'".$this->db->escape($this->code_compta_fournisseur)."'":"null"); + $sql .= ", code_compta_fournisseur = ".(($this->code_compta_fournisseur != "")?"'".$this->db->escape($this->code_compta_fournisseur)."'":"null"); } $sql .= ", fk_user_modif = ".($user->id > 0 ? $user->id:"null"); $sql .= ", fk_multicurrency = ".(int) $this->fk_multicurrency; From e4f5ca79f8d20ddff3c8b5d305c78d4bba9c9a96 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 17 Jun 2019 19:36:21 +0200 Subject: [PATCH 06/33] Fix access category API --- htdocs/categories/class/api_categories.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index c82d803f31c..c389e1b63d1 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -86,7 +86,7 @@ class Categories extends DolibarrApi throw new RestException(404, 'category not found'); } - if ( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) { + if ( ! DolibarrApi::_checkAccessToResource('categorie', $this->category->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From f1d64ad164152252a9cb901a966493e6b82aeb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Jun 2019 23:02:54 +0200 Subject: [PATCH 07/33] Update peruser.php --- htdocs/comm/action/peruser.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 754cb736bc9..d4020f4df92 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1186,33 +1186,34 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } } - $ids1='';$ids2=''; - if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',', array_keys($cases1[$h])); - if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',', array_keys($cases2[$h])); + $ids1=''; + $ids2=''; + if (is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',', array_keys($cases1[$h])); + if (is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',', array_keys($cases2[$h])); if ($h == $begin_h) echo ''; else echo ''; - if (count($cases1[$h]) == 1) // only 1 event + if (is_array($cases1[$h]) && count($cases1[$h]) == 1) // only 1 event { $output = array_slice($cases1[$h], 0, 1); $title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:''); if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string']; if ($output[0]['color']) $color1 = $output[0]['color']; } - elseif (count($cases1[$h]) > 1) + elseif (is_array($cases1[$h]) && count($cases1[$h]) > 1) { $title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:''); $color1='222222'; } - if (count($cases2[$h]) == 1) // only 1 event + if (is_array($cases2[$h]) && count($cases2[$h]) == 1) // only 1 event { $output = array_slice($cases2[$h], 0, 1); $title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:''); if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string']; if ($output[0]['color']) $color2 = $output[0]['color']; } - elseif (count($cases2[$h]) > 1) + elseif (is_array($cases2[$h]) && count($cases2[$h]) > 1) { $title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:''); $color2='222222'; From fd263cb316b34100ec1c4bd0d76a858b0fb0f0fe Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 18 Jun 2019 07:15:59 +0200 Subject: [PATCH 08/33] FIX add v10 in virtualmin script --- build/perl/virtualmin/dolibarr.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index a28fc430caa..343cebc6abe 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -1,7 +1,7 @@ #---------------------------------------------------------------------------- # \file dolibarr.pl # \brief Dolibarr script install for Virtualmin Pro -# \author (c)2009-2018 Regis Houssin +# \author (c)2009-2019 Regis Houssin #---------------------------------------------------------------------------- @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" ); +return ( "10.0.0", "9.0.3", "8.0.5", "7.0.5", "6.0.8" ); } sub script_dolibarr_release @@ -390,6 +390,7 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", + $ver >= 10.0 ? "dolibarr\\-(10\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" : From 96c699482791ebd62614a0209849057799cdb924 Mon Sep 17 00:00:00 2001 From: Nicolas ZABOURI Date: Tue, 18 Jun 2019 10:55:16 +0200 Subject: [PATCH 09/33] =?UTF-8?q?FIX=202=20d=C3=A9clarations=20of=20date?= =?UTF-8?q?=5Fvalid=20in=20SQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/install/mysql/tables/llx_bom_bom.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql index 9c6e014586d..11e1ce74ffd 100644 --- a/htdocs/install/mysql/tables/llx_bom_bom.sql +++ b/htdocs/install/mysql/tables/llx_bom_bom.sql @@ -27,10 +27,9 @@ CREATE TABLE llx_bom_bom( qty double(24,8), efficiency double(8,4) DEFAULT 1, date_creation datetime NOT NULL, - date_valid datetime NOT NULL, + date_valid datetime, tms timestamp, - date_valid datetime, - fk_user_creat integer NOT NULL, + fk_user_creat integer NOT NULL, fk_user_modif integer, fk_user_valid integer, import_key varchar(14), From 20e00ca2905f05474fb441d637c7eafb4029cdb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jun 2019 19:41:16 +0200 Subject: [PATCH 10/33] FIX if last char of customercode is accent making the truncate of first chars wrong. --- htdocs/core/lib/functions2.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 649988e785b..5d0f25892c8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -716,8 +716,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m global $conf,$user; if (! is_object($objsoc)) $valueforccc=$objsoc; - else if ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur; - else $valueforccc=$objsoc->code_client; + else if ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=dol_string_unaccent($objsoc->code_fournisseur); + else $valueforccc=dol_string_unaccent($objsoc->code_client); $sharetable = $table; if ($table == 'facture' || $table == 'invoice') $sharetable = 'invoicenumber'; // for getEntity function @@ -965,6 +965,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m // Define $maskLike $maskLike = dol_string_nospecial($mask); $maskLike = str_replace("%","_",$maskLike); + // Replace protected special codes with matching number of _ as wild card caracter $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike); $maskLike = preg_replace('/\{yy\}/i','__',$maskLike); @@ -1140,7 +1141,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m // Now we replace the refclient if ($maskrefclient) { - //print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode."\n
"; + //print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode." maskrefclient_clientcode=".$maskrefclient_clientcode."\n
";exit; $maskrefclient_maskbefore='{'.$maskrefclient.'}'; $maskrefclient_maskafter=$maskrefclient_clientcode.str_pad($maskrefclient_counter,dol_strlen($maskrefclient_maskcounter),"0",STR_PAD_LEFT); $numFinal = str_replace($maskrefclient_maskbefore,$maskrefclient_maskafter,$numFinal); From bcd5949bacffd3fdd722bc268e70d3556d5419e4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 21:39:30 +0200 Subject: [PATCH 11/33] Responsive on project index --- htdocs/projet/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index fa77cb4b52c..38ef7ee7cf2 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -179,6 +179,7 @@ $sql.= $db->plimit($max, 0); $resql=$db->query($sql); if ($resql) { + print '
'; print ''; print ''; print ''; @@ -242,7 +243,7 @@ if ($resql) $i++; } } - print "
'.$langs->trans("LatestModifiedProjects", $max).'

"; + print "

"; } else dol_print_error($db); From 30fb89ad5e55b520588327de1bea36f93c6a8d03 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 22:03:29 +0200 Subject: [PATCH 12/33] Responsive HRM index --- htdocs/hrm/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 066a21ebad0..54a0837e1fe 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -134,6 +134,7 @@ if (! empty($conf->holiday->enabled)) { $user_id = $user->id; + print '
'; print ''; print ''; print ""; @@ -152,7 +153,7 @@ if (! empty($conf->holiday->enabled)) print ''; print ''; - print '
'.$langs->trans("Holidays").'

'; + print '

'; } elseif (! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) { From c59de4989455dfc1e438908c4c6d2bc49950e261 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 22:38:52 +0200 Subject: [PATCH 13/33] Translate rights --- htdocs/core/class/html.formaccounting.class.php | 2 +- htdocs/core/lib/accounting.lib.php | 2 +- htdocs/langs/en_US/admin.lang | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 87b32902684..7d9e778ac41 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/class/html.formaccounting.class.php - * \ingroup Advanced accountancy + * \ingroup Accountancy (Double entries) * \brief File of class with all html predefined components */ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 889d9da8a2c..e55083c4822 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/lib/accounting.lib.php - * \ingroup Advanced accountancy + * \ingroup Accountancy (Double entries) * \brief Library of accountancy functions */ diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5fc1994247c..5f69be03dba 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -885,6 +885,12 @@ Permission2802=Use FTP client in write mode (delete or upload files) Permission50101=Use Point of Sale Permission50201=Read transactions Permission50202=Import transactions +Permission50401=Bind products and invoices with accounting accounts +Permission50411=Read operations in ledger +Permission50412=Write/Edit operations in ledger +Permission50420=Report and export reports (turnover, balance, journals, ledger) +Permission50430=Define and close a fiscal year +Permission50440=Manage chart of accounts, setup of accountancy Permission54001=Print Permission55001=Read polls Permission55002=Create/modify polls From ce375440884d31c60a60e80e422870a966c8b47d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 22:41:18 +0200 Subject: [PATCH 14/33] Translate rights --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5f69be03dba..f26088f747c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -804,6 +804,7 @@ Permission401=Read discounts Permission402=Create/modify discounts Permission403=Validate discounts Permission404=Delete discounts +Permission430=Use Debug Bar Permission511=Read payments of salaries Permission512=Create/modify payments of salaries Permission514=Delete payments of salaries From 4de0a57f5cc435afb5c1192e55bac6cf5753dff1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 22:44:43 +0200 Subject: [PATCH 15/33] Translate rights --- htdocs/langs/en_US/admin.lang | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f26088f747c..56a8381021e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -883,6 +883,10 @@ Permission2503=Submit or delete documents Permission2515=Setup documents directories Permission2801=Use FTP client in read mode (browse and download only) Permission2802=Use FTP client in write mode (delete or upload files) +Permission10001=Read website content +Permission10002=Create/modify website content (html and javascript content) +Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers. +Permission10005=Delete website content Permission50101=Use Point of Sale Permission50201=Read transactions Permission50202=Import transactions From a0ae1e96a374e4e243b73f6b4f53757b49da3d5f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 22:52:37 +0200 Subject: [PATCH 16/33] Translate rights --- htdocs/langs/en_US/admin.lang | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 56a8381021e..cfc244b0fe0 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -838,6 +838,12 @@ Permission1101=Read delivery orders Permission1102=Create/modify delivery orders Permission1104=Validate delivery orders Permission1109=Delete delivery orders +Permission1121=Read supplier proposals +Permission1122=Create/modify supplier proposals +Permission1123=Validate supplier proposals +Permission1124=Send supplier proposals +Permission1125=Delete supplier proposals +Permission1126=Close supplier price requests Permission1181=Read suppliers Permission1182=Read purchase orders Permission1183=Create/modify purchase orders From 42b03ec85893b0083161abcafa33b7082e118209 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 Jun 2019 22:53:50 +0200 Subject: [PATCH 17/33] Translate rights --- htdocs/langs/en_US/admin.lang | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cfc244b0fe0..60a80bb15bc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -902,6 +902,10 @@ Permission50412=Write/Edit operations in ledger Permission50420=Report and export reports (turnover, balance, journals, ledger) Permission50430=Define and close a fiscal year Permission50440=Manage chart of accounts, setup of accountancy +Permission51001=Read assets +Permission51002=Create/Update assets +Permission51003=Delete assets +Permission51005=Setup types of asset Permission54001=Print Permission55001=Read polls Permission55002=Create/modify polls From e1c476e744da16429c72e99b80263e844b0818dc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 05:48:04 +0200 Subject: [PATCH 18/33] Translate rights --- htdocs/langs/en_US/admin.lang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 60a80bb15bc..0c4d7de3962 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -819,6 +819,9 @@ Permission532=Create/modify services Permission534=Delete services Permission536=See/manage hidden services Permission538=Export services +Permission650=Read bom of Bom +Permission651=Create/Update bom of Bom +Permission652=Delete bom of Bom Permission701=Read donations Permission702=Create/modify donations Permission703=Delete donations From 9234a5446872983f6cfa4bf01f46234c1b17a445 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 05:49:23 +0200 Subject: [PATCH 19/33] Translate rights --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0c4d7de3962..820fac9e2d4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -892,6 +892,7 @@ Permission2503=Submit or delete documents Permission2515=Setup documents directories Permission2801=Use FTP client in read mode (browse and download only) Permission2802=Use FTP client in write mode (delete or upload files) +Permission3200=Read archived events and fingerprints Permission10001=Read website content Permission10002=Create/modify website content (html and javascript content) Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers. From f91c40a45c2907c9cd927330b9e58b8f4f8466c3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 06:00:11 +0200 Subject: [PATCH 20/33] Translate rights --- htdocs/langs/en_US/admin.lang | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 820fac9e2d4..c135fe86206 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -869,16 +869,6 @@ Permission1251=Run mass imports of external data into database (data load) Permission1321=Export customer invoices, attributes and payments Permission1322=Reopen a paid bill Permission1421=Export sales orders and attributes -Permission20001=Read leave requests (your leave and those of your subordinates) -Permission20002=Create/modify your leave requests (your leave and those of your subordinates) -Permission20003=Delete leave requests -Permission20004=Read all leave requests (even of user not subordinates) -Permission20005=Create/modify leave requests for everybody (even of user not subordinates) -Permission20006=Admin leave requests (setup and update balance) -Permission23001=Read Scheduled job -Permission23002=Create/update Scheduled job -Permission23003=Delete Scheduled job -Permission23004=Execute Scheduled job Permission2401=Read actions (events or tasks) linked to his account Permission2402=Create/modify actions (events or tasks) linked to his account Permission2403=Delete actions (events or tasks) linked to his account @@ -893,10 +883,24 @@ Permission2515=Setup documents directories Permission2801=Use FTP client in read mode (browse and download only) Permission2802=Use FTP client in write mode (delete or upload files) Permission3200=Read archived events and fingerprints +Permission4001=See employees +Permission4002=Create employees +Permission4003=Delete employees +Permission4004=Export employees Permission10001=Read website content Permission10002=Create/modify website content (html and javascript content) Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers. Permission10005=Delete website content +Permission20001=Read leave requests (your leave and those of your subordinates) +Permission20002=Create/modify your leave requests (your leave and those of your subordinates) +Permission20003=Delete leave requests +Permission20004=Read all leave requests (even of user not subordinates) +Permission20005=Create/modify leave requests for everybody (even of user not subordinates) +Permission20006=Admin leave requests (setup and update balance) +Permission23001=Read Scheduled job +Permission23002=Create/update Scheduled job +Permission23003=Delete Scheduled job +Permission23004=Execute Scheduled job Permission50101=Use Point of Sale Permission50201=Read transactions Permission50202=Import transactions From 13836d3e219514d5aaf84c1287fd9835c65d0634 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 06:21:53 +0200 Subject: [PATCH 21/33] Missing language ley --- htdocs/core/modules/modSalaries.class.php | 2 +- htdocs/langs/en_US/salaries.lang | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index e111e81ef6b..ed3aec4a48b 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -144,7 +144,7 @@ class modSalaries extends DolibarrModules $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Salaries and payments'; + $this->export_label[$r]='SalariesAndPayments'; $this->export_permission[$r]=array(array("salaries","export")); $this->export_fields_array[$r]=array('u.firstname'=>"Firstname",'u.lastname'=>"Lastname",'u.login'=>"Login",'u.salary'=>'CurrentSalary','p.datep'=>'DatePayment','p.datesp'=>'DateStartPeriod','p.dateep'=>'DateEndPeriod','p.amount'=>'AmountPayment','p.num_payment'=>'Numero','p.label'=>'Label','p.note'=>'Note'); $this->export_TypeFields_array[$r]=array('u.firstname'=>"Text",'u.lastname'=>"Text",'u.login'=>'Text','u.salary'=>"Numeric",'p.datep'=>'Date','p.datesp'=>'Date','p.dateep'=>'Date','p.amount'=>'Numeric','p.num_payment'=>'Numeric','p.label'=>'Text'); diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 1e3607ce7cc..7c3c08a65bd 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -17,3 +17,5 @@ TJMDescription=This value is currently for information only and is not used for LastSalaries=Latest %s salary payments AllSalaries=All salary payments SalariesStatistics=Salary statistics +# Export +SalariesAndPayments=Salaries and payments From ffbb14f40ef59410e0a01efcf7f51af2fbfbe1c6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 06:28:22 +0200 Subject: [PATCH 22/33] Missing language key --- htdocs/langs/en_US/website.lang | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 43f82e9f1fb..2683c9a90eb 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -100,4 +100,6 @@ DynamicPHPCodeContainsAForbiddenInstruction=You add dynamic PHP code that contai NotAllowedToAddDynamicContent=You don't have permission to add or edit PHP dynamic content in websites. Ask permission or just keep code into php tags unmodified. ReplaceWebsiteContent=Replace website content DeleteAlsoJs=Delete also all javascript files specific to this website? -DeleteAlsoMedias=Delete also all medias files specific to this website? \ No newline at end of file +DeleteAlsoMedias=Delete also all medias files specific to this website? +# Export +MyWebsitePages=My website pages \ No newline at end of file From a849fbe42e812929ac43c6e90b40c506d03ac8bc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 07:15:52 +0200 Subject: [PATCH 23/33] Nowrap on amount --- htdocs/compta/bank/treso.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 5a4374f47dd..1318dbd4e2d 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -293,9 +293,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) }else print ""; } print "".$refcomp.""; - if ($obj->total_ttc < 0) { print "".price(abs($total_ttc))." "; }; - if ($obj->total_ttc >= 0) { print " ".price($total_ttc).""; }; - print ''.price($solde).''; + if ($obj->total_ttc < 0) { print "".price(abs($total_ttc))." "; }; + if ($obj->total_ttc >= 0) { print " ".price($total_ttc).""; }; + print ''.price($solde).''; print ""; } From 9a32117b1d172f6a5e31cf086639be9e5c2cd286 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 08:43:57 +0200 Subject: [PATCH 24/33] Nowrap on amount --- htdocs/compta/resultat/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index addc56a240b..70129e80403 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -943,7 +943,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) } print ""; - print ' '; + print ' '; if ($modecompta == 'BOOKKEEPING') { if (isset($encaiss[$case])) @@ -978,8 +978,8 @@ print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { $nbcols+=2; - print ''.(isset($totsorties[$annee])?price(price2num($totsorties[$annee], 'MT')):' ').''; - print ''.(isset($totentrees[$annee])?price(price2num($totentrees[$annee], 'MT')):' ').''; + print ''.(isset($totsorties[$annee])?price(price2num($totsorties[$annee], 'MT')):' ').''; + print ''.(isset($totentrees[$annee])?price(price2num($totentrees[$annee], 'MT')):' ').''; } print "\n"; From b8311da26212e95c0a727e542dc2a7e60c8cbc5b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 08:56:45 +0200 Subject: [PATCH 25/33] Nowrap on amount --- htdocs/accountancy/customer/index.php | 20 ++++++++++---------- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/customer/list.php | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 0131f51d515..f063f832f54 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -211,10 +211,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; - print '' . price($row[14]) . ''; + print '' . price($row[13]) . ''; + print '' . price($row[14]) . ''; print ''; } $db->free($resql); @@ -289,10 +289,10 @@ if ($resql) { print ''; for($i = 2; $i <= 12; $i++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; - print '' . price($row[14]) . ''; + print '' . price($row[13]) . ''; + print '' . price($row[14]) . ''; print ''; } $db->free($resql); @@ -348,9 +348,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. while ($row = $db->fetch_row($resql)) { print '' . $row[0] . ''; for($i = 1; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; + print '' . price($row[13]) . ''; print ''; } $db->free($resql); @@ -401,9 +401,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '' . $row[0] . ''; for($i = 1; $i <= 12; $i ++) { - print '' . price(price2num($row[$i])) . ''; + print '' . price(price2num($row[$i])) . ''; } - print '' . price(price2num($row[13])) . ''; + print '' . price(price2num($row[13])) . ''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 19e85cdb651..ea174638a2a 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -385,7 +385,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; - print '' . price($objp->total_ht) . ''; + print '' . price($objp->total_ht) . ''; print '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index ed1c40a6ad7..5314099db1f 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -503,7 +503,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; - print ''; + print ''; print price($objp->total_ht); print ''; From ec7523d3d2906975fab9e1cf662ff3eae3c074ee Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 09:01:37 +0200 Subject: [PATCH 26/33] Nowrap on amount --- htdocs/accountancy/expensereport/index.php | 16 ++++++++-------- htdocs/accountancy/supplier/index.php | 16 ++++++++-------- htdocs/accountancy/supplier/lines.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index a5026f920a0..4fe2ee3120b 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -203,10 +203,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; - print '' . price($row[14]) . ''; + print '' . price($row[13]) . ''; + print '' . price($row[14]) . ''; print ''; } $db->free($resql); @@ -276,10 +276,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; - print '' . price($row[14]) . ''; + print '' . price($row[13]) . ''; + print '' . price($row[14]) . ''; print ''; } $db->free($resql); @@ -331,9 +331,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. while ($row = $db->fetch_row($resql)) { print '' . $row[0] . ''; for($i = 1; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; + print '' . price($row[13]) . ''; print ''; } diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index ca60735fcf0..bc632118da7 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -203,10 +203,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; - print '' . price($row[14]) . ''; + print '' . price($row[13]) . ''; + print '' . price($row[14]) . ''; print ''; } $db->free($resql); @@ -274,10 +274,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; - print '' . price($row[14]) . ''; + print '' . price($row[13]) . ''; + print '' . price($row[14]) . ''; print ''; } $db->free($resql); @@ -329,9 +329,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. while ($row = $db->fetch_row($resql)) { print '' . $row[0] . ''; for($i = 1; $i <= 12; $i ++) { - print '' . price($row[$i]) . ''; + print '' . price($row[$i]) . ''; } - print '' . price($row[13]) . ''; + print '' . price($row[13]) . ''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 352a73200fb..a67386f6fbd 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -396,7 +396,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; - print '' . price($objp->total_ht) . ''; + print '' . price($objp->total_ht) . ''; print '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index fc8cc10fec4..17284513650 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -491,7 +491,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; - print ''; + print ''; print price($objp->total_ht); print ''; From e44b9113b7410a71ca423c1830f05c4ca3208d98 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 09:01:57 +0200 Subject: [PATCH 27/33] Nowrap on amount --- htdocs/accountancy/expensereport/lines.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 508dfb7136e..d15ef52ad39 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -319,7 +319,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments); print ''; - print '' . price($objp->total_ht) . ''; + print '' . price($objp->total_ht) . ''; print '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 9f70d175d40..60b24638775 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -376,7 +376,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments); print ''; - print ''; + print ''; print price($objp->price); print ''; From 9bde7c5229fc3584af4853e4f9707dd7751b238f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 Jun 2019 09:21:18 +0200 Subject: [PATCH 28/33] Nowrap on amount --- htdocs/core/boxes/box_activity.php | 2 +- htdocs/core/boxes/box_commandes.php | 2 +- htdocs/core/boxes/box_factures_fourn_imp.php | 2 +- htdocs/core/boxes/box_factures_imp.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 300040639a8..995ba93fb64 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -422,7 +422,7 @@ class box_activity extends ModeleBoxes ); $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 8575e739946..956e73b4acf 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -146,7 +146,7 @@ class box_commandes extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 09de3b874e3..74f8cbc6b64 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -151,7 +151,7 @@ class box_factures_fourn_imp extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index fd85f136f96..a0692c791b2 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -161,7 +161,7 @@ class box_factures_imp extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); From 7331e43db8e12ac4ee3ae0f2602c39053a1eb696 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 19 Jun 2019 10:19:33 +0200 Subject: [PATCH 29/33] FIX : we need to fetch fourn invoice with ref in current entity --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 3a27690e7ac..d7ded8546f1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -504,7 +504,7 @@ class FactureFournisseur extends CommonInvoice */ public function fetch($id='',$ref='') { - global $langs; + global $langs, $conf; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -555,7 +555,7 @@ class FactureFournisseur extends CommonInvoice $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON t.fk_mode_reglement = p.id"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid'; if ($id) $sql.= " WHERE t.rowid=".$id; - if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'"; + if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."' AND t.entity = ".$conf->entity; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); From 3ad13adf31d6925760587c685f79bd6e694e90fd Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 19 Jun 2019 10:43:42 +0200 Subject: [PATCH 30/33] FIX : better syntax --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index d7ded8546f1..4f9cd93021f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -504,7 +504,7 @@ class FactureFournisseur extends CommonInvoice */ public function fetch($id='',$ref='') { - global $langs, $conf; + global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -555,7 +555,7 @@ class FactureFournisseur extends CommonInvoice $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON t.fk_mode_reglement = p.id"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid'; if ($id) $sql.= " WHERE t.rowid=".$id; - if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."' AND t.entity = ".$conf->entity; + if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."' AND t.entity IN (".getEntity('supplier_invoice').")"; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); From 31a53b72aec1bcd2b6524e17bd922a8eda05f028 Mon Sep 17 00:00:00 2001 From: John Botella Date: Wed, 19 Jun 2019 16:55:45 +0200 Subject: [PATCH 31/33] FIX var name --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 34ba465ebff..07766ac7fef 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -209,7 +209,7 @@ if (! $error && $massaction == 'confirm_presend') $resaction.='
'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'

'; continue; // Payment done or started or canceled } - if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT) + if ($objectclass == 'Commande' && $objectobj->statut == Commande::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; From e060af5c977b9a37cf6c054e77f483d617f583c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Jun 2019 02:50:23 +0200 Subject: [PATCH 32/33] Update treso.php --- htdocs/compta/bank/treso.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 1318dbd4e2d..f17e622210e 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -293,8 +293,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) }else print ""; } print "".$refcomp.""; - if ($obj->total_ttc < 0) { print "".price(abs($total_ttc))." "; }; - if ($obj->total_ttc >= 0) { print " ".price($total_ttc).""; }; + if ($obj->total_ttc < 0) { print ''.price(abs($total_ttc))." "; }; + if ($obj->total_ttc >= 0) { print ' '.price($total_ttc).""; }; print ''.price($solde).''; print ""; } From 6d38f5ec9cb1fe927106243ab6463c3a39e6d630 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Jun 2019 02:56:44 +0200 Subject: [PATCH 33/33] FIX #11369 --- htdocs/bom/class/bom.class.php | 16 ++++++++-------- .../class/emailcollector.class.php | 6 +++--- .../class/emailcollectoraction.class.php | 8 ++++---- .../class/emailcollectorfilter.class.php | 8 ++++---- .../template/class/myobject.class.php | 6 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 731136fb7f4..99331de8c62 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -165,7 +165,7 @@ class BOM extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs, $user; + global $conf, $langs; $this->db = $db; @@ -184,11 +184,11 @@ class BOM extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields['status']['arrayofkeyval'])) + if (is_array($this->fields[$key]['arrayofkeyval'])) { - foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) + foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) { - $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } } @@ -1066,7 +1066,7 @@ class BOMLine extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs, $user; + global $conf, $langs; $this->db = $db; @@ -1085,11 +1085,11 @@ class BOMLine extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields['status']['arrayofkeyval'])) + if (is_array($this->fields[$key]['arrayofkeyval'])) { - foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) + foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) { - $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f60051df970..ff4be06fcab 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -205,11 +205,11 @@ class EmailCollector extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields['status']['arrayofkeyval'])) + if (is_array($this->fields[$key]['arrayofkeyval'])) { - foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) + foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) { - $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } } diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 11ccfbc858e..ca710f99216 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -145,7 +145,7 @@ class EmailCollectorAction extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs, $user; + global $conf, $langs; $this->db = $db; @@ -164,11 +164,11 @@ class EmailCollectorAction extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields['status']['arrayofkeyval'])) + if (is_array($this->fields[$key]['arrayofkeyval'])) { - foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) + foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) { - $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index f93ac51f673..5c7c7184ffc 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -114,7 +114,7 @@ class EmailCollectorFilter extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs, $user; + global $conf, $langs; $this->db = $db; @@ -133,11 +133,11 @@ class EmailCollectorFilter extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields['status']['arrayofkeyval'])) + if (is_array($this->fields[$key]['arrayofkeyval'])) { - foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) + foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) { - $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 266b8d1925f..1b4d1c7b52d 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -227,11 +227,11 @@ class MyObject extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields['status']['arrayofkeyval'])) + if (is_array($this->fields[$key]['arrayofkeyval'])) { - foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2) + foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) { - $this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } }