Optimize space

This commit is contained in:
Laurent Destailleur 2017-03-10 16:26:43 +01:00
parent 57c2971175
commit 618c27d63c
2 changed files with 27 additions and 11 deletions

View File

@ -1353,7 +1353,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event
print '<li class="cal_event" style="'.$h.'">'; print '<li class="cal_event" style="'.$h.'">';
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h; print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -3).'));';
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
print ' -moz-border-radius:4px;" width="100%"><tr>'; print ' -moz-border-radius:4px;" width="100%"><tr>';
@ -1413,7 +1413,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{ {
$savlabel=$event->libelle; $savlabel=$event->libelle;
$event->libelle=$daterange; $event->libelle=$daterange;
//print '<strong>';
print $event->getNomUrl(0); print $event->getNomUrl(0);
//print '</strong>';
$event->libelle=$savlabel; $event->libelle=$savlabel;
} }
else else
@ -1421,7 +1423,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print $daterange; print $daterange;
} }
//print '</strong> '; //print '</strong> ';
print "<br>\n"; print " ";
} }
else else
{ {
@ -1535,14 +1537,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
* Change color with a delta * Change color with a delta
* *
* @param string $color Color * @param string $color Color
* @param int $minus Delta * @param int $minus Delta (1 = 16 unit)
* @param int $minusunit Minus unit
* @return string New color * @return string New color
*/ */
function dol_color_minus($color, $minus) function dol_color_minus($color, $minus, $minusunit = 16)
{ {
$newcolor=$color; $newcolor=$color;
$newcolor[0]=((hexdec($newcolor[0])-$minus)<0)?0:dechex((hexdec($newcolor[0])-$minus)); if ($minusunit == 16)
$newcolor[2]=((hexdec($newcolor[2])-$minus)<0)?0:dechex((hexdec($newcolor[2])-$minus)); {
$newcolor[4]=((hexdec($newcolor[4])-$minus)<0)?0:dechex((hexdec($newcolor[4])-$minus)); $newcolor[0]=dechex(max(min(hexdec($newcolor[0])-$minus, 15), 0));
$newcolor[2]=dechex(max(min(hexdec($newcolor[2])-$minus, 15), 0));
$newcolor[4]=dechex(max(min(hexdec($newcolor[4])-$minus, 15), 0));
}
else
{
// Not yet implemented
}
return $newcolor; return $newcolor;
} }

View File

@ -1047,9 +1047,15 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
} }
} }
} }
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>'; if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); if ($object->element == 'societe')
{
if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE))
{
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
}
} }
elseif ($object->element == 'product') elseif ($object->element == 'product')
{ {
@ -1099,7 +1105,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ($object->element == 'product' || $object->element == 'bank_account') if ($object->element == 'product' || $object->element == 'bank_account')
{ {
if(! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>'; if (! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>';
} }
if ($object->element != 'product' && $object->element != 'bookmark') if ($object->element != 'product' && $object->element != 'bookmark')