Enhance #11643
This commit is contained in:
parent
2285e0d780
commit
b8e1cc8d16
@ -195,7 +195,6 @@ if ($action == 'edit')
|
||||
{
|
||||
foreach($delays as $delay)
|
||||
{
|
||||
|
||||
$value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
@ -235,7 +234,6 @@ else
|
||||
{
|
||||
foreach($delays as $delay)
|
||||
{
|
||||
|
||||
$value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
@ -300,16 +298,16 @@ if ($action == 'edit') {
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clear.png', $options);
|
||||
print img_weather($text, 0, $options);
|
||||
print '= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-few-clouds.png', $options);
|
||||
print img_weather($text, 1, $options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clouds.png', $options);
|
||||
print img_weather($text, 2, $options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-many-clouds.png', $options);
|
||||
print img_weather($text, 3, $options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.'"/></td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
@ -320,16 +318,16 @@ if ($action == 'edit') {
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clear.png', $options);
|
||||
print img_weather($text, 0, $options);
|
||||
print '= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-few-clouds.png', $options);
|
||||
print img_weather($text, 1, $options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clouds.png', $options);
|
||||
print img_weather($text, 2, $options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-many-clouds.png', $options);
|
||||
print img_weather($text, 3, $options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'"/> %</td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
@ -371,19 +369,19 @@ if ($action == 'edit') {
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clear.png', $options);
|
||||
print img_weather($text, 0, $options);
|
||||
print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-few-clouds.png', $options);
|
||||
print img_weather($text, 1, $options);
|
||||
print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clouds.png', $options);
|
||||
print img_weather($text, 2, $options);
|
||||
print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-many-clouds.png', $options);
|
||||
print img_weather($text, 3, $options);
|
||||
print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-storm.png', $options);
|
||||
print img_weather($text, 4, $options);
|
||||
print '> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %</td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
@ -391,19 +389,19 @@ if ($action == 'edit') {
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clear.png', $options);
|
||||
print img_weather($text, 0, $options);
|
||||
print '= '.$level0;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-few-clouds.png', $options);
|
||||
print img_weather($text, 1, $options);
|
||||
print '<= '.$level1;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-clouds.png', $options);
|
||||
print img_weather($text, 2, $options);
|
||||
print '<= '.$level2;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-many-clouds.png', $options);
|
||||
print img_weather($text, 3, $options);
|
||||
print '<= '.$level3;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text, 'weather-storm.png', $options);
|
||||
print img_weather($text, 4, $options);
|
||||
print '> '.$level3;
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
@ -3225,7 +3225,7 @@ function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false,
|
||||
* Show weather picto
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
|
||||
* @param string|int $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. Or level of meteo image (0-4).
|
||||
* @param string $moreatt Add more attribute on img tag
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @param string $morecss More CSS
|
||||
@ -3236,7 +3236,13 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $mo
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (! preg_match('/(\.png|\.gif)$/i', $picto)) $picto .= '.png';
|
||||
if (is_numeric($picto))
|
||||
{
|
||||
$leveltopicto=array(0=>'weather-clear.png', 1=>'weather-few-clouds.png', 2=>'weather-clouds.png', 3=>'weather-many-clouds.png', 4=>'weather-storm.png');
|
||||
//return '<i class="fa fa-weather-level'.$picto.'"></i>';
|
||||
$picto = $leveltopicto[$picto];
|
||||
}
|
||||
elseif (! preg_match('/(\.png|\.gif)$/i', $picto)) $picto .= '.png';
|
||||
|
||||
$path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto;
|
||||
|
||||
|
||||
@ -2251,9 +2251,53 @@ function colorValidateHex($color, $allow_white = true)
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hex color in hex
|
||||
* @param integer $steps Steps should be between -255 and 255. Negative = darker, positive = lighter
|
||||
* @return string
|
||||
* Change color to make it less aggressive (ratio is negative) or more aggressive (ratio is positive)
|
||||
*
|
||||
* @param string $hex Color in hex ('#AA1122' or 'AA1122' or '#a12' or 'a12')
|
||||
* @param integer $ratio Default=-50. Note: 0=Component color is unchanged, -100=Component color become 88, +100=Component color become 00 or FF
|
||||
* @return string New string of color
|
||||
* @see colorAdjustBrightness()
|
||||
*/
|
||||
function colorAgressivity($hex, $ratio = -50)
|
||||
{
|
||||
// Steps should be between -255 and 255. Negative = darker, positive = lighter
|
||||
$ratio = max(-100, min(100, $ratio));
|
||||
|
||||
// Normalize into a six character long hex string
|
||||
$hex = str_replace('#', '', $hex);
|
||||
if (strlen($hex) == 3) {
|
||||
$hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
|
||||
}
|
||||
|
||||
// Split into three parts: R, G and B
|
||||
$color_parts = str_split($hex, 2);
|
||||
$return = '#';
|
||||
|
||||
foreach ($color_parts as $color) {
|
||||
$color = hexdec($color); // Convert to decimal
|
||||
if ($ratio > 0) // We increase aggressivity
|
||||
{
|
||||
if ($color > 127) $color += ((255 - $color) * ($ratio / 100));
|
||||
if ($color < 128) $color -= ($color * ($ratio / 100));
|
||||
}
|
||||
else // We decrease agressivity
|
||||
{
|
||||
if ($color > 128) $color -= (($color - 128) * (abs($ratio) / 100));
|
||||
if ($color < 127) $color += ((128 - $color) * (abs($ratio) / 100));
|
||||
}
|
||||
$color = max(0, min(255, $color)); // Adjust color
|
||||
$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
|
||||
}
|
||||
|
||||
//var_dump($hex.' '.$ratio.' -> '.$return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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()
|
||||
*/
|
||||
function colorAdjustBrightness($hex, $steps)
|
||||
{
|
||||
|
||||
@ -769,9 +769,7 @@ if (!empty($valid_dashboardlines))
|
||||
$weatherDashBoard= '<div class="box-flex-item '.$appendClass.'">'."\n";
|
||||
$weatherDashBoard.= ' <div class="info-box '.$openedDashBoardSize.' info-box-weather info-box-weather-level'.$weather->level.'">'."\n";
|
||||
$weatherDashBoard.= ' <span class="info-box-icon">';
|
||||
|
||||
$weatherDashBoard.= ' <i class="fa fa-weather-level'.$weather->level.'"></i>';
|
||||
|
||||
$weatherDashBoard.= img_weather('', $weather->level, '', 0, 'valignmiddle width50');
|
||||
$weatherDashBoard.= ' </span>'."\n";
|
||||
$weatherDashBoard.= ' <div class="info-box-content">'."\n";
|
||||
$weatherDashBoard.= ' <span class="info-box-title">'.$langs->trans('GlobalOpenedElemView').'</span>' . "\n";
|
||||
|
||||
@ -1258,11 +1258,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09')?'&optioncss='.GETPOST('optioncss', 'aZ09', 1):'').'&userid='.$user->id.'&entity='.$conf->entity;
|
||||
$themeparam.=($ext?'&'.$ext:'').'&revision='.$conf->global->MAIN_IHM_PARAMS_REV;
|
||||
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
|
||||
if (GETPOST('dol_hide_topmenu', 'int')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu', 'int'); }
|
||||
if (GETPOST('dol_hide_leftmenu', 'int')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu', 'int'); }
|
||||
if (GETPOST('dol_optimize_smallscreen', 'int')) { $themeparam.='&dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen', 'int'); }
|
||||
if (GETPOST('dol_no_mouse_hover', 'int')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover', 'int'); }
|
||||
if (GETPOST('dol_use_jmobile', 'int')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile', 'int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile', 'int'); }
|
||||
if (GETPOSTISSET('dol_hide_topmenu')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu', 'int'); }
|
||||
if (GETPOSTISSET('dol_hide_leftmenu')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu', 'int'); }
|
||||
if (GETPOSTISSET('dol_optimize_smallscreen')) { $themeparam.='&dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen', 'int'); }
|
||||
if (GETPOSTISSET('dol_no_mouse_hover')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover', 'int'); }
|
||||
if (GETPOSTISSET('dol_use_jmobile')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile', 'int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile', 'int'); }
|
||||
if (GETPOSTISSET('THEME_AGRESSIVITY_RATIO')) { $themeparam.='&THEME_AGRESSIVITY_RATIO='.GETPOST('THEME_AGRESSIVITY_RATIO', 'int'); }
|
||||
|
||||
if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax)
|
||||
{
|
||||
|
||||
@ -116,36 +116,41 @@ a.info-box-text{ text-decoration: none;}
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
<?php
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib/php';
|
||||
if (! isset($conf->global->THEME_AGRESSIVITY_RATIO)) $conf->global->THEME_AGRESSIVITY_RATIO=-75;
|
||||
if (GETPOSTISSET('THEME_AGRESSIVITY_RATIO')) $conf->global->THEME_AGRESSIVITY_RATIO=GETPOST('THEME_AGRESSIVITY_RATIO', 'int');
|
||||
?>
|
||||
.bg-infoxbox-project{
|
||||
background-color: #605ca8 !important;
|
||||
background-color: <?php print colorAgressivity('#605ca8', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-action{
|
||||
background-color: #d84b80 !important;
|
||||
background-color: <?php print colorAgressivity('#d84b80', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-propal,
|
||||
.bg-infoxbox-facture,
|
||||
.bg-infoxbox-commande{
|
||||
background-color: #abb87b !important;
|
||||
background-color: <?php print colorAgressivity('#abb87b', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-supplier_proposal,
|
||||
.bg-infoxbox-invoice_supplier,
|
||||
.bg-infoxbox-order_supplier{
|
||||
background-color: #40b0cf !important;
|
||||
background-color: <?php print colorAgressivity('#40b0cf', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-contrat{
|
||||
background-color: #20a68a !important;
|
||||
background-color: <?php print colorAgressivity('#20a68a', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-bank_account{
|
||||
background-color: #e39c42 !important;
|
||||
background-color: <?php print colorAgressivity('#e39c42', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-adherent{
|
||||
//background-color: #f39c12 !important;
|
||||
background-color: <?php print colorAgressivity('#f39c12', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-expensereport{
|
||||
background-color: #755114 !important;
|
||||
background-color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-holiday{
|
||||
background-color: #755114 !important;
|
||||
background-color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -95,39 +95,43 @@ a.info-box-text{ text-decoration: none;}
|
||||
.info-box-icon {
|
||||
color: #000 !important;
|
||||
}
|
||||
/*
|
||||
.bg-infoxbox-project{
|
||||
background-color: #605ca8 !important;
|
||||
<?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');
|
||||
?>
|
||||
.bg-infoxbox-project i.fa{
|
||||
color: <?php print colorAgressivity('#605ca8', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-action{
|
||||
background-color: #d81b60 !important;
|
||||
.bg-infoxbox-action i.fa{
|
||||
color: <?php print colorAgressivity('#d84b80', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-propal,
|
||||
.bg-infoxbox-facture,
|
||||
.bg-infoxbox-commande{
|
||||
background-color: #dd4b39 !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;
|
||||
}
|
||||
.bg-infoxbox-supplier_proposal,
|
||||
.bg-infoxbox-invoice_supplier,
|
||||
.bg-infoxbox-order_supplier{
|
||||
background-color: #00c0ef !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;
|
||||
}
|
||||
.bg-infoxbox-contrat{
|
||||
background-color: #00a65a !important;
|
||||
.bg-infoxbox-contrat i.fa{
|
||||
color: <?php print colorAgressivity('#20a68a', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-bank_account{
|
||||
background-color: #f39c12 !important;
|
||||
.bg-infoxbox-bank_account i.fa{
|
||||
color: <?php print colorAgressivity('#e39c42', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-adherent{
|
||||
//background-color: #f39c12 !important;
|
||||
.bg-infoxbox-adherent i.fa{
|
||||
color: <?php print colorAgressivity('#f39c12', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-expensereport{
|
||||
background-color: #a55114 !important;
|
||||
.bg-infoxbox-expensereport i.fa{
|
||||
color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
.bg-infoxbox-holiday{
|
||||
background-color: #cbd81b !important;
|
||||
.bg-infoxbox-holiday i.fa{
|
||||
color: <?php print colorAgressivity('#755114', $conf->global->THEME_AGRESSIVITY_RATIO); ?> !important;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
.fa-dol-action:before {
|
||||
content: "\f073";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user