Rename constant

This commit is contained in:
Laurent Destailleur 2019-10-23 17:48:55 +02:00
parent f4545a2068
commit 41303006f3
5 changed files with 28 additions and 28 deletions

View File

@ -2255,7 +2255,7 @@ function colorValidateHex($color, $allow_white = true)
* @return string New string of color
* @see colorAdjustBrightness()
*/
function colorAgressivity($hex, $ratio = -50)
function colorAgressiveness($hex, $ratio = -50)
{
// Steps should be between -255 and 255. Negative = darker, positive = lighter
$ratio = max(-100, min(100, $ratio));
@ -2277,7 +2277,7 @@ function colorAgressivity($hex, $ratio = -50)
if ($color > 127) $color += ((255 - $color) * ($ratio / 100));
if ($color < 128) $color -= ($color * ($ratio / 100));
}
else // We decrease agressivity
else // We decrease agressiveness
{
if ($color > 128) $color -= (($color - 128) * (abs($ratio) / 100));
if ($color < 127) $color += ((128 - $color) * (abs($ratio) / 100));
@ -2294,7 +2294,7 @@ function colorAgressivity($hex, $ratio = -50)
* @param string $hex Color in hex ('#AA1122' or 'AA1122' or '#a12' or 'a12')
* @param integer $steps Step/offset added to each color component. It should be between -255 and 255. Negative = darker, positive = lighter
* @return string New color with format '#AA1122'
* @see colorAgressivity()
* @see colorAgressiveness()
*/
function colorAdjustBrightness($hex, $steps)
{

View File

@ -1277,7 +1277,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
if (GETPOSTISSET('dol_optimize_smallscreen')) { $themeparam.='&amp;dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen', 'int'); }
if (GETPOSTISSET('dol_no_mouse_hover')) { $themeparam.='&amp;dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover', 'int'); }
if (GETPOSTISSET('dol_use_jmobile')) { $themeparam.='&amp;dol_use_jmobile='.GETPOST('dol_use_jmobile', 'int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile', 'int'); }
if (GETPOSTISSET('THEME_AGRESSIVITY_RATIO')) { $themeparam.='&amp;THEME_AGRESSIVITY_RATIO='.GETPOST('THEME_AGRESSIVITY_RATIO', 'int'); }
if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) { $themeparam.='&amp;THEME_AGRESSIVENESS_RATIO='.GETPOST('THEME_AGRESSIVENESS_RATIO', 'int'); }
if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax)
{

View File

@ -155,40 +155,40 @@ a.info-box-text{ text-decoration: none;}
<?php
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
//print '/* conf->global->THEME_AGRESSIVITY_RATIO='.$conf->global->THEME_AGRESSIVITY_RATIO.' */'."\n";
if (! isset($conf->global->THEME_AGRESSIVITY_RATIO)) $conf->global->THEME_AGRESSIVITY_RATIO=-40;
if (GETPOSTISSET('THEME_AGRESSIVITY_RATIO')) $conf->global->THEME_AGRESSIVITY_RATIO=GETPOST('THEME_AGRESSIVITY_RATIO', 'int');
//print '/* conf->global->THEME_AGRESSIVENESS_RATIO='.$conf->global->THEME_AGRESSIVENESS_RATIO.' */'."\n";
if (! isset($conf->global->THEME_AGRESSIVENESS_RATIO)) $conf->global->THEME_AGRESSIVENESS_RATIO=-40;
if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENESS_RATIO=GETPOST('THEME_AGRESSIVENESS_RATIO', 'int');
?>
.bg-infoxbox-project{
background-color: <?php print colorAgressivity('#6c6a98', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#6c6a98', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-action{
background-color: <?php print colorAgressivity('#b46080', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#b46080', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-propal,
.bg-infoxbox-facture,
.bg-infoxbox-commande{
background-color: <?php print colorAgressivity('#99a17d', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#99a17d', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-supplier_proposal,
.bg-infoxbox-invoice_supplier,
.bg-infoxbox-order_supplier{
background-color: <?php print colorAgressivity('#599caf', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#599caf', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-contrat{
background-color: <?php print colorAgressivity('#469686', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#469686', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-bank_account{
background-color: <?php print colorAgressivity('#c5903e', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#c5903e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-adherent{
background-color: <?php print colorAgressivity('#79633f', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-expensereport{
background-color: <?php print colorAgressivity('#79633f', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-holiday{
background-color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
background-color: <?php print colorAgressiveness('#755114', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}

View File

@ -236,7 +236,7 @@ print 'fontsizesmaller='.$fontsizesmaller."\n";
print 'topMenuFontSize='.$topMenuFontSize."\n";
print 'toolTipBgColor='.$toolTipBgColor."\n";
print 'toolTipFontColor='.$toolTipFontColor."\n";
print 'conf->global->THEME_AGRESSIVITY_RATIO='.$conf->global->THEME_AGRESSIVITY_RATIO." (must be between -100 and +100)\n";
print 'conf->global->THEME_AGRESSIVENESS_RATIO='.$conf->global->THEME_AGRESSIVENESS_RATIO." (must be between -100 and +100)\n";
print '*/'."\n";

View File

@ -104,39 +104,39 @@ a.info-box-text{ text-decoration: none;}
}
<?php
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (! isset($conf->global->THEME_AGRESSIVITY_RATIO)) $conf->global->THEME_AGRESSIVITY_RATIO=-100;
if (GETPOSTISSET('THEME_AGRESSIVITY_RATIO')) $conf->global->THEME_AGRESSIVITY_RATIO=GETPOST('THEME_AGRESSIVITY_RATIO', 'int');
if (! isset($conf->global->THEME_AGRESSIVENESS_RATIO)) $conf->global->THEME_AGRESSIVENESS_RATIO=-100;
if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENESS_RATIO=GETPOST('THEME_AGRESSIVENESS_RATIO', 'int');
?>
.bg-infoxbox-project i.fa{
color: <?php print colorAgressivity('#605ca8', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#605ca8', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-action i.fa{
color: <?php print colorAgressivity('#d84b80', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#d84b80', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-propal i.fa,
.bg-infoxbox-facture i.fa,
.bg-infoxbox-commande i.fa{
color: <?php print colorAgressivity('#abb87b', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#abb87b', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-supplier_proposal i.fa,
.bg-infoxbox-invoice_supplier i.fa,
.bg-infoxbox-order_supplier i.fa{
color: <?php print colorAgressivity('#40b0cf', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#40b0cf', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-contrat i.fa{
color: <?php print colorAgressivity('#20a68a', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#20a68a', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-bank_account i.fa{
color: <?php print colorAgressivity('#e39c42', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#e39c42', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-adherent i.fa{
color: <?php print colorAgressivity('#f39c12', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#f39c12', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-expensereport i.fa{
color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#755114', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}
.bg-infoxbox-holiday i.fa{
color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
color: <?php print colorAgressiveness('#755114', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
}