forked from Wavyzz/dolibarr
Debug method MAIN_STATUS_USES_CSS
This commit is contained in:
@@ -8094,7 +8094,7 @@ function roundUpToNextMultiple($n, $x = 5)
|
|||||||
function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '', $params = array())
|
function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '', $params = array())
|
||||||
{
|
{
|
||||||
$attr=array(
|
$attr=array(
|
||||||
'class'=>'badge'.(!empty($mode)?' badge-'.$mode:'').(!empty($type)?' badge-'.$type:'')
|
'class'=>'badge badge-status'.(!empty($mode)?' badge-'.$mode:'').(!empty($type)?' badge-'.$type:'')
|
||||||
);
|
);
|
||||||
|
|
||||||
if(empty($html)){
|
if(empty($html)){
|
||||||
@@ -8155,26 +8155,12 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$return = '';
|
$return = '';
|
||||||
|
|
||||||
$dolGetBadgeParams = array();
|
$dolGetBadgeParams = array();
|
||||||
if(!empty($params['badgeParams'])){
|
|
||||||
|
if (!empty($params['badgeParams'])){
|
||||||
$dolGetBadgeParams = $params['badgeParams'];
|
$dolGetBadgeParams = $params['badgeParams'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// image's filename are still in French
|
|
||||||
$statusImg=array(
|
|
||||||
'status0' => 'statut0'
|
|
||||||
,'status1' => 'statut1'
|
|
||||||
,'status2' => 'statut2'
|
|
||||||
,'status3' => 'statut3'
|
|
||||||
,'status4' => 'statut4'
|
|
||||||
,'status5' => 'statut5'
|
|
||||||
,'status6' => 'statut6'
|
|
||||||
,'status7' => 'statut7'
|
|
||||||
,'status8' => 'statut8'
|
|
||||||
,'status9' => 'statut9'
|
|
||||||
);
|
|
||||||
|
|
||||||
// TODO : add a hook
|
// TODO : add a hook
|
||||||
|
|
||||||
if ($displayMode == 0) {
|
if ($displayMode == 0) {
|
||||||
@@ -8184,12 +8170,34 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
$return = !empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel);
|
$return = !empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel);
|
||||||
}
|
}
|
||||||
// use status with images
|
// use status with images
|
||||||
elseif (empty($conf->global->MAIN_STATUS_USES_CSS)){
|
elseif (empty($conf->global->MAIN_STATUS_USES_CSS)) {
|
||||||
$return = '';
|
$return = '';
|
||||||
$htmlLabel = (in_array($displayMode, array(1,2,5))?'<span class="hideonsmartphone">':'').(!empty($html)?$html:$statusLabel).(in_array($displayMode, array(1,2,5))?'</span>':'');
|
$htmlLabel = (in_array($displayMode, array(1,2,5))?'<span class="hideonsmartphone">':'').(!empty($html)?$html:$statusLabel).(in_array($displayMode, array(1,2,5))?'</span>':'');
|
||||||
$htmlLabelShort = (in_array($displayMode, array(1,2,5))?'<span class="hideonsmartphone">':'').(!empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel)).(in_array($displayMode, array(1,2,5))?'</span>':'');
|
$htmlLabelShort = (in_array($displayMode, array(1,2,5))?'<span class="hideonsmartphone">':'').(!empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel)).(in_array($displayMode, array(1,2,5))?'</span>':'');
|
||||||
|
|
||||||
if(!empty($statusImg[$statusType])){
|
// For small screen, we use the short label instead of long label.
|
||||||
|
if (! empty($conf->dol_optimize_smallscreen))
|
||||||
|
{
|
||||||
|
if ($displayMode == 0) $displayMode = 1;
|
||||||
|
elseif ($displayMode == 4) $displayMode = 2;
|
||||||
|
elseif ($displayMode == 6) $displayMode = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// image's filename are still in French, so we use this array to convert
|
||||||
|
$statusImg=array(
|
||||||
|
'status0' => 'statut0'
|
||||||
|
,'status1' => 'statut1'
|
||||||
|
,'status2' => 'statut2'
|
||||||
|
,'status3' => 'statut3'
|
||||||
|
,'status4' => 'statut4'
|
||||||
|
,'status5' => 'statut5'
|
||||||
|
,'status6' => 'statut6'
|
||||||
|
,'status7' => 'statut7'
|
||||||
|
,'status8' => 'statut8'
|
||||||
|
,'status9' => 'statut9'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!empty($statusImg[$statusType])){
|
||||||
$htmlImg = img_picto($statusLabel, $statusImg[$statusType]);
|
$htmlImg = img_picto($statusLabel, $statusImg[$statusType]);
|
||||||
}else{
|
}else{
|
||||||
$htmlImg = img_picto($statusLabel, $statusType);
|
$htmlImg = img_picto($statusLabel, $statusType);
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.badge-status {
|
||||||
|
font-size: 1em;
|
||||||
|
padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */
|
||||||
|
}
|
||||||
|
|
||||||
.badge-pill, .tabs .badge {
|
.badge-pill, .tabs .badge {
|
||||||
padding-right: .5em;
|
padding-right: .5em;
|
||||||
padding-left: .5em;
|
padding-left: .5em;
|
||||||
@@ -31,7 +36,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
|||||||
.badge-dot {
|
.badge-dot {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
padding: 0.25rem;
|
padding: 0.45em;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,9 +173,10 @@ a.badge-dark:focus, a.badge-dark:hover {
|
|||||||
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* STATUS BADGES
|
* STATUS BADGES
|
||||||
*/
|
*/
|
||||||
<?php for ($i = 0; $i <= 9; $i++){
|
<?php for ($i = 0; $i <= 9; $i++){
|
||||||
/* Default Status */
|
/* Default Status */
|
||||||
_createStatusBadgeCss($i, '', "STATUS".$i);
|
_createStatusBadgeCss($i, '', "STATUS".$i);
|
||||||
@@ -180,7 +186,8 @@ a.badge-dark:focus, a.badge-dark:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create status badge
|
* Create status badge
|
||||||
|
*
|
||||||
* @param string $statusName name of status
|
* @param string $statusName name of status
|
||||||
* @param string $statusVarNamePrefix a prefix for var ${$statusVarNamePrefix.'badgeStatus'.$statusName}
|
* @param string $statusVarNamePrefix a prefix for var ${$statusVarNamePrefix.'badgeStatus'.$statusName}
|
||||||
* @param string $commentLabel a comment label
|
* @param string $commentLabel a comment label
|
||||||
@@ -200,7 +207,6 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL
|
|||||||
$TBadgeBorderOnly = array(0, 3, 5, 7);
|
$TBadgeBorderOnly = array(0, 3, 5, 7);
|
||||||
$thisBadgeTextColor = colorIsLight(${$statusVarNamePrefix . 'badgeStatus' . $statusName}) ? '#212529' : '#ffffff';
|
$thisBadgeTextColor = colorIsLight(${$statusVarNamePrefix . 'badgeStatus' . $statusName}) ? '#212529' : '#ffffff';
|
||||||
|
|
||||||
|
|
||||||
if (!empty(${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName})) {
|
if (!empty(${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName})) {
|
||||||
$thisBadgeTextColor = ${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName};
|
$thisBadgeTextColor = ${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName};
|
||||||
}
|
}
|
||||||
@@ -210,6 +216,9 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL
|
|||||||
$thisBadgeBackgroundColor = "#fff";
|
$thisBadgeBackgroundColor = "#fff";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array($statusName, array(0, 5, 9))) $thisBadgeTextColor = '#999999';
|
||||||
|
if (in_array($statusName, array(6))) $thisBadgeTextColor = '#777777';
|
||||||
|
|
||||||
print $cssPrefix . ".badge-status" . $statusName . " {\n";
|
print $cssPrefix . ".badge-status" . $statusName . " {\n";
|
||||||
print " color: " . $thisBadgeTextColor . " !important;\n";
|
print " color: " . $thisBadgeTextColor . " !important;\n";
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,11 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
|||||||
border-color: rgba(255,255,255,0);
|
border-color: rgba(255,255,255,0);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
/* Themes for badges */
|
|
||||||
|
.badge-status {
|
||||||
|
font-size: 1em;
|
||||||
|
padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */
|
||||||
|
}
|
||||||
|
|
||||||
.badge-pill, .tabs .badge {
|
.badge-pill, .tabs .badge {
|
||||||
padding-right: .5em;
|
padding-right: .5em;
|
||||||
@@ -158,46 +162,74 @@ a.badge-dark:focus, a.badge-dark:hover {
|
|||||||
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* STATUS BADGES
|
* STATUS BADGES
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Default Status */
|
|
||||||
|
|
||||||
<?php for ($i = 0; $i <= 9; $i++){
|
<?php for ($i = 0; $i <= 9; $i++){
|
||||||
print "\n/* STATUS".$i." */\n";
|
/* Default Status */
|
||||||
|
_createStatusBadgeCss($i, '', "STATUS".$i);
|
||||||
|
|
||||||
$thisBadgeBackgroundColor = $thisBadgeBorderColor = ${'badgeStatus'.$i};
|
// create status for accessibility
|
||||||
|
_createStatusBadgeCss($i, 'colorblind_deuteranopes_', "COLORBLIND STATUS".$i, 'body[class*="colorblind-"] ');
|
||||||
|
}
|
||||||
$TBadgeBorderOnly = array(0,3,5,7);
|
|
||||||
$thisBadgeTextColor = colorIsLight(${'badgeStatus'.$i})?'#212529':'#ffffff';
|
/**
|
||||||
if(in_array($i, $TBadgeBorderOnly)){
|
* Create status badge
|
||||||
$thisBadgeTextColor = '#212529';
|
*
|
||||||
$thisBadgeBackgroundColor = "#fff";
|
* @param string $statusName name of status
|
||||||
}
|
* @param string $statusVarNamePrefix a prefix for var ${$statusVarNamePrefix.'badgeStatus'.$statusName}
|
||||||
|
* @param string $commentLabel a comment label
|
||||||
print ".badge-status".$i." {\n";
|
* @param string $cssPrefix a css prefix
|
||||||
print " color: ".$thisBadgeTextColor." !important;\n";
|
* @return void
|
||||||
|
*/
|
||||||
if(in_array($i, $TBadgeBorderOnly)){
|
function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentLabel = '', $cssPrefix = '')
|
||||||
print " border-color: ".$thisBadgeBorderColor.";\n";
|
{
|
||||||
}
|
|
||||||
|
global ${$statusVarNamePrefix.'badgeStatus'.$statusName}, ${$statusVarNamePrefix.'badgeStatus_textColor'.$statusName};
|
||||||
print " background-color: ".$thisBadgeBackgroundColor.";\n";
|
|
||||||
print "}\n";
|
if(!empty(${$statusVarNamePrefix.'badgeStatus'.$statusName})) {
|
||||||
|
print "\n/* " . strtoupper($commentLabel) . " */\n";
|
||||||
print ".badge-status".$i.".focus, .badge-status".$i.":focus {\n";
|
$thisBadgeBackgroundColor = $thisBadgeBorderColor = ${$statusVarNamePrefix . 'badgeStatus' . $statusName};
|
||||||
print " outline: 0;\n";
|
|
||||||
print " box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).";\n";
|
|
||||||
print "}\n";
|
$TBadgeBorderOnly = array(0, 3, 5, 7);
|
||||||
|
$thisBadgeTextColor = colorIsLight(${$statusVarNamePrefix . 'badgeStatus' . $statusName}) ? '#212529' : '#ffffff';
|
||||||
print ".badge-status".$i.":focus, .badge-status".$i.":hover {\n";
|
|
||||||
print " color: ".$thisBadgeTextColor." !important;\n";
|
if (!empty(${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName})) {
|
||||||
print " background-color: ".colorDarker($thisBadgeBackgroundColor, 10).";\n";
|
$thisBadgeTextColor = ${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName};
|
||||||
if(in_array($i, $TBadgeBorderOnly)){
|
}
|
||||||
print " border-color: ".colorDarker($thisBadgeBorderColor, 10).";\n";
|
|
||||||
}
|
if (in_array($statusName, $TBadgeBorderOnly)) {
|
||||||
print "}\n";
|
$thisBadgeTextColor = '#212529';
|
||||||
|
$thisBadgeBackgroundColor = "#fff";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($statusName, array(0, 5, 9))) $thisBadgeTextColor = '#999999';
|
||||||
|
if (in_array($statusName, array(6))) $thisBadgeTextColor = '#777777';
|
||||||
|
|
||||||
|
print $cssPrefix . ".badge-status" . $statusName . " {\n";
|
||||||
|
print " color: " . $thisBadgeTextColor . " !important;\n";
|
||||||
|
|
||||||
|
if (in_array($statusName, $TBadgeBorderOnly)) {
|
||||||
|
print " border-color: " . $thisBadgeBorderColor . ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print " background-color: " . $thisBadgeBackgroundColor . ";\n";
|
||||||
|
print "}\n";
|
||||||
|
|
||||||
|
print $cssPrefix . ".badge-status" . $statusName . ".focus, " . $cssPrefix . ".badge-status" . $statusName . ":focus {\n";
|
||||||
|
print " outline: 0;\n";
|
||||||
|
print " box-shadow: 0 0 0 0.2rem " . colorHexToRgb($thisBadgeBackgroundColor, 0.5) . ";\n";
|
||||||
|
print "}\n";
|
||||||
|
|
||||||
|
print $cssPrefix . ".badge-status" . $statusName . ":focus, " . $cssPrefix . ".badge-status" . $statusName . ":hover {\n";
|
||||||
|
print " color: " . $thisBadgeTextColor . " !important;\n";
|
||||||
|
print " background-color: " . colorDarker($thisBadgeBackgroundColor, 10) . ";\n";
|
||||||
|
if (in_array($statusName, $TBadgeBorderOnly)) {
|
||||||
|
print " border-color: " . colorDarker($thisBadgeBorderColor, 10) . ";\n";
|
||||||
|
}
|
||||||
|
print "}\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1506,7 +1506,8 @@ table.noborder tr.liste_titre td {
|
|||||||
padding-<?php echo $left; ?>: 3px;
|
padding-<?php echo $left; ?>: 3px;
|
||||||
}
|
}
|
||||||
.pictowarning {
|
.pictowarning {
|
||||||
vertical-align: text-bottom;
|
/* vertical-align: text-bottom; */
|
||||||
|
color: #9f4705;
|
||||||
}
|
}
|
||||||
.pictomodule {
|
.pictomodule {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
|
|||||||
Reference in New Issue
Block a user