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] 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"); }