forked from Wavyzz/dolibarr
Theme v11
This commit is contained in:
@@ -2175,83 +2175,46 @@ class Adherent extends CommonObject
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
if ($mode == 0)
|
|
||||||
|
if ($statut == -1)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
$statusType = 'status0';
|
||||||
elseif ($statut >= 1) {
|
$labelstatut = $langs->trans("MemberStatusDraft");
|
||||||
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
$labelstatutShort = $langs->trans("MemberStatusDraftShort");
|
||||||
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
|
||||||
else return $langs->trans("MemberStatusPaid");
|
|
||||||
}
|
|
||||||
elseif ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
|
||||||
}
|
}
|
||||||
elseif ($mode == 1)
|
elseif ($statut >= 1) {
|
||||||
|
if ($need_subscription == 0)
|
||||||
|
{
|
||||||
|
$statusType = 'status4';
|
||||||
|
$labelstatut = $langs->trans("MemberStatusNoSubscription");
|
||||||
|
$labelstatutShort = $langs->trans("MemberStatusNoSubscriptionShort");
|
||||||
|
}
|
||||||
|
elseif (! $date_end_subscription)
|
||||||
|
{
|
||||||
|
$statusType = 'status1';
|
||||||
|
$labelstatut = $langs->trans("MemberStatusActive");
|
||||||
|
$labelstatutShort = $langs->trans("MemberStatusActiveShort");
|
||||||
|
}
|
||||||
|
elseif ($date_end_subscription < time())
|
||||||
|
{
|
||||||
|
$statusType = 'status3';
|
||||||
|
$labelstatut = $langs->trans("MemberStatusActiveLate");
|
||||||
|
$labelstatutShort = $langs->trans("MemberStatusActiveLateShort");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$statusType = 'status4';
|
||||||
|
$labelstatut = $langs->trans("MemberStatusPaid");
|
||||||
|
$labelstatutShort = $langs->trans("MemberStatusPaidShort");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($statut == 0)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
$statusType = 'status0';
|
||||||
elseif ($statut >= 1) {
|
$labelstatut = $langs->trans("MemberStatusResiliated");
|
||||||
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
$labelstatutShort = $langs->trans("MemberStatusResiliatedShort");
|
||||||
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
|
||||||
else return $langs->trans("MemberStatusPaidShort");
|
|
||||||
}
|
|
||||||
elseif ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
|
|
||||||
}
|
|
||||||
elseif ($mode == 2)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
|
||||||
elseif ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscriptionShort");
|
|
||||||
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort");
|
|
||||||
}
|
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
|
|
||||||
}
|
|
||||||
elseif ($mode == 3)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
|
||||||
elseif ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
|
||||||
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
|
||||||
}
|
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5');
|
|
||||||
}
|
|
||||||
elseif ($mode == 4)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft");
|
|
||||||
elseif ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscription");
|
|
||||||
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive");
|
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid");
|
|
||||||
}
|
|
||||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5').' '.$langs->trans("MemberStatusResiliated");
|
|
||||||
}
|
|
||||||
elseif ($mode == 5)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusDraftShort").'</span> '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
|
||||||
elseif ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusNoSubscriptionShort").' </span>'.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
|
||||||
elseif (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
|
||||||
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
|
||||||
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
|
||||||
}
|
|
||||||
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'), 'statut5');
|
|
||||||
}
|
|
||||||
elseif ($mode == 6)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
|
||||||
if ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription").' '.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
|
||||||
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
|
||||||
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
|
||||||
}
|
|
||||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'), 'statut5');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -538,7 +538,6 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode);
|
return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2250,13 +2250,16 @@ function colorValidateHex($color, $allow_white = true)
|
|||||||
/**
|
/**
|
||||||
* Change color to make it less aggressive (ratio is negative) or more aggressive (ratio is positive)
|
* 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 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
|
* @param integer $ratio Default=-50. Note: 0=Component color is unchanged, -100=Component color become 88, +100=Component color become 00 or FF
|
||||||
|
* @param integer $brigthness Default=0. Adjust brightness. -100=Decrease brightness by 100%, +100=Increase of 100%.
|
||||||
* @return string New string of color
|
* @return string New string of color
|
||||||
* @see colorAdjustBrightness()
|
* @see colorAdjustBrightness()
|
||||||
*/
|
*/
|
||||||
function colorAgressiveness($hex, $ratio = -50)
|
function colorAgressiveness($hex, $ratio = -50, $brightness = 0)
|
||||||
{
|
{
|
||||||
|
if (empty($ratio)) $ratio = 0; // To avoid null
|
||||||
|
|
||||||
// Steps should be between -255 and 255. Negative = darker, positive = lighter
|
// Steps should be between -255 and 255. Negative = darker, positive = lighter
|
||||||
$ratio = max(-100, min(100, $ratio));
|
$ratio = max(-100, min(100, $ratio));
|
||||||
|
|
||||||
@@ -2282,7 +2285,16 @@ function colorAgressiveness($hex, $ratio = -50)
|
|||||||
if ($color > 128) $color -= (($color - 128) * (abs($ratio) / 100));
|
if ($color > 128) $color -= (($color - 128) * (abs($ratio) / 100));
|
||||||
if ($color < 127) $color += ((128 - $color) * (abs($ratio) / 100));
|
if ($color < 127) $color += ((128 - $color) * (abs($ratio) / 100));
|
||||||
}
|
}
|
||||||
$color = max(0, min(255, $color)); // Adjust color
|
if ($brightness > 0)
|
||||||
|
{
|
||||||
|
$color = ($color * (100 + abs($brightness)) / 100);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$color = ($color * (100 - abs($brightness)) / 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
$color = max(0, min(255, $color)); // Adjust color to stay into valid range
|
||||||
$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
|
$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,46 +149,56 @@ a.info-box-text{ text-decoration: none;}
|
|||||||
|
|
||||||
|
|
||||||
/* ICONS INFO BOX */
|
/* ICONS INFO BOX */
|
||||||
.info-box-icon {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
//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;
|
$prefix='';
|
||||||
|
$prefix = 'background-';
|
||||||
|
if (! empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'background-';
|
||||||
|
|
||||||
|
if (! isset($conf->global->THEME_AGRESSIVENESS_RATIO) && $prefix) $conf->global->THEME_AGRESSIVENESS_RATIO=-50;
|
||||||
if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENESS_RATIO=GETPOST('THEME_AGRESSIVENESS_RATIO', 'int');
|
if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENESS_RATIO=GETPOST('THEME_AGRESSIVENESS_RATIO', 'int');
|
||||||
|
//var_dump($conf->global->THEME_AGRESSIVENESS_RATIO);
|
||||||
?>
|
?>
|
||||||
|
.info-box-icon {
|
||||||
|
<?php if ($prefix) { ?>
|
||||||
|
color: #fff !important;
|
||||||
|
<?php } else { ?>
|
||||||
|
background-color: #eee !important;
|
||||||
|
<?php } ?>
|
||||||
|
opacity: 0.95;
|
||||||
|
}
|
||||||
|
|
||||||
.bg-infoxbox-project{
|
.bg-infoxbox-project{
|
||||||
background-color: <?php print colorAgressiveness('#6c6a98', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#6c6a98', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-action{
|
.bg-infoxbox-action{
|
||||||
background-color: <?php print colorAgressiveness('#b46080', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#b46080', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-propal,
|
.bg-infoxbox-propal,
|
||||||
.bg-infoxbox-facture,
|
.bg-infoxbox-facture,
|
||||||
.bg-infoxbox-commande{
|
.bg-infoxbox-commande{
|
||||||
background-color: <?php print colorAgressiveness('#99a17d', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#99a17d', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-supplier_proposal,
|
.bg-infoxbox-supplier_proposal,
|
||||||
.bg-infoxbox-invoice_supplier,
|
.bg-infoxbox-invoice_supplier,
|
||||||
.bg-infoxbox-order_supplier{
|
.bg-infoxbox-order_supplier{
|
||||||
background-color: <?php print colorAgressiveness('#599caf', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#599caf', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-contrat{
|
.bg-infoxbox-contrat{
|
||||||
background-color: <?php print colorAgressiveness('#469686', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#469686', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-bank_account{
|
.bg-infoxbox-bank_account{
|
||||||
background-color: <?php print colorAgressiveness('#c5903e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#c5903e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-adherent{
|
.bg-infoxbox-adherent{
|
||||||
background-color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-expensereport{
|
.bg-infoxbox-expensereport{
|
||||||
background-color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
.bg-infoxbox-holiday{
|
.bg-infoxbox-holiday{
|
||||||
background-color: <?php print colorAgressiveness('#755114', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#755114', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user