dolibarr 25.0.0-alpha
info-box.inc.php
1<?php
2/* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
3 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
4 */
5if (!defined('ISLOADEDBYSTEELSHEET')) {
6 die('Must be call by steelsheet');
7}
8
9// Expected to be defined by including parent
15'
16@phan-var-force string $right
17@phan-var-force string $left
18';
19
20$heightbox = 94;
21if (isModEnabled("bank") && isModEnabled("prelevement") && isModEnabled("paymentbybanktransfer")) {
22 $heightbox = 110;
23}
24
25?>
26/* IDE Hack <style type="text/css"> */
27
28/*
29 * Component: Info Box
30 * -------------------
31 */
32
33.info-box-module.--external span.info-box-icon-version {
34 background: rgba(0,0,0,0.2);
35}
36
37.info-box-module.--external.--need-update span.info-box-icon-version{
38 background: #bc9525;
39}
40
41.info-box {
42 display: block;
43 position: relative;
44 min-height: <?php echo $heightbox; ?>px; /* must be same height than info-box-icon */
45 background: var(--colorbacklineimpair2);
46 width: 100%;
47 <?php
48 if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2 && empty($conf->dol_optimize_smallscreen)) { ?>
49 box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
50 <?php } ?>
51 border-radius: 5px;
52 /* border: 1px solid #e9e9e9; */
53 /* border: 1px solid var(--colorbacktitle1); */
54 margin-bottom: 15px;
55}
56.info-box.info-box-sm {
57 min-height: 80px;
58 margin-bottom: 10px;
59 /* background: #fff; */
60}
61.opened-dash-board-wrap .info-box, .opened-dash-board-wrap .info-box .info-box-icon {
62 border-radius: 5px 5px 5px 15px;
63}
64/*.opened-dash-board-wrap .box-flex-item {
65 border-radius: 10px;
66}*/
67
68.info-box-more {
69 float: right;
70 top: 5px;
71 position: absolute;
72 right: 8px;
73}
74
75.info-box small {
76 font-size: 14px;
77}
78.info-box:not(.info-box-kanban) .progress {
79 background: rgba(0, 0, 0, 0.2);
80 margin: 5px -10px 5px -10px;
81 height: 2px;
82}
83.info-box .progress,
84.info-box .progress .progress-bar {
85 border-radius: 0;
86}
87
88.info-box:not(.info-box-kanban) .progress .progress-bar {
89 float: left;
90 width: 0;
91 height: 100%;
92 font-size: 12px;
93 line-height: 20px;
94 color: #fff;
95 text-align: center;
96 background-color: #337ab7;
97 box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
98 -webkit-transition: width .6s ease;
99 -o-transition: width .6s ease;
100 transition: width .6s ease;
101}
102.info-box-icon {
103 border-top-left-radius: 2px;
104 border-top-right-radius: 0;
105 border-bottom-right-radius: 0;
106 border-bottom-left-radius: 2px;
107 display: block;
108 overflow: hidden;
109 float: left;
110 line-height: <?php echo $heightbox; ?>px; /* must be same height as min-height of .info-box */
111 height: <?php echo $heightbox; ?>px; /* must be same height as min-height of .info-box */
112 width: 88px;
113 text-align: center;
114 font-size: 2.8em;
115 background: var(--colorbacktitle1) !important;
116}
117<?php if (!colorIsLight(getDolGlobalString('THEME_ELDY_BACKTITLE1'))) { ?>
118.info-box-icon i.fa, .info-box-icon i.fa:before {
119 color: #fff !important;
120}
121<?php } ?>
122
123.info-box-module .info-box-icon {
124 padding-top: 5px;
125 padding-bottom: 5px;
126}
127.info-box-sm .info-box-icon, .info-box-sm .info-box-img {
128 height: 98px !important; /* must match height of info-box-sm .info-box-content */
129 width: 78px;
130 font-size: 25px;
131 line-height: 92px;
132}
133.info-box-order {
134 border-top-left-radius: 2px;
135 border-top-right-radius: 0;
136 border-bottom-right-radius: 0;
137 border-bottom-left-radius: 2px;
138 display: block;
139 overflow: hidden;
140 float: left;
141 height: 115px;
142 width: 88px;
143 text-align: center;
144 font-size: 2.3em;
145 line-height: 115px;
146 margin-right: 10px;
147 background: var(--colorbacktitle1) !important;
148}
149.opened-dash-board-wrap .info-box .info-box-icon {
150 font-size: 2em;
151}
152.opened-dash-board-wrap .info-box-sm .info-box-icon {
153 border-radius: 0 0 0 20px;
154 line-height: 80px;
155}
156.info-box-module .info-box-icon {
157 height: 98px;
158}
159.info-box-icon > img {
160 max-width: 85%;
161}
162.info-box-module .info-box-icon > img {
163 max-width: 60%;
164}
165
166a.info-box-text.info-box-text-a {
167 /* display: table-cell; */
168 display: contents;
169}
170a.info-box-text-a i.fa.fa-exclamation-triangle, span.badge i.fa.fa-exclamation-triangle {
171 font-size: 0.9em;
172}
173
174.info-box-line {
175 line-height: 1.25em;
176}
177.info-box-line-text {
178 overflow: hidden;
179 width: calc(100% - 92px);
180 max-width: calc(100% - 82px);
181 text-overflow: ellipsis;
182}
183
184.info-box-icon-text {
185 box-sizing: border-box;
186 display: block;
187 position: absolute;
188 width: 90px;
189 bottom: 0px;
190 color: #ffffff;
191 background-color: rgba(0,0,0,0.1);
192 cursor: default;
193
194 font-size: 10px;
195 line-height: 15px;
196 padding: 0px 3px;
197 text-align: center;
198 opacity: 0;
199 -webkit-transition: opacity 0.5s, visibility 0s 0.5s;
200 transition: opacity 0.5s, visibility 0s 0.5s;
201}
202
203.info-box-icon-version {
204 box-sizing: border-box;
205 display: block;
206 position: absolute;
207 width: 90px;
208 bottom: 0px;
209 color: #ffffff;
210 background-color: rgba(0,0,0,0.1);
211 cursor: default;
212
213 font-size: 10px;
214 line-height: 1.5em;
215 padding: 4px 3px;
216 text-align: center;
217 opacity: 1;
218 -webkit-transition: opacity 0.5s, visibility 0s 0.5s;
219 transition: opacity 0.5s, visibility 0s 0.5s;
220}
221
222.box-flex-item.info-box-module.--disabled {
223 /* opacity: 0.6; */
224}
225
226.info-box-actions {
227 position: absolute;
228 right: 0;
229 bottom: 0;
230}
231
232/* customize section img box on list of products */
233.info-box-img {
234 height: 105px !important;
235 width: 88px;
236 border-top-left-radius: 2px;
237 border-top-right-radius: 0;
238 border-bottom-right-radius: 0;
239 border-bottom-left-radius: 2px;
240 display: block;
241 overflow: hidden;
242 float: left;
243 text-align: center;
244 font-size: 2.8em;
245 line-height: 90px;
246 margin-right: 5px;
247 background: var(--colorbacktitle1) !important;
248}
249.info-box-img > img {
250 width: 90%;
251 position: relative;
252 top: 50%;
253 left: 50%;
254 transform: translate(-50%, -50%);
255}
256
257<?php if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_BOXSTATS') && getDolGlobalString('MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD')) { ?>
258.info-box-icon-text{
259 opacity: 1;
260}
261<?php } ?>
262
263.info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version {
264 overflow: hidden;
265 width: 80px;
266}
267.info-box:hover .info-box-icon-text {
268 opacity: 1;
269}
270
271.info-box-content {
272 padding-top: 5px;
273 padding-bottom: 5px;
274 padding-<?php echo $left; ?>: 14px;
275 padding-<?php echo $right; ?>: 5px;
276 margin-left: 84px;
277}
278.info-box-sm .info-box-content {
279 margin-left: 80px;
280 height: 88px; /* 96 - margins of .info-box-sm .info-box-content */
281 border-top-right-radius: 6px;
282}
283.info-box-sm .info-box-module-enabled {
284 /* background: linear-gradient(0.35turn, #fff, #fff, #f6faf8, #e4efe8) */
285 /* background: var(--infoboxmoduleenabledbgcolor); */
286}
287.info-box-content-warning span.font-status4 {
288 color: #bc9526 !important;
289}
290
291.info-box-number {
292 display: block;
293 font-weight: bold;
294 font-size: 18px;
295}
296.progress-description,
297.info-box-text,
298.info-box-title {
299 display: block;
300 font-size: 12px;
301 white-space: nowrap;
302 overflow: hidden;
303 text-overflow: ellipsis;
304}
305.info-box-title {
306 text-transform: uppercase;
307 /* font-weight: bold; */
308 margin-bottom: 6px; /* not too much space so we can add another lines */
309 opacity: 0.5;
310 /* color: var(--colortexttitlenotab); */
311}
312.info-box-text {
313 font-size: 0.92em;
314}
315.info-box-desc {
316 font-size: 0.91em;
317 line-height: 1.3em;
318}
319
320/* Force values for small screen 480 */
321@media only screen and (max-width: 480px)
322{
323 .info-box-text {
324 font-size: 0.85em;
325 }
326 .info-box-line {
327 line-height: 1.25em;
328 }
329}
330.info-box-text:first-letter{text-transform: uppercase}
331a.info-box-text{ text-decoration: none;}
332
333
334.info-box-more {
335 display: block;
336}
337.progress-description {
338 margin: 0;
339}
340
341
342/* customize section for home box link */
343.infobox-haslink .info-box-icon i {
344 transition: opacity 0.2s ease-in-out;
345}
346.infobox-haslink .info-box-icon:hover i {
347 opacity: 0.2;
348}
349.infobox-haslink .info-box-icon .info-box-createlink {
350 height:100%;
351 width:100%;
352 display:block;
353 position:absolute;
354 top:0;
355 left:0;
356 font-size:0.6em;
357 display: flex;
358 opacity: 0;
359 transition: opacity 0.2s ease-in-out;
360 color:inherit;
361 text-decoration: none;
362}
363.infobox-haslink .info-box-icon:hover .info-box-createlink {
364 opacity: 1;
365}
366.infobox-haslink .info-box-icon .info-box-createlink span.fas {
367 margin:auto;
368}
369.infobox-haslink i.fa.fa-exclamation-triangle.hideonsmartphone {
370 display: none;
371}
372
373
374/* ICONS INFO BOX */
375<?php
376include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
377
378$prefix = '';
379if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) {
380 $prefix = 'background-';
381}
382
383if (!isset($conf->global->THEME_SATURATE_RATIO)) {
384 $conf->global->THEME_SATURATE_RATIO = 0.8;
385}
386if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
387 $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO');
388}
389
390?>
391.info-box-icon {
392 <?php if ($prefix) { ?>
393 color: #fff !important;
394 <?php } ?>
395 opacity: 0.95;
396 <?php if (getDolGlobalString('THEME_SATURATE_RATIO')) { ?>
397 filter: saturate(<?php echo getDolGlobalString('THEME_SATURATE_RATIO'); ?>);
398 <?php } ?>
399}
400
401.spannature {
402 line-height: 30px;
403/*
404 padding-top: 6px !important;
405 padding-bottom: 6px !important;
406 vertical-align: middle;
407 white-space: nowrap;
408 display: inline-block;
409*/
410}
411
412.nonature-back {
413 background-color: var(--colorwhitelight);
414}
415.prospect-back {
416 background-color: #a3c0ad !important;
417 color: #FFF !important;
418}
419.customer-back {
420 background-color: #55955d !important;
421 color: #FFF !important;
422}
423.vendor-back {
424 background-color: #499caf !important;
425 color: #FFF !important;
426}
427.user-back {
428 background-color: #79633f !important;
429 color: #FFF !important;
430}
431.member-individual-back {
432 background-color: #258fa5;
433 color: #fff;
434 white-space: nowrap;
435}
436.member-company-back {
437 background-color: #557b95;
438 color: #fff;
439 white-space: nowrap;
440}
441.member-individual-company-back {
442 background-color: #40859d;
443 color: #fff;
444 white-space: nowrap;
445}
446.nonature-back, .prospect-back, .customer-back, .vendor-back, .user-back, .member-company-back, .member-individual-company-back, .member-individual-back {
447 padding: 2px;
448 margin: 2px;
449 border-radius: 5px;
450}
451
452.bg-infobox-project{
453 <?php echo $prefix; ?>color: #6c6aa8 !important;
454}
455.bg-infobox-action{
456 <?php echo $prefix; ?>color: #906080 !important;
457}
458.bg-infobox-propal, .bg-infobox-facture, .bg-infobox-commande {
459 <?php echo $prefix; ?>color: #65953d !important;
460}
461.bg-infobox-supplier_proposal, .bg-infobox-invoice_supplier, .bg-infobox-order_supplier {
462 <?php echo $prefix; ?>color: #599caf !important;
463}
464.bg-infobox-contrat, .bg-infobox-ticket{
465 <?php echo $prefix; ?>color: #3bbfa8 !important;
466}
467.bg-infobox-bank_account{
468 <?php echo $prefix; ?>color: #b0bb39 !important;
469}
470.bg-infobox-adherent, .bg-infobox-member {
471 <?php echo $prefix; ?>color: #79633f !important;
472}
473.bg-infobox-expensereport{
474 <?php echo $prefix; ?>color: #79633f !important;
475}
476.bg-infobox-holiday{
477 <?php echo $prefix; ?>color: #755114 !important;
478}
479.bg-infobox-cubes{
480 <?php echo $prefix; ?>color: #b0a53e !important;
481}
482
483/* Disable colors on left vmenu */
484a.vmenu span, span.vmenu, span.vmenu span {
485 /* To force no color on picto in left menu */
486 /* color: var(--colortextbackvmenu) !important; */
487}
488
489.infobox-adherent, .infobox-member, .infobox-expensereport {
490 color: #79633f;
491}
492.infobox-project{
493 color: #6c6aa8;
494}
495.infobox-action{
496 color: #906080;
497}
498/* Color for customer object */
499.infobox-propal:not(.error),
500.infobox-facture:not(.error),
501.infobox-commande:not(.error) {
502 color: #65953d;
503}
504/* Color for vendor object */
505.infobox-supplier_proposal:not(.error),
506.infobox-invoice_supplier:not(.error),
507.infobox-order_supplier:not(.error) {
508 color: #599caf;
509}
510.infobox-contrat, .infobox-ticket{
511 color: #3bbfa8;
512}
513.infobox-bank_account{
514 color: #b0bb39;
515}
516.infobox-holiday{
517 color: #755114;
518}
519.infobox-portal {
520 color: #304;
521}
522
523
524.fa-dol-action:before {
525 content: "\f073";
526}
527.fa-dol-propal:before,
528.fa-dol-supplier_proposal:before {
529 content: "\f573";
530}
531.fa-dol-facture:before,
532.fa-dol-invoice_supplier:before {
533 content: "\f571";
534}
535.fa-dol-project:before {
536 content: "\f542";
537}
538.fa-dol-commande:before,
539.fa-dol-order_supplier:before {
540 content: "\f570";
541}
542.fa-dol-contrat:before {
543 content: "\f0f2";
544}
545.fa-dol-ticket:before {
546 content: "\f3ff";
547}
548.fa-dol-bank_account:before {
549 content: "\f19c";
550}
551.fa-dol-member:before {
552 content: "\f007";
553}
554.fa-dol-expensereport:before {
555 content: "\f555";
556}
557.fa-dol-holiday:before {
558 content: "\f5ca";
559}
560.fa-dol-cubes:before {
561 content: "\f1b3";
562}
563
564
565/* USING FONTAWESOME FOR WEATHER */
566.info-box-weather .info-box-icon{
567 background: var(--colorbacktitle1) !important;
568}
569.fa-weather-level0:before{
570 content: "\f185";
571 color : #cfbf00;
572}
573.fa-weather-level1:before{
574 content: "\f6c4";
575 color : #bc9526;
576}
577.fa-weather-level2:before{
578 content: "\f743";
579 color : #b16000;
580}
581.fa-weather-level3:before{
582 content: "\f740";
583 color : #b04000;
584}
585.fa-weather-level4:before{
586 content: "\f0e7";
587 color : #993013;
588}
589
590
591.box-flex-container{
592 display: flex; /* or inline-flex */
593 flex-direction: row;
594 flex-wrap: wrap;
595 width: calc(100% + 14px);
596 margin: 0 -8px 0 -8px;
597 /*justify-content: space-between;*/
598}
599.box-flex-container-columns {
600 display: flex; /* or inline-flex */
601 flex-direction: row;
602 flex-wrap: nowrap;
603 justify-content: space-between;
604}
605.box-flex-container-column {
606 flex-grow: 1;
607 }
608.box-flex-container-column:not(:last-of-type) {
609 border-right: 1px solid #AAA;
610}
611.box-flex-container-column.kanban {
612 flex: 1;
613}
614.kanban.kanbancollapsed {
615 flex: unset;
616 width: 80px;
617 max-width: 80px;
618 overflow: hidden;
619}
620.kanban.kanbancollapsed .kanbanlabel, .text-vertical {
621 writing-mode: vertical-rl;
622}
623
624.box-flex-grow-zero {
625 flex-grow: 0 !important;
626}
627
628.box-flex-item {
629 flex-grow : 1;
630 flex-shrink: 1;
631 flex-basis: auto;
632 width: 290px;
633}
634.box-flex-item.filler {
635 height: 0;
636}
637.box-flex-item, .kanbanlabel {
638 margin-top: 5px;
639 margin-<?php echo $right; ?>: 20px;
640 margin-bottom: 0px;
641 margin-<?php echo $left; ?>: 10px;
642}
643.kanbanlabel {
644 background: var(--colorbacktitle1);
645 padding: 5px;
646 margin-bottom: 10px;
647 border-radius: 5px;
648}
649.kanban .box-flex-item {
650 line-height: 1.4em;
651}
652.kanban .box-flex-item-5lines {
653 line-height: 1.2em;
654}
655
656/* css for small kanban */
657.box-flex-item-small {
658 width: 200px !important;
659}
660.box-flex-item-small .info-box-sm .info-box-content {
661 margin-left: 0;
662}
663.box-flex-item-small .info-box-icon.bg-infobox-action {
664 display: none;
665}
666
667
668.info-box-title {
669 width: calc(100% - 20px);
670}
671.info-box-module {
672 min-width: 350px;
673 max-width: 350px;
674}
675.fright {
676 float:right;
677}
678@media only screen and (max-width: 1740px) {
679 .info-box-module {
680 min-width: 315px;
681 max-width: 315px;
682 }
683}
684
685@media only screen and (max-width: 768px) {
686 .info-box-module {
687 min-width: 260px;
688 }
689 .box-flex-item {
690 width: 280px;
691 }
692}
693
694@media only screen and (max-width: 570px)
695{
696 .box-flex-item {
697 margin: 3px 8px 3px 8px !important;
698 }
699}
700
701@media only screen and (max-width: 480px) {
702 .info-box-module {
703 min-width: 250px;
704 }
705 .box-flex-item {
706 width: 250px;
707 }
708}
709
710
711
712.info-box-module .info-box-content {
713 height: 98px;
714}
715/* Disabled. This break the responsive on smartphone
716.box{
717 overflow: visible;
718}
719*/
720
721@media only screen and (max-width: 768px)
722{
723 .box-flex-container {
724 margin: 0 0 0 0px !important;
725 width: 100% !important;
726 /* justify-content: space-between; */
727 }
728 .info-box-module {
729 width: 100%;
730 max-width: unset;
731 }
732
733 .info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version {
734 width: 60px;
735 }
736 .info-box-sm .info-box-icon {
737 width: 60px;
738 }
739 .info-box-sm .info-box-content {
740 margin-left: 60px;
741 }
742 .info-box {
743 border: 1px solid #e0e0e0;
744 }
745
746 .info-box-content {
747 padding-top: 5px;
748 padding-bottom: 5px;
749 padding-left: 10px;
750 padding-right: 2px;
751 }
752 /*
753 .info-box-line-text {
754 width: calc(100% - 98px);
755 max-width: calc(100% - 88px);
756 }
757 */
758}
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition propal.php:281
print $object position
Definition edit.php:206
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
colorIsLight($stringcolor)
Return true if the color is light.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
$conf browser version
Definition main.inc.php:229
a disabled