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/*
403 padding-top: 6px !important;
404 padding-bottom: 6px !important;
405 vertical-align: middle;
406 white-space: nowrap;
407 display: inline-block;
408*/
409}
410
411.nonature-back {
412 background-color: var(--colorwhitelight);
413}
414.prospect-back {
415 background-color: #a3c0ad !important;
416 color: #FFF !important;
417}
418.customer-back {
419 background-color: #55955d !important;
420 color: #FFF !important;
421}
422.vendor-back {
423 background-color: #499caf !important;
424 color: #FFF !important;
425}
426.user-back {
427 background-color: #79633f !important;
428 color: #FFF !important;
429}
430.member-individual-back {
431 background-color: #258fa5;
432 color: #fff;
433 white-space: nowrap;
434}
435.member-company-back {
436 background-color: #557b95;
437 color: #fff;
438 white-space: nowrap;
439}
440.member-individual-company-back {
441 background-color: #40859d;
442 color: #fff;
443 white-space: nowrap;
444}
445.nonature-back, .prospect-back, .customer-back, .vendor-back, .user-back, .member-company-back, .member-individual-company-back, .member-individual-back {
446 padding: 2px;
447 margin: 2px;
448 border-radius: 5px;
449}
450
451.bg-infobox-project{
452 <?php echo $prefix; ?>color: #6c6aa8 !important;
453}
454.bg-infobox-action{
455 <?php echo $prefix; ?>color: #906080 !important;
456}
457.bg-infobox-propal, .bg-infobox-facture, .bg-infobox-commande {
458 <?php echo $prefix; ?>color: #65953d !important;
459}
460.bg-infobox-supplier_proposal, .bg-infobox-invoice_supplier, .bg-infobox-order_supplier {
461 <?php echo $prefix; ?>color: #599caf !important;
462}
463.bg-infobox-contrat, .bg-infobox-ticket{
464 <?php echo $prefix; ?>color: #3bbfa8 !important;
465}
466.bg-infobox-bank_account{
467 <?php echo $prefix; ?>color: #b0bb39 !important;
468}
469.bg-infobox-adherent, .bg-infobox-member {
470 <?php echo $prefix; ?>color: #79633f !important;
471}
472.bg-infobox-expensereport{
473 <?php echo $prefix; ?>color: #79633f !important;
474}
475.bg-infobox-holiday{
476 <?php echo $prefix; ?>color: #755114 !important;
477}
478.bg-infobox-cubes{
479 <?php echo $prefix; ?>color: #b0a53e !important;
480}
481
482/* Disable colors on left vmenu */
483a.vmenu span, span.vmenu, span.vmenu span {
484 /* To force no color on picto in left menu */
485 /* color: var(--colortextbackvmenu) !important; */
486}
487
488.infobox-adherent, .infobox-member, .infobox-expensereport {
489 color: #79633f;
490}
491.infobox-project{
492 color: #6c6aa8;
493}
494.infobox-action{
495 color: #906080;
496}
497/* Color for customer object */
498.infobox-propal:not(.error),
499.infobox-facture:not(.error),
500.infobox-commande:not(.error) {
501 color: #65953d;
502}
503/* Color for vendor object */
504.infobox-supplier_proposal:not(.error),
505.infobox-invoice_supplier:not(.error),
506.infobox-order_supplier:not(.error) {
507 color: #599caf;
508}
509.infobox-contrat, .infobox-ticket{
510 color: #3bbfa8;
511}
512.infobox-bank_account{
513 color: #b0bb39;
514}
515.infobox-holiday{
516 color: #755114;
517}
518.infobox-portal {
519 color: #304;
520}
521
522
523.fa-dol-action:before {
524 content: "\f073";
525}
526.fa-dol-propal:before,
527.fa-dol-supplier_proposal:before {
528 content: "\f573";
529}
530.fa-dol-facture:before,
531.fa-dol-invoice_supplier:before {
532 content: "\f571";
533}
534.fa-dol-project:before {
535 content: "\f542";
536}
537.fa-dol-commande:before,
538.fa-dol-order_supplier:before {
539 content: "\f570";
540}
541.fa-dol-contrat:before {
542 content: "\f0f2";
543}
544.fa-dol-ticket:before {
545 content: "\f3ff";
546}
547.fa-dol-bank_account:before {
548 content: "\f19c";
549}
550.fa-dol-member:before {
551 content: "\f007";
552}
553.fa-dol-expensereport:before {
554 content: "\f555";
555}
556.fa-dol-holiday:before {
557 content: "\f5ca";
558}
559.fa-dol-cubes:before {
560 content: "\f1b3";
561}
562
563
564/* USING FONTAWESOME FOR WEATHER */
565.info-box-weather .info-box-icon{
566 background: var(--colorbacktitle1) !important;
567}
568.fa-weather-level0:before{
569 content: "\f185";
570 color : #cfbf00;
571}
572.fa-weather-level1:before{
573 content: "\f6c4";
574 color : #bc9526;
575}
576.fa-weather-level2:before{
577 content: "\f743";
578 color : #b16000;
579}
580.fa-weather-level3:before{
581 content: "\f740";
582 color : #b04000;
583}
584.fa-weather-level4:before{
585 content: "\f0e7";
586 color : #993013;
587}
588
589
590.box-flex-container{
591 display: flex; /* or inline-flex */
592 flex-direction: row;
593 flex-wrap: wrap;
594 width: calc(100% + 14px);
595 margin: 0 -8px 0 -8px;
596 /*justify-content: space-between;*/
597}
598.box-flex-container-columns {
599 display: flex; /* or inline-flex */
600 flex-direction: row;
601 flex-wrap: nowrap;
602 justify-content: space-between;
603}
604.box-flex-container-column {
605 flex-grow: 1;
606 }
607.box-flex-container-column:not(:last-of-type) {
608 border-right: 1px solid #AAA;
609}
610.box-flex-container-column.kanban {
611 flex: 1;
612}
613.kanban.kanbancollapsed {
614 flex: unset;
615 width: 80px;
616 max-width: 80px;
617 overflow: hidden;
618}
619.kanban.kanbancollapsed .kanbanlabel, .text-vertical {
620 writing-mode: vertical-rl;
621}
622
623.box-flex-grow-zero {
624 flex-grow: 0 !important;
625}
626
627.box-flex-item {
628 flex-grow : 1;
629 flex-shrink: 1;
630 flex-basis: auto;
631 width: 290px;
632}
633.box-flex-item.filler {
634 height: 0;
635}
636.box-flex-item, .kanbanlabel {
637 margin-top: 5px;
638 margin-<?php echo $right; ?>: 20px;
639 margin-bottom: 0px;
640 margin-<?php echo $left; ?>: 10px;
641}
642.kanbanlabel {
643 background: var(--colorbacktitle1);
644 padding: 5px;
645 margin-bottom: 10px;
646 border-radius: 5px;
647}
648.kanban .box-flex-item {
649 line-height: 1.4em;
650}
651.kanban .box-flex-item-5lines {
652 line-height: 1.2em;
653}
654
655/* css for small kanban */
656.box-flex-item-small {
657 width: 200px !important;
658}
659.box-flex-item-small .info-box-sm .info-box-content {
660 margin-left: 0;
661}
662.box-flex-item-small .info-box-icon.bg-infobox-action {
663 display: none;
664}
665
666
667.info-box-title {
668 width: calc(100% - 20px);
669}
670.info-box-module {
671 min-width: 350px;
672 max-width: 350px;
673}
674.fright {
675 float:right;
676}
677@media only screen and (max-width: 1740px) {
678 .info-box-module {
679 min-width: 315px;
680 max-width: 315px;
681 }
682}
683
684@media only screen and (max-width: 768px) {
685 .info-box-module {
686 min-width: 260px;
687 }
688 .box-flex-item {
689 width: 280px;
690 }
691}
692
693@media only screen and (max-width: 570px)
694{
695 .box-flex-item {
696 margin: 3px 8px 3px 8px !important;
697 }
698}
699
700@media only screen and (max-width: 480px) {
701 .info-box-module {
702 min-width: 250px;
703 }
704 .box-flex-item {
705 width: 250px;
706 }
707}
708
709
710
711.info-box-module .info-box-content {
712 height: 98px;
713}
714/* Disabled. This break the responsive on smartphone
715.box{
716 overflow: visible;
717}
718*/
719
720@media only screen and (max-width: 768px)
721{
722 .box-flex-container {
723 margin: 0 0 0 0px !important;
724 width: 100% !important;
725 /* justify-content: space-between; */
726 }
727 .info-box-module {
728 width: 100%;
729 max-width: unset;
730 }
731
732 .info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version {
733 width: 60px;
734 }
735 .info-box-sm .info-box-icon {
736 width: 60px;
737 }
738 .info-box-sm .info-box-content {
739 margin-left: 60px;
740 }
741 .info-box {
742 border: 1px solid #e0e0e0;
743 }
744
745 .info-box-content {
746 padding-top: 5px;
747 padding-bottom: 5px;
748 padding-left: 10px;
749 padding-right: 2px;
750 }
751 /*
752 .info-box-line-text {
753 width: calc(100% - 98px);
754 max-width: calc(100% - 88px);
755 }
756 */
757}
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition propal.php:280
print $object position
Definition edit.php:206
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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
a disabled
$conf browser version
Definition main.inc.php:229