diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index fa1c7c1447d..3adc47ed6df 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2024 Alexandre Spangaro + * Copyright (C) 2016-2025 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * @@ -378,13 +378,21 @@ if ($action != 'export_csv') { // Accountancy account $moreforfilter .= $langs->trans('AccountAccounting').': '; if ($type == 'sub') { - $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200'); + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { + $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200'); + } else { + $moreforfilter .= ''; + } } else { $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200', 'accounts'); } $moreforfilter .= ' '; if ($type == 'sub') { - $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200'); + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { + $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200'); + } else { + $moreforfilter .= ''; + } } else { $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200', 'accounts'); } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 6ec0fb9c3e1..72b4a535c33 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2020 Florian Henry - * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2013-2025 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * @@ -801,13 +801,21 @@ $moreforfilter .= '
'; $moreforfilter .= $langs->trans('AccountAccounting').': '; $moreforfilter .= '
'; if ($type == 'sub') { - $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200'); + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { + $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200'); + } else { + $moreforfilter .= ''; + } } else { $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200'); } $moreforfilter .= ' '; if ($type == 'sub') { - $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200'); + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { + $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200'); + } else { + $moreforfilter .= ''; + } } else { $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200'); } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 08f4a5ce8d0..e80ac1b0276 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2916,7 +2916,7 @@ function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '') } elseif ($value == 'type_vat') { // VAT type 0: all, 1: sell, 2: purchase print ''; - print $form->selectarray($value, $type_vatList, (empty($obj->{$value}) ? '' : $obj->{$value}), 1); + print $form->selectarray($value, $type_vatList, (empty($obj->{$value}) ? '0' : $obj->{$value})); print ''; } elseif ($value == 'localtax1_type' || $value == 'localtax2_type') { // Le type de taxe locale diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index fcef409cc55..59073acc49c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -625,7 +625,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; - $newcardbutton = dolGetButtonTitle($langs->trans("AddThirdParty"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&client=3&custcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('societe', 'creer')); + $newcardbutton = dolGetButtonTitle($langs->trans("AddThirdParty"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&customer=3&custcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('societe', 'creer')); // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d8f2acc9403..8872c60bba7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2061,7 +2061,7 @@ if ($action == 'create') { }); '; } - print ' '; + print ' '; print ''; } print ''."\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index fa693ac941a..646560bd120 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1986,7 +1986,7 @@ if ($action == 'create' && $usercancreate) { }); '; } - print ' '; + print ' '; print ''; } print ''."\n"; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 5c0c75649f4..72a60ce02b5 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -352,9 +352,9 @@ if (empty($numref)) { $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $morehtml = ''; - if ($action != 'addline' && $action != 'reconcile') { - $morehtml .= $buttonreconcile; - } + // if ($action != 'addline' && $action != 'reconcile') { + // $morehtml .= $buttonreconcile; + // } print '
'; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ba163b13ac1..188f97adf23 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3520,7 +3520,7 @@ if ($action == 'create') { '; } if (!GETPOSTINT('fac_rec')) { - print ' '; + print ' '; } print ''; print ''."\n"; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index c7c42dd9738..aa19bd50f14 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1256,7 +1256,7 @@ if ($action == 'create') { print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusxx maxwidth500'); - print ' '; + print ' '; print ''; } print ''."\n"; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 9299590121d..f3ec69a7a1a 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -435,7 +435,7 @@ if ($action == 'create') { }); '; } - print ' '; + print ' '; print ''; } print ''."\n"; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 9775ebc758b..16bc75c56c8 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -868,11 +868,13 @@ class EmailCollector extends CommonObject if (function_exists('mb_convert_encoding')) { // change spaces by entropy because mb_convert fail with spaces $str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used + $str = preg_replace("/_/", "xxxUNDERSCORExxx", $str); // encode underscore to avoid encoding issues with mb_convert $str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used // if mb_convert work if ($str = mb_convert_encoding($str, "UTF-7")) { // change characters $str = preg_replace("/\+A/", "&A", $str); + $str = preg_replace("/xxxUNDERSCORExxx/", "_", $str); // change to spaces again $str = preg_replace("/xxxSPACExxx/", " ", $str); // change to [Gmail] again diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b6068054f08..c05b44f7123 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -403,7 +403,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -520,7 +525,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -632,7 +642,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -748,7 +763,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -864,7 +884,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -978,7 +1003,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1017,7 +1047,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1046,7 +1081,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1226,6 +1266,9 @@ if (empty($reshook)) { $user->fetch($object->fk_user_author); $newlang = $user->lang; } + if (empty($newlang)) { + $newlang = $langs; + } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1277,7 +1320,15 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -1374,7 +1425,12 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $user = new User($db); + $user->fetch($object->fk_user_author); + $newlang = $user->lang; + } + if (empty($newlang)) { + $newlang = $langs; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 07311a5ca20..5375c3a1831 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1151,7 +1151,7 @@ if ($action == 'create') { print ''; print ''; print '
'.$langs->trans("ThirdParty").''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300'); - print ' '; + print ' '; print '
'; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 23661b37f47..7c4e7075d18 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -2064,4 +2064,3 @@ class FactureFournisseurRec extends CommonInvoice } } } - diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 52becef087e..fe29990b889 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -813,7 +813,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print $text; } if (!GETPOSTISSET('backtopage')) { - $url = '/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create'); + $url = '/societe/card.php?action=create&customer=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create'); $newbutton = ''; // TODO @LDR Implement this if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index aaed24400c4..861caa5e7e1 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1484,9 +1484,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio break; } - $selectedprospect = ((GETPOSTISSET('prospect') || $action == 'create') ? GETPOSTINT('prospect') : $selectedprospect); - $selectedcustomer = ((GETPOSTISSET('customer') || $action == 'create') ? GETPOSTINT('customer') : $selectedcustomer); - $selectedsupplier = ((GETPOSTISSET('supplier') || $action == 'create') ? GETPOSTINT('supplier') : $object->fournisseur); + $selectedprospect = ((GETPOSTISSET('prospect') && $action == 'create') ? GETPOSTINT('prospect') : $selectedprospect); + $selectedcustomer = ((GETPOSTISSET('customer') && $action == 'create') ? GETPOSTINT('customer') : $selectedcustomer); + $selectedsupplier = ((GETPOSTISSET('supplier') && $action == 'create') ? GETPOSTINT('supplier') : $object->fournisseur); print ''; if ($conf->browser->layout != 'phone') {