From 028554c8fc561fbbf5a7a3d01ce5d8ce2077fc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 1 May 2024 16:20:29 +0200 Subject: [PATCH 1/5] fix phan (#29560) * fix phan * fix excludes * clean code * css picto * clean code --- htdocs/projet/card.php | 3 +- htdocs/salaries/card.php | 6 +-- htdocs/takepos/pay.php | 14 ++++--- htdocs/zapier/admin/setup.php | 75 +++++++++++++++++------------------ 4 files changed, 50 insertions(+), 48 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 4abed50260b..f6d04ccb8be 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023 Christian Foellmann * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -770,7 +771,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { if (getDolGlobalString('PROJECT_FILTER_FOR_THIRDPARTY_LIST')) { $filter = getDolGlobalString('PROJECT_FILTER_FOR_THIRDPARTY_LIST'); } - $text = img_picto('', 'company').$form->select_company(GETPOSTINT('socid'), 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusxx maxwidth500'); + $text = img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOSTINT('socid'), 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusxx maxwidth500'); if (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 03f8eb68c67..bbfacb08097 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2014-2020 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2023 Maxime Nicolas * Copyright (C) 2023 Benjamin GREMBI @@ -569,7 +569,7 @@ if ($action == 'create' && $permissiontoadd) { print ''; print $form->editfieldkey('Employee', 'fk_user', '', $object, 0, 'string', '', 1).''; $noactive = 0; // We keep active and unactive users - print img_picto('', 'user', 'class="paddingrighonly"').$form->select_dolusers(GETPOSTINT('fk_user'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive); + print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(GETPOSTINT('fk_user'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive); print ''; // Label @@ -626,7 +626,7 @@ if ($action == 'create' && $permissiontoadd) { if (isModEnabled("bank")) { print ''; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; - print img_picto('', 'bank_account', 'class="paddingrighonly"'); + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant print ''; } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 06f1e44b635..c8786128687 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -1,6 +1,7 @@ * Copyright (C) 2021-2022 Thibault FOUCART + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -525,12 +526,13 @@ if (getDolGlobalString('TAKEPOS_CUSTOMER_DISPLAY')) { currency != $_SESSION["takeposcustomercurrency"]) { +$sessioncurrency = $_SESSION["takeposcustomercurrency"] ?? ''; +if (isModEnabled('multicurrency') && $sessioncurrency != "" && $conf->currency != $sessioncurrency) { // Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency $showothercurrency = 1; include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); - $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); + $multicurrency->fetch(0, $sessioncurrency); } ?> @@ -539,7 +541,7 @@ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"] trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $conf->currency); if ($showothercurrency) { - print '   (' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + print '   (' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } ?> @@ -548,7 +550,7 @@ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"] trans('RemainToPay'); ?>: multicurrency_code); if ($showothercurrency) { - print '   (' . price($remaintopay * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + print '   (' . price($remaintopay * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } ?> @@ -557,7 +559,7 @@ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"] trans("Received"); ?>: multicurrency_code); if ($showothercurrency) { - print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } ?> @@ -565,7 +567,7 @@ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"] trans("Change"); ?>: multicurrency_code); if ($showothercurrency) { - print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } ?> diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php index 541b61f4964..6ae23e3dc21 100644 --- a/htdocs/zapier/admin/setup.php +++ b/htdocs/zapier/admin/setup.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric FRANCE + * Copyright (C) 2019-2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,8 +26,8 @@ require '../../main.inc.php'; // Libraries -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/zapier/lib/zapier.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/zapier/lib/zapier.lib.php'; // Translations $langs->loadLangs(array('admin', 'zapier')); @@ -42,8 +42,8 @@ $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); $arrayofparameters = array( -// 'ZAPIERFORDOLIBARR_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), -// 'ZAPIERFORDOLIBARR_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) + // 'ZAPIERFORDOLIBARR_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), + // 'ZAPIERFORDOLIBARR_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) ); if (!isModEnabled('zapier')) { @@ -58,7 +58,7 @@ if (empty($user->admin)) { * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php'; /* * View @@ -69,7 +69,7 @@ $help_url = 'EN:Module_Zapier'; llxHeader('', $langs->trans($page_name), $help_url); // Subheader -$linkback = ''.$langs->trans("BackToModuleList").''; +$linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier'); @@ -77,49 +77,48 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier'); $head = zapierAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', '', -1, "zapier"); +if (!empty($arrayofparameters)) { + if ($action == 'edit') { + print '
'; + print ''; + print ''; -if ($action == 'edit') { - print ''; - print ''; - print ''; - - print ''; - print ''; - - foreach ($arrayofparameters as $key => $val) { - print ''; - } - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); - print '
'; - - print '
'; - print ''; - print '
'; - - print '
'; - print '
'; -} else { - if (!empty($arrayofparameters)) { print ''; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { print ''; + print $form->textwithpicto($langs->trans($key), $langs->trans($key . 'Tooltip')); + print ''; + } + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
' . $langs->trans("Parameter") . '' . $langs->trans("Value") . '
'; - print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); - print ''.getDolGlobalString($key).'
'; + + print '
'; + print ''; + print '
'; + + print ''; + print '
'; + } else { + print ''; + print ''; + + foreach ($arrayofparameters as $key => $val) { + print ''; } print '
' . $langs->trans("Parameter") . '' . $langs->trans("Value") . '
'; + print $form->textwithpicto($langs->trans($key), $langs->trans($key . 'Tooltip')); + print '' . getDolGlobalString($key) . '
'; print ''; - } else { - // Setup page goes here - echo '

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

'; - //print '
'.$langs->trans("NothingToSetup"); } +} else { + // Setup page goes here + echo '

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

'; + //print '
'.$langs->trans("NothingToSetup"); } From 78b00728b74c32e1e169fe5e22292236ad080fdf Mon Sep 17 00:00:00 2001 From: Gaspard d'Hautefeuille Date: Wed, 1 May 2024 16:21:02 +0200 Subject: [PATCH 2/5] Add RNA number as prof ID 6 for FR (#29567) --- htdocs/langs/en_US/companies.lang | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 1828df47b1b..a9ccc0f3098 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -176,12 +176,14 @@ ProfId1FR=Prof Id 1 (SIREN) ProfId2FR=Prof Id 2 (SIRET) ProfId3FR=Prof Id 3 (NAF, old APE) ProfId4FR=Prof Id 4 (RCS/RM) -ProfId5FR=Prof Id 5 (numéro EORI) +ProfId5FR=Prof Id 5 (EORI number) +ProfId6FR=Prof Id 6 (RNA number) ProfId1ShortFR=SIREN ProfId2ShortFR=SIRET ProfId3ShortFR=NAF ProfId4ShortFR=RCS ProfId5ShortFR=EORI +ProfId6ShortFR=RNA ProfId1GB=Registration Number ProfId3GB=SIC ProfId1HN=Id prof. 1 (RTN) From 132732d3f01aa2c462d80849291271f0149057b7 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Wed, 1 May 2024 16:23:02 +0200 Subject: [PATCH 3/5] FIX separator for FEC import (#29558) --- htdocs/imports/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 33731d8aafc..6523c20d8fd 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -141,7 +141,7 @@ $importmodelid = GETPOSTINT('importmodelid'); $excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 2); $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); -$separator = (GETPOST('separator', 'alphanohtml') ? GETPOST('separator', 'alphanohtml', 3) : ''); +$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml', 3) : ''); $enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " $charset = GETPOST('charset', 'aZ09'); $separator_used = str_replace('\t', "\t", $separator); From ae492507ccd4e684b4b9b0674d76beaae0eb78d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 1 May 2024 16:23:17 +0200 Subject: [PATCH 4/5] css picto (#29552) --- htdocs/holiday/card_group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/card_group.php b/htdocs/holiday/card_group.php index 16277e786f8..9060ba7e1f8 100644 --- a/htdocs/holiday/card_group.php +++ b/htdocs/holiday/card_group.php @@ -529,7 +529,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { } } - print img_picto('', 'users') . $form->multiselectarray('users', $userlist, GETPOST('users', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print img_picto('', 'users', 'class="pictofixedwidth"') . $form->multiselectarray('users', $userlist, GETPOST('users', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print ''; // Type From f9f522df916e9642d68fa2d0fb5d6d41c1e44ad2 Mon Sep 17 00:00:00 2001 From: Jonathan Botquin <99287239+Jonathanbtq@users.noreply.github.com> Date: Wed, 1 May 2024 16:35:27 +0200 Subject: [PATCH 5/5] Fix width img_picto bank (#29551) --- htdocs/compta/prelevement/create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 3bdcdfb4602..865365cbef8 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -301,7 +301,7 @@ if ($nb) { $title = $langs->trans('BankToPayCreditTransfer').': '; } print ''.$title.''; - print img_picto('', 'bank_account'); + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');