From f8a4d9075ba22c8dbf52e6c2d3d7b53b25b970ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2019 11:48:25 +0100 Subject: [PATCH] Fix css for fontawesome 5 --- htdocs/admin/bank.php | 62 ++++++++++----------------- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 12 +++++- 3 files changed, 35 insertions(+), 41 deletions(-) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9fc256540a2..2a0a66fe269 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -50,8 +50,8 @@ $type = 'bankaccount'; //Order display of bank account if ($action == 'setbankorder') { - if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", - GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -62,8 +62,8 @@ if ($action == 'setbankorder') { //Auto report last num releve on conciliate if ($action == 'setreportlastnumreleve') { - if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, - '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -72,8 +72,8 @@ if ($action == 'setreportlastnumreleve') { } } elseif ($action == 'unsetreportlastnumreleve') { - if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, - '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -100,8 +100,7 @@ if ($action == 'specimen') { $filefound = 0; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php", - 0); + $file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php", 0); if (file_exists($file)) { $filefound = 1; $classname = "pdf_" . $modele; @@ -142,8 +141,7 @@ elseif ($action == 'del') { } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', - $conf->entity)) { + if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // The constant that was read before the new set // We therefore requires a variable to have a coherent view $conf->global->BANKADDON_PDF = $value; @@ -169,8 +167,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("BankSetupModule")); $linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, - 'title_setup'); +print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); @@ -252,7 +249,7 @@ if ($resql) { while ($i < $num_rows) { $array = $db->fetch_array($resql); array_push($def, $array[0]); - $i ++; + $i++; } } else { @@ -285,8 +282,7 @@ foreach ($dirmodels as $reldir) { arsort($filelist); foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', - $file)) { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir . '/' . $file)) { $name = substr($file, 4, dol_strlen($file) - 16); @@ -296,11 +292,9 @@ foreach ($dirmodels as $reldir) { $module = new $classname($db); $modulequalified = 1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL - < 2) + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL - < 1) + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; if ($modulequalified) { @@ -317,27 +311,23 @@ foreach ($dirmodels as $reldir) { if (in_array($name, $def)) { print '' . "\n"; print ''; - print img_picto($langs->trans("Enabled"), - 'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), - 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } // Default print ''; if ($conf->global->BANKADDON_PDF == $name) { - print img_picto($langs->trans("Default"), - 'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print '' . img_picto($langs->trans("Disabled"), - 'off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; } print ''; @@ -348,30 +338,25 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur; } $htmltooltip .= '

' . $langs->trans("FeaturesSupported") . ':'; - $htmltooltip .= '
' . $langs->trans("Logo") . ': ' . yn($module->option_logo, - 1, 1); + $htmltooltip .= '
' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1); //$htmltooltip .= '
' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1); //$htmltooltip .= '
' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1); - $htmltooltip .= '
' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, - 1, 1); + $htmltooltip .= '
' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1); // $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); // $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); //$htmltooltip .= '
' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, - 0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview print ''; if ($module->type == 'pdf') { - print '' . img_object($langs->trans("Preview"), - 'bill') . ''; + print '' . img_object($langs->trans("Preview"), 'bill') . ''; } else { - print img_object($langs->trans("PreviewNotAvailable"), - 'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -423,8 +408,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), - 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 56ae3405a98..f8cb32896f2 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -944,7 +944,7 @@ class Translate * If mb_convert_encoding is not available, return currency code. * * @param string $currency_code Currency code - * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. + * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only the requested currency. * @return string Currency symbol encoded into UTF8 */ public function getCurrencySymbol($currency_code, $forceloadall = 0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 305b53dc37f..8750b943685 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3005,10 +3005,20 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } elseif ($pictowithoutext == 'off') { $fakey = 'fa-square-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-square'; + $fa='far'; + } $fasize = '1.3em'; } elseif ($pictowithoutext == 'on') { $fakey = 'fa-check-square-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-check-square'; + $fa='far'; + } $fasize = '1.3em'; } elseif ($pictowithoutext == 'bank') { @@ -4385,7 +4395,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ { if ($currency_code == 'auto') $currency_code=$conf->currency; - $listofcurrenciesbefore=array('USD','GBP','AUD','MXN','PEN','CNY'); + $listofcurrenciesbefore=array('USD','GBP','AUD','HKD','MXN','PEN','CNY'); $listoflanguagesbefore=array('nl_NL'); if (in_array($currency_code, $listofcurrenciesbefore) || in_array($outlangs->defaultlang, $listoflanguagesbefore)) {