From 53bf6db23fe43d7b016171bf08ae43b052856f34 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Thu, 9 Jun 2022 13:46:04 +0200 Subject: [PATCH 01/25] commenting a line => resolves the bug --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index b6e512d25c2..fd0d165dc86 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4681,7 +4681,7 @@ class Product extends CommonObject while ($rec = $this->db->fetch_array($res)) { if (!empty($alreadyfound[$rec['rowid']])) { dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING); - continue; + //continue; } $alreadyfound[$rec['rowid']] = 1; $prods[$rec['rowid']] = array( From 66ed4aa5245995a70dfdc1ca4efc0560a5a17fd4 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Mon, 11 Jul 2022 14:04:31 +0200 Subject: [PATCH 02/25] refixing the bug --- htdocs/product/class/product.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fd0d165dc86..7557f7eb77b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4681,7 +4681,17 @@ class Product extends CommonObject while ($rec = $this->db->fetch_array($res)) { if (!empty($alreadyfound[$rec['rowid']])) { dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING); - //continue; + $hasParentInSamePath = false; + while (($fathers = $rec['rowid']->getFather()) != -1) { + foreach ($fathers as $father) { + if ($father['rowid'] == $id) { + $hasParentInSamePath = true; + break; + } + } + } + if ($hasParentInSamePath) + continue; // We discard this child if it is already found at a higher level in tree in the same branch. } $alreadyfound[$rec['rowid']] = 1; $prods[$rec['rowid']] = array( From 586d496d5a72cc025fcfa2459b9529f272a16d98 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Wed, 27 Jul 2022 11:03:29 +0200 Subject: [PATCH 03/25] done as it should --- htdocs/product/class/product.class.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7557f7eb77b..c0590620f29 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4647,9 +4647,10 @@ class Product extends CommonObject * @param int $id Id of product to search childs of * @param int $firstlevelonly Return only direct child * @param int $level Level of recursing call (start to 1) + * @param array $parents Array of all parents of $id * @return array Return array(prodid=>array(0=prodid, 1=>qty, 2=>product type, 3=>label, 4=>incdec, 5=>product ref) */ - public function getChildsArbo($id, $firstlevelonly = 0, $level = 1) + public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = array()) { global $alreadyfound; @@ -4665,7 +4666,7 @@ class Product extends CommonObject $sql .= " AND pa.fk_product_pere = ".((int) $id); $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level, LOG_DEBUG); + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.$parents, LOG_DEBUG); if ($level == 1) { $alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly @@ -4682,12 +4683,10 @@ class Product extends CommonObject if (!empty($alreadyfound[$rec['rowid']])) { dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING); $hasParentInSamePath = false; - while (($fathers = $rec['rowid']->getFather()) != -1) { - foreach ($fathers as $father) { - if ($father['rowid'] == $id) { - $hasParentInSamePath = true; - break; - } + for ($i = 0; $i < count($parents); $i++) { + if ($parents[$i] == $rec['id']) { + $hasParentInSamePath = true; + break; } } if ($hasParentInSamePath) @@ -4705,7 +4704,7 @@ class Product extends CommonObject //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); if (empty($firstlevelonly)) { - $listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1); + $listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, array_push($parents, $rec['rowid'])); foreach ($listofchilds as $keyChild => $valueChild) { $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } From 2d60fe26f974c53a9b38d8fb2a64274720d45553 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Wed, 27 Jul 2022 11:07:28 +0200 Subject: [PATCH 04/25] done as it should --- htdocs/product/class/product.class.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c0590620f29..5374a216175 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4682,15 +4682,9 @@ class Product extends CommonObject while ($rec = $this->db->fetch_array($res)) { if (!empty($alreadyfound[$rec['rowid']])) { dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING); - $hasParentInSamePath = false; - for ($i = 0; $i < count($parents); $i++) { - if ($parents[$i] == $rec['id']) { - $hasParentInSamePath = true; - break; - } + if (in_array($rec['id'], $parents)) { + continue; // We discard this child if it is already found at a higher level in tree in the same branch. } - if ($hasParentInSamePath) - continue; // We discard this child if it is already found at a higher level in tree in the same branch. } $alreadyfound[$rec['rowid']] = 1; $prods[$rec['rowid']] = array( From 6a27df53f9a47fb0ad2ff2dd0a19378b29cff751 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Sun, 14 Aug 2022 16:28:44 +0200 Subject: [PATCH 05/25] Improve settings for phone number (Madagascar) --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2f9cb532708..2fd11654fb3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3031,8 +3031,8 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli $newphone = substr($newphone, 0, 5).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4); } } elseif (strtoupper($countrycode) == "MG") {//Madagascar - if (dol_strlen($phone) == 13) {//ex: +261_AB_CD_EF_GHI - $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3); + if (dol_strlen($phone) == 13) {//ex: +261_AB_CD_EFG_HI + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 2); } } elseif (strtoupper($countrycode) == "GB") {//Royaume uni if (dol_strlen($phone) == 13) {//ex: +44_ABCD_EFG_HIJ From 545db83ecd4db0a28865bc7256a50116d23f211f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 16 Aug 2022 20:17:44 +0200 Subject: [PATCH 06/25] remove duplicate --- htdocs/admin/oauthlogintokens.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 8697b400a2b..574d4d96353 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -190,7 +190,6 @@ if ($mode == 'setup' && $user->admin) { $tokenobj = null; // Token require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; - require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; // Dolibarr storage $storage = new DoliStorage($db, $conf); try { From 1d1228286ce2d29664d51c3a5d20fa808415bfe7 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:45:27 +0200 Subject: [PATCH 07/25] FIX #21772 --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index cb9ca7437bb..1431e1bc4bf 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -183,7 +183,7 @@ if (empty($reshook)) { if ($result <= 0) { dol_print_error($db); } - $multicurrency_amountsresttopay[$cursorfacid] = price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement(1)); + $multicurrency_amountsresttopay[$cursorfacid] = price2num($tmpinvoice->multicurrency_total_ttc - $tmpinvoice->getSommePaiement(1)); if ($multicurrency_amounts[$cursorfacid]) { // Check amount if ($multicurrency_amounts[$cursorfacid] && (abs($multicurrency_amounts[$cursorfacid]) > abs($multicurrency_amountsresttopay[$cursorfacid]))) { From 293ad34ca8dd426ca952daab1c376a7cc6ec88ff Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 18 Aug 2022 17:02:20 +0200 Subject: [PATCH 08/25] FIX security for Multicompany --- htdocs/core/ajax/onlineSign.php | 2 +- htdocs/core/lib/signature.lib.php | 2 +- htdocs/public/onlinesign/newonlinesign.php | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 56cc79662ae..67c3c989a3a 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -73,7 +73,7 @@ if ($type == 'proposal') { $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); } -if (!dol_verifyHash($securekeyseed.$type.$ref, $SECUREKEY, '0')) { +if (!dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) { http_response_code(403); print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref); exit(-1); diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 33b0a1e8e5e..0351043b110 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -91,7 +91,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) if ($mode == 1) { $out .= "hash('".$securekeyseed."' + '".$type."' + proposal_ref)"; } else { - $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref, '0'); + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $object->entity), '0'); } /* if ($mode == 1) { diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 5dca1604f58..a3ad1eaf645 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -139,7 +139,7 @@ if ($source == 'proposal') { $securekeyseed = $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN; } -if (!dol_verifyHash($securekeyseed.$type.$ref, $SECUREKEY, '0')) { +if (!dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) { http_response_code(403); print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref); exit(-1); @@ -292,7 +292,6 @@ if ($source == 'proposal') { $result = $object->fetch_thirdparty($object->socid); // Creditor - print ''.$langs->trans("Creditor"); print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); @@ -301,7 +300,6 @@ if ($source == 'proposal') { print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); @@ -309,14 +307,12 @@ if ($source == 'proposal') { print ''."\n"; // Amount - print ''.$langs->trans("Amount"); print ''; print ''.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).''; print ''."\n"; // Object - $text = ''.$langs->trans("SignatureProposalRef", $object->ref).''; print ''.$langs->trans("Designation"); print ''.$text; From e13f30164ad473a28d81f174b0503a2fc556f5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 20 Aug 2022 11:06:30 +0200 Subject: [PATCH 09/25] php V8 warning (allready send on develop) --- .../usergroup/doc/doc_generic_usergroup_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 188cff00216..1744761fcf9 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -123,7 +123,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $texte .= ''; $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -169,7 +169,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { // Model for creation $list = ModelePDFUserGroup::liste_modeles($this->db); $texte .= ''; From f62e343830dfb270463c431e78a02091a7af48ee Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 20 Aug 2022 13:09:28 +0200 Subject: [PATCH 10/25] Fix language on contact same code as member or thirdparty for use can be use for mail templates --- htdocs/contact/card.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3d7d1d38b9a..f8f6f6a9545 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -883,8 +883,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { //Default language if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; print ''; } @@ -1171,8 +1170,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { //Default language if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; print ''; } @@ -1403,7 +1401,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { //$s=picto_from_langcode($object->default_lang); //print ($s?$s.' ':''); $langs->load("languages"); - $labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang.'_'.strtoupper($object->default_lang)) : ''); + $labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang) : ''); + print picto_from_langcode($object->default_lang, 'class="paddingrightonly saturatemedium opacitylow"'); print $labellang; print ''; } From 1ac082b25ac535114f0357df9d30d580d85f3681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 20 Aug 2022 19:19:11 +0200 Subject: [PATCH 11/25] fix statut / fk_statut error good one status --- htdocs/ticket/card.php | 43 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index cb7e71f8356..13dffc545aa 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2021 Frédéric France * Copyright (C) 2021 Alexandre Spangaro + * Copyright (C) 2022 Charlene Benke * * 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 @@ -206,7 +207,7 @@ if (empty($reshook)) { $fk_user_assign = GETPOST("fk_user_assign", 'int'); if ($fk_user_assign > 0) { $object->fk_user_assign = $fk_user_assign; - $object->fk_status = $object::STATUS_ASSIGNED; + $object->status = $object::STATUS_ASSIGNED; } $object->fk_project = $projectid; @@ -286,7 +287,7 @@ if (empty($reshook)) { } } - if ($action == 'update' && $user->rights->ticket->write && $object->fk_status < Ticket::STATUS_CLOSED) { + if ($action == 'update' && $user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) { $error = 0; $ret = $object->fetch(GETPOST('id', 'int'), GETPOST('ref', 'alpha'), GETPOST('track_id', 'alpha')); @@ -548,7 +549,7 @@ if (empty($reshook)) { if ($action == 'confirm_reopen' && $user->rights->ticket->manage && !GETPOST('cancel')) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { // prevent browser refresh from reopening ticket several times - if ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED) { + if ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED) { $res = $object->setStatut(Ticket::STATUS_ASSIGNED); if ($res) { // Log action in ticket logs table @@ -607,7 +608,7 @@ if (empty($reshook)) { // Reopen ticket if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { $new_status = GETPOST('new_status', 'int'); - $old_status = $object->fk_status; + $old_status = $object->status; $res = $object->setStatut($new_status); if ($res) { // Log action in ticket logs table @@ -726,7 +727,7 @@ if ($action == 'create' || $action == 'presend') { $formticket->withcancel = 1; $formticket->showForm(1, 'create', 0); - /*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_status < Ticket::STATUS_CLOSED) { + /*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) { $formticket = new FormTicket($db); $head = ticket_prepare_head($object); @@ -941,7 +942,7 @@ if ($action == 'create' || $action == 'presend') { // Thirdparty if (!empty($conf->societe->enabled)) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' '; - if ($action != 'editcustomer' && $object->fk_status < 8 && !$user->socid && $user->rights->ticket->write) { + if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('Edit'), 0).' : '; } if ($action == 'editcustomer') { @@ -1058,7 +1059,7 @@ if ($action == 'create' || $action == 'presend') { print '
'; print ''; +// Use conditionnement in buying if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { print ''; - print ''; + print ''; print ''; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { - // Packaging + // Packaging/Conditionnement print ''; print ''; From 05890602e0e80cc195982df5ab47c974deb18afe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 15:32:57 +0200 Subject: [PATCH 25/25] Module FTP is deprecated. --- htdocs/core/modules/modFTP.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index 7cde492b2c3..ae2de933bb6 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -54,7 +54,7 @@ class modFTP extends DolibarrModules // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value) $this->description = "FTP Client"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'dolibarr'; + $this->version = 'dolibarr_deprecated'; // Key used in llx_const table to save module status enabled/disabled (XXX is id value) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of png file (without png) used for this module
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; - print $formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone', 0, 0, 0, null, 1); - + print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; - print $formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); - + print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print '
'; print '
'; print $langs->trans("AssignedTo"); - if (isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { + if (isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { print ''.img_edit($langs->trans('Modify'), '').''; } print '
'; @@ -1069,7 +1070,7 @@ if ($action == 'create' || $action == 'presend') { } // Show user list to assignate one if status is "read" - if (GETPOST('set', 'alpha') == "assign_ticket" && $object->fk_status < 8 && !$user->socid && $user->rights->ticket->write) { + if (GETPOST('set', 'alpha') == "assign_ticket" && $object->status < 8 && !$user->socid && $user->rights->ticket->write) { print '
'; print ''; print ''; @@ -1086,7 +1087,7 @@ if ($action == 'create' || $action == 'presend') { print ''; - if ($action != 'progression' && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && !$user->socid) { + if ($action != 'progression' && isset($object->status) && $object->status < $object::STATUS_CLOSED && !$user->socid) { print ''; } print '
'; print $langs->trans('Progression').''; print ''.img_edit($langs->trans('Modify')).'
'; @@ -1204,7 +1205,7 @@ if ($action == 'create' || $action == 'presend') { print ''; } else { // Button to edit Properties - if (isset($object->fk_status) && $object->fk_status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) { + if (isset($object->status) && $object->status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) { print ' '.img_edit($langs->trans('Modify')).''; } } @@ -1263,7 +1264,7 @@ if ($action == 'create' || $action == 'presend') { // Display navbar with links to change ticket status print ''; - if (!$user->socid && $user->rights->ticket->write && isset($object->fk_status) && $object->fk_status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') { + if (!$user->socid && $user->rights->ticket->write && isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') { $actionobject->viewStatusActions($object); } @@ -1350,7 +1351,7 @@ if ($action == 'create' || $action == 'presend') { print ''; print '
'; - if ($object->statut >= 0) { + if ($object->status >= 0) { echo ''; } @@ -1366,7 +1367,7 @@ if ($action == 'create' || $action == 'presend') { $contactstatic->firstname = $tab[$i]['firstname']; echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3); } - if ($object->statut >= 0) { + if ($object->status >= 0) { echo ''; } @@ -1399,7 +1400,7 @@ if ($action == 'create' || $action == 'presend') { if (empty($reshook)) { // Show link to add a message (if read and not closed) - if (isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") { + if (isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") { print dolGetButtonAction('', $langs->trans('TicketAddMessage'), 'default', $_SERVER["PHP_SELF"].'?action=presend_addmessage&mode=init&token='.newToken().'&track_id='.$object->track_id, ''); } @@ -1408,28 +1409,28 @@ if ($action == 'create' || $action == 'presend') { if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) { print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } - if ($object->fk_soc > 0 && isset($object->fk_status) && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { + if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, ''); } /* This is useless. We can already modify each field individually - if ($user->rights->ticket->write && $object->fk_status < Ticket::STATUS_CLOSED) { + if ($user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) { print ''; } */ // Close ticket if statut is read - if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { + if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { print dolGetButtonAction('', $langs->trans('CloseTicket'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&track_id='.$object->track_id, ''); } // Abadon ticket if statut is read - if (isset($object->fk_status) && $object->fk_status > 0 && $object->fk_status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { + if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { print dolGetButtonAction('', $langs->trans('AbandonTicket'), 'default', $_SERVER["PHP_SELF"].'?action=abandon&token='.newToken().'&track_id='.$object->track_id, ''); } // Re-open ticket - if (!$user->socid && (isset($object->fk_status) && ($object->fk_status == Ticket::STATUS_CLOSED || $object->fk_status == Ticket::STATUS_CANCELED)) && !$user->socid) { + if (!$user->socid && (isset($object->status) && ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED)) && !$user->socid) { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&track_id='.$object->track_id, ''); } @@ -1533,12 +1534,12 @@ if ($action == 'create' || $action == 'presend') { $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); // Show link to add a message (if read and not closed) - $btnstatus = $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init'; $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); // Show link to add event (if read and not closed) - $btnstatus = $object->fk_status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; ; + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; ; $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); From 5fb4257c7cf12b77fbfd2cecff4e288fca03a1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 20 Aug 2022 20:25:49 +0200 Subject: [PATCH 12/25] php V8 warning --- htdocs/knowledgemanagement/knowledgerecord_list.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 3f68c444fd2..18ec0d67738 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -99,13 +99,12 @@ if (!$sortorder) { $search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha') !== '') { - if ($key == "lang") { - $search[$key] = GETPOST('search_'.$key, 'alpha')!='0' ? GETPOST('search_'.$key, 'alpha') : ''; - } else { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } + if ($key == "lang") { + $search[$key] = GETPOST('search_'.$key, 'alpha')!='0' ? GETPOST('search_'.$key, 'alpha') : ''; + } else { + $search[$key] = GETPOST('search_'.$key, 'alpha'); } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); From 793de572e6a93b02c6e47dee9e9afa90fd2fb9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Mon, 22 Aug 2022 08:00:51 +0200 Subject: [PATCH 13/25] php V8 warning --- htdocs/core/lib/admin.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index d281d85efae..7c793e740a1 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1552,10 +1552,10 @@ function complete_elementList_with_modules(&$elementList) // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !$conf->global->$const_name) { + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !empty($conf->global->$const_name)) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !$conf->global->$const_name) { + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !empty($conf->global->$const_name)) { $modulequalified = 0; } //If module is not activated disqualified From a01603ac5b675d57690ede18d277bc04635a6c59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Aug 2022 10:43:35 +0200 Subject: [PATCH 14/25] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7c793e740a1..fdecb7a73fb 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1552,10 +1552,10 @@ function complete_elementList_with_modules(&$elementList) // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !empty($conf->global->$const_name)) { + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && getDolGlobalString($const_name)) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !empty($conf->global->$const_name)) { + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && getDolGlobalString($const_name)) { $modulequalified = 0; } //If module is not activated disqualified From cc9765c7bdced5c440fd2f895b2e1d28cc183f39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Aug 2022 13:01:17 +0200 Subject: [PATCH 15/25] Clean code --- htdocs/ticket/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 693a40fbb5f..1a2325e52d9 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -56,7 +56,6 @@ $projectid = GETPOST('projectid', 'int'); $project_ref = GETPOST('project_ref', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); $search_fk_project = GETPOST('search_fk_project', 'int') ?GETPOST('search_fk_project', 'int') : GETPOST('projectid', 'int'); -$search_fk_status = GETPOST('search_fk_statut', 'array'); $search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); $search_dateread_start = dol_mktime(0, 0, 0, GETPOST('search_dateread_startmonth', 'int'), GETPOST('search_dateread_startday', 'int'), GETPOST('search_dateread_startyear', 'int')); From 49315de03a5539f9eea7c3708d817c4279755103 Mon Sep 17 00:00:00 2001 From: Christian Humpel Date: Wed, 17 Aug 2022 00:04:22 +0200 Subject: [PATCH 16/25] Fix #21768 The Contact is now showing in the card, if no company is selected. --- htdocs/user/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 597390e9f49..dc365aad149 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2293,6 +2293,12 @@ if ($action == 'create' || $action == 'adduserldap') { print ' ('.$langs->trans("DomainUser").')'; } } elseif ($object->socid > 0 && $object->contact_id > 0) { // external user with a link to a contact + print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' '); // We keep thirdparty empty, contact is already set + print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, '', false, 1); + if ($object->ldap_sid) { + print ' ('.$langs->trans("DomainUser").')'; + } + } elseif (!($object->socid > 0) && $object->contact_id > 0) { // internal user with a link to a contact print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, '', false, 1); if ($object->ldap_sid) { From 510b0c278c9c609b844418581ca23a5064e4cef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:49:01 +0200 Subject: [PATCH 17/25] php V8 warning --- htdocs/fourn/commande/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 91b92523e11..405613a8ab2 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -7,7 +7,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2018-2020 Charlene Benke + * Copyright (C) 2018-2022 Charlene Benke * Copyright (C) 2019 Nicolas Zabouri * Copyright (C) 2021 Alexandre Spangaro * @@ -1535,6 +1535,7 @@ if ($resql) { $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); $totalarray['val']['cf.total_ht'] = 0; $totalarray['val']['cf.total_ttc'] = 0; + $totalarray['val']['cf.total_tva'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { From 6da57e512b529f9c90cc3eb536701d05d277c4c5 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 22 Aug 2022 16:04:40 +0200 Subject: [PATCH 18/25] FIX PHP8 warning in ShowOutputField function --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0c48cefa281..ad5ff16cb29 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1583,7 +1583,7 @@ class ExtraFields if (!empty($value)) { //$value=price($value); $sizeparts = explode(",", $size); - $number_decimals = $sizeparts[1]; + $number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0; $value = price($value, 0, $langs, 0, 0, $number_decimals, ''); } } elseif ($type == 'boolean') { From 3b3ea5eea31f99182bed8490e37122e17026f34d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Aug 2022 23:50:21 +0200 Subject: [PATCH 19/25] Fix typo --- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 710443c9bad..11b28b85cb9 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -863,7 +863,7 @@ class AccountingAccount extends CommonObject if (!empty($buyer->code_compta_product)) { $code_t = $buyer->code_compta_product; $suggestedid = $accountingAccount['thirdparty']; - $suggestedaccountingaccountfor = 'thridparty'; + $suggestedaccountingaccountfor = 'thirdparty'; } } From 36b5195da9ef56a685db4bc1a5c7ff43ac4abb43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 00:46:03 +0200 Subject: [PATCH 20/25] Doc --- htdocs/install/mysql/tables/llx_societe_contacts.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_societe_contacts.sql b/htdocs/install/mysql/tables/llx_societe_contacts.sql index 31d82f3003d..3f301c0cf34 100644 --- a/htdocs/install/mysql/tables/llx_societe_contacts.sql +++ b/htdocs/install/mysql/tables/llx_societe_contacts.sql @@ -13,9 +13,11 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . --- +-- -- ======================================================================== +-- This table contains the contacts by default of a thirdparty +-- Such contacts will be added to document automatiall if their role match the one expected by the document. create table llx_societe_contacts ( From def8b1c7a66a8d7afb70391e09744d8ce9fb7d58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 01:02:09 +0200 Subject: [PATCH 21/25] Fix if SOCIETE_DISABLE_PARENTCOMPANY on, we must not show_subsidiaries --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 2245392f7ca..f55f1c37867 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -3144,7 +3144,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Subsidiaries list - if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES)) { + if (!empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY) && empty($conf->global->SOCIETE_DISABLE_SHOW_SUBSIDIARIES)) { $result = show_subsidiaries($conf, $langs, $db, $object); } From f5004012ed147a6821543c34730f24eaa0db6ea8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 00:16:59 +0200 Subject: [PATCH 22/25] Removed hard coded fetch --- htdocs/admin/receiptprinter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index ac136af0c61..53f0cd9f7f0 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -183,8 +183,8 @@ if ($action == 'testtemplate' && $user->admin) { // test require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); - //$object->initAsSpecimen(); - $object->fetch(18); + $object->initAsSpecimen(); + //$object->fetch(18); //var_dump($object->lines); $ret = $printer->sendToPrinter($object, $templateid, 1); if ($ret == 0) { From 9f3ed07e8704ca3bff7be2b9f707a98571e241b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 11:00:28 +0200 Subject: [PATCH 23/25] Trans --- htdocs/langs/en_US/contracts.lang | 2 +- htdocs/public/payment/newpayment.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 8d209623c1b..ab94a63bcc3 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -80,7 +80,7 @@ ConfirmDeleteContractLine=Are you sure you want to delete this contract line? MoveToAnotherContract=Move service into another contract. ConfirmMoveToAnotherContract=I choosed new target contract and confirm I want to move this service into this contract. ConfirmMoveToAnotherContractQuestion=Choose in which existing contract (of same third party), you want to move this service to? -PaymentRenewContractId=Renew contract line (number %s) +PaymentRenewContractId=Renew contract %s (service %s) ExpiredSince=Expiration date NoExpiredServices=No expired active services ListOfServicesToExpireWithDuration=List of Services to expire in %s days diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b61a2e22a06..14d455b5496 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1353,7 +1353,7 @@ if ($source == 'contractline') { // Object $text = ''.$langs->trans("PaymentRenewContractId", $contract->ref, $contractline->ref).''; - if ($contractline->fk_product) { + if ($contractline->fk_product > 0) { $contractline->fetch_product(); $text .= '
'.$contractline->product->ref.($contractline->product->label ? ' - '.$contractline->product->label : ''); } @@ -1364,8 +1364,8 @@ if ($source == 'contractline') { // $text.='
'.$langs->trans("DateEndPlanned").': '; // $text.=dol_print_date($contractline->date_fin_validite); //} - if ($contractline->date_fin_validite) { - $text .= '
'.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_fin_validite); + if ($contractline->date_end) { + $text .= '
'.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_end); } if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; From 06be8dc4bfee40ca60dfbb2fbcea5ee838074af2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 13:39:06 +0200 Subject: [PATCH 24/25] Trans --- htdocs/langs/en_US/products.lang | 2 +- htdocs/product/admin/product.php | 3 ++- htdocs/product/fournisseurs.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 94d77315217..a0a3f4e588d 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -345,7 +345,7 @@ PossibleValues=Possible values GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...) UseProductFournDesc=Add a feature to define the product description defined by the vendors (for each vendor reference) in addition to the description for customers ProductSupplierDescription=Vendor description for the product -UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents) +UseProductSupplierPackaging=Use packaging for prices rounded to multiples for purchase prices (recalculate quantities according to multiples set on purchase prices when adding/updating line in a vendor documents) PackagingForThisProduct=Packaging PackagingForThisProductDesc=You will automaticaly purchase a multiple of this quantity. QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index eeeaa094f29..da669aa25d9 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -596,9 +596,10 @@ print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_ print '
'.$langs->trans("UseProductSupplierPackaging").''.$form->textwithpicto($langs->trans("UseProductSupplierPackaging"), $langs->trans("PackagingForThisProductDesc")).''; print ajax_constantonoff("PRODUCT_USE_SUPPLIER_PACKAGING", array(), $conf->entity, 0, 0, 0, 0); //print $form->selectyesno("activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 9dfc90b86a4..28e587b3576 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -549,7 +549,7 @@ if ($id > 0 || $ref) { print '
'.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).'