dolibarr 24.0.0-beta
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) { ?>
49 box-shadow: -2px 1px 12px rgba(192, 192, 192, 0.5);
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: 3px; /* 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}
318
319/* Force values for small screen 480 */
320@media only screen and (max-width: 480px)
321{
322 .info-box-text {
323 font-size: 0.85em;
324 }
325 .info-box-line {
326 line-height: 1.25em;
327 }
328}
329.info-box-text:first-letter{text-transform: uppercase}
330a.info-box-text{ text-decoration: none;}
331
332
333.info-box-more {
334 display: block;
335}
336.progress-description {
337 margin: 0;
338}
339
340
341/* customize section for home box link */
342.infobox-haslink .info-box-icon i {
343 transition: opacity 0.2s ease-in-out;
344}
345.infobox-haslink .info-box-icon:hover i {
346 opacity: 0.2;
347}
348.infobox-haslink .info-box-icon .info-box-createlink {
349 height:100%;
350 width:100%;
351 display:block;
352 position:absolute;
353 top:0;
354 left:0;
355 font-size:0.6em;
356 display: flex;
357 opacity: 0;
358 transition: opacity 0.2s ease-in-out;
359 color:inherit;
360 text-decoration: none;
361}
362.infobox-haslink .info-box-icon:hover .info-box-createlink {
363 opacity: 1;
364}
365.infobox-haslink .info-box-icon .info-box-createlink span.fas {
366 margin:auto;
367}
368.infobox-haslink i.fa.fa-exclamation-triangle.hideonsmartphone {
369 display: none;
370}
371
372
373/* ICONS INFO BOX */
374<?php
375include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
376
377$prefix = '';
378if (getDolGlobalString('THEME_INFOBOX_COLOR_ON_BACKGROUND')) {
379 $prefix = 'background-';
380}
381
382if (!isset($conf->global->THEME_SATURATE_RATIO)) {
383 $conf->global->THEME_SATURATE_RATIO = 0.8;
384}
385if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
386 $conf->global->THEME_SATURATE_RATIO = GETPOSTFLOAT('THEME_SATURATE_RATIO');
387}
388
389?>
390.info-box-icon {
391 <?php if ($prefix) { ?>
392 color: #fff !important;
393 <?php } ?>
394 opacity: 0.95;
395 <?php if (getDolGlobalString('THEME_SATURATE_RATIO')) { ?>
396 filter: saturate(<?php echo getDolGlobalString('THEME_SATURATE_RATIO'); ?>);
397 <?php } ?>
398}
399
400.spannature {
401/*
402 padding-top: 6px !important;
403 padding-bottom: 6px !important;
404 vertical-align: middle;
405 white-space: nowrap;
406 display: inline-block;
407*/
408}
409
410.nonature-back {
411 background-color: #EEE;
412}
413.prospect-back {
414 background-color: #a3c0ad !important;
415 color: #FFF !important;
416}
417.customer-back {
418 background-color: #55955d !important;
419 color: #FFF !important;
420}
421.vendor-back {
422 background-color: #499caf !important;
423 color: #FFF !important;
424}
425.user-back {
426 background-color: #79633f !important;
427 color: #FFF !important;
428}
429.member-individual-back {
430 background-color: #258fa5;
431 color: #fff;
432 white-space: nowrap;
433}
434.member-company-back {
435 background-color: #557b95;
436 color: #fff;
437 white-space: nowrap;
438}
439.member-individual-company-back {
440 background-color: #40859d;
441 color: #fff;
442 white-space: nowrap;
443}
444.nonature-back, .prospect-back, .customer-back, .vendor-back, .user-back, .member-company-back, .member-individual-company-back, .member-individual-back {
445 padding: 2px;
446 margin: 2px;
447 border-radius: 5px;
448}
449
450.bg-infobox-project{
451 <?php echo $prefix; ?>color: #6c6aa8 !important;
452}
453.bg-infobox-action{
454 <?php echo $prefix; ?>color: #906080 !important;
455}
456.bg-infobox-propal, .bg-infobox-facture, .bg-infobox-commande {
457 <?php echo $prefix; ?>color: #65953d !important;
458}
459.bg-infobox-supplier_proposal, .bg-infobox-invoice_supplier, .bg-infobox-order_supplier {
460 <?php echo $prefix; ?>color: #599caf !important;
461}
462.bg-infobox-contrat, .bg-infobox-ticket{
463 <?php echo $prefix; ?>color: #3bbfa8 !important;
464}
465.bg-infobox-bank_account{
466 <?php echo $prefix; ?>color: #b0bb39 !important;
467}
468.bg-infobox-adherent, .bg-infobox-member {
469 <?php echo $prefix; ?>color: #79633f !important;
470}
471.bg-infobox-expensereport{
472 <?php echo $prefix; ?>color: #79633f !important;
473}
474.bg-infobox-holiday{
475 <?php echo $prefix; ?>color: #755114 !important;
476}
477.bg-infobox-cubes{
478 <?php echo $prefix; ?>color: #b0a53e !important;
479}
480
481/* Disable colors on left vmenu */
482a.vmenu span, span.vmenu, span.vmenu span {
483 /* To force no color on picto in left menu */
484 /* color: var(--colortextbackvmenu) !important; */
485}
486
487.infobox-adherent, .infobox-member, .infobox-expensereport {
488 color: #79633f;
489}
490.infobox-project{
491 color: #6c6aa8;
492}
493.infobox-action{
494 color: #906080;
495}
496/* Color for customer object */
497.infobox-propal:not(.error),
498.infobox-facture:not(.error),
499.infobox-commande:not(.error) {
500 color: #65953d;
501}
502/* Color for vendor object */
503.infobox-supplier_proposal:not(.error),
504.infobox-invoice_supplier:not(.error),
505.infobox-order_supplier:not(.error) {
506 color: #599caf;
507}
508.infobox-contrat, .infobox-ticket{
509 color: #3bbfa8;
510}
511.infobox-bank_account{
512 color: #b0bb39;
513}
514.infobox-holiday{
515 color: #755114;
516}
517.infobox-portal {
518 color: #304;
519}
520
521
522.fa-dol-action:before {
523 content: "\f073";
524}
525.fa-dol-propal:before,
526.fa-dol-supplier_proposal:before {
527 content: "\f573";
528}
529.fa-dol-facture:before,
530.fa-dol-invoice_supplier:before {
531 content: "\f571";
532}
533.fa-dol-project:before {
534 content: "\f542";
535}
536.fa-dol-commande:before,
537.fa-dol-order_supplier:before {
538 content: "\f570";
539}
540.fa-dol-contrat:before {
541 content: "\f0f2";
542}
543.fa-dol-ticket:before {
544 content: "\f3ff";
545}
546.fa-dol-bank_account:before {
547 content: "\f19c";
548}
549.fa-dol-member:before {
550 content: "\f007";
551}
552.fa-dol-expensereport:before {
553 content: "\f555";
554}
555.fa-dol-holiday:before {
556 content: "\f5ca";
557}
558.fa-dol-cubes:before {
559 content: "\f1b3";
560}
561
562
563/* USING FONTAWESOME FOR WEATHER */
564.info-box-weather .info-box-icon{
565 background: var(--colorbacktitle1) !important;
566}
567.fa-weather-level0:before{
568 content: "\f185";
569 color : #cfbf00;
570}
571.fa-weather-level1:before{
572 content: "\f6c4";
573 color : #bc9526;
574}
575.fa-weather-level2:before{
576 content: "\f743";
577 color : #b16000;
578}
579.fa-weather-level3:before{
580 content: "\f740";
581 color : #b04000;
582}
583.fa-weather-level4:before{
584 content: "\f0e7";
585 color : #993013;
586}
587
588
589.box-flex-container{
590 display: flex; /* or inline-flex */
591 flex-direction: row;
592 flex-wrap: wrap;
593 width: calc(100% + 14px);
594 margin: 0 -8px 0 -8px;
595 /*justify-content: space-between;*/
596}
597.box-flex-container-columns {
598 display: flex; /* or inline-flex */
599 flex-direction: row;
600 flex-wrap: nowrap;
601 justify-content: space-between;
602}
603.box-flex-container-column {
604 flex-grow: 1;
605 }
606.box-flex-container-column:not(:last-of-type) {
607 border-right: 1px solid #AAA;
608}
609.box-flex-container-column.kanban {
610 flex: 1;
611}
612.kanban.kanbancollapsed {
613 flex: unset;
614 width: 80px;
615 max-width: 80px;
616 overflow: hidden;
617}
618.kanban.kanbancollapsed .kanbanlabel, .text-vertical {
619 writing-mode: vertical-rl;
620}
621
622.box-flex-grow-zero {
623 flex-grow: 0 !important;
624}
625
626.box-flex-item {
627 flex-grow : 1;
628 flex-shrink: 1;
629 flex-basis: auto;
630 width: 290px;
631}
632.box-flex-item.filler {
633 height: 0;
634}
635.box-flex-item, .kanbanlabel {
636 margin-top: 5px;
637 margin-<?php echo $right; ?>: 20px;
638 margin-bottom: 0px;
639 margin-<?php echo $left; ?>: 10px;
640}
641.kanbanlabel {
642 background: var(--colorbacktitle1);
643 padding: 5px;
644 margin-bottom: 10px;
645 border-radius: 5px;
646}
647.kanban .box-flex-item {
648 line-height: 1.4em;
649}
650.kanban .box-flex-item-5lines {
651 line-height: 1.2em;
652}
653
654/* css for small kanban */
655.box-flex-item-small {
656 width: 200px !important;
657}
658.box-flex-item-small .info-box-sm .info-box-content {
659 margin-left: 0;
660}
661.box-flex-item-small .info-box-icon.bg-infobox-action {
662 display: none;
663}
664
665
666.info-box-title {
667 width: calc(100% - 20px);
668}
669.info-box-module {
670 min-width: 350px;
671 max-width: 350px;
672}
673.fright {
674 float:right;
675}
676@media only screen and (max-width: 1740px) {
677 .info-box-module {
678 min-width: 315px;
679 max-width: 315px;
680 }
681}
682
683@media only screen and (max-width: 768px) {
684 .info-box-module {
685 min-width: 260px;
686 }
687 .box-flex-item {
688 width: 280px;
689 }
690}
691
692@media only screen and (max-width: 570px)
693{
694 .box-flex-item {
695 margin: 3px 8px 3px 8px !important;
696 }
697}
698
699@media only screen and (max-width: 480px) {
700 .info-box-module {
701 min-width: 250px;
702 }
703 .box-flex-item {
704 width: 250px;
705 }
706}
707
708
709
710.info-box-module .info-box-content {
711 height: 98px;
712}
713/* Disabled. This break the responsive on smartphone
714.box{
715 overflow: visible;
716}
717*/
718
719@media only screen and (max-width: 768px)
720{
721 .box-flex-container {
722 margin: 0 0 0 0px !important;
723 width: 100% !important;
724 /* justify-content: space-between; */
725 }
726 .info-box-module {
727 width: 100%;
728 max-width: unset;
729 }
730
731 .info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version {
732 width: 60px;
733 }
734 .info-box-sm .info-box-icon {
735 width: 60px;
736 }
737 .info-box-sm .info-box-content {
738 margin-left: 60px;
739 }
740 .info-box {
741 border: 1px solid #e0e0e0;
742 }
743
744 .info-box-content {
745 padding-top: 5px;
746 padding-bottom: 5px;
747 padding-left: 10px;
748 padding-right: 2px;
749 }
750 /*
751 .info-box-line-text {
752 width: calc(100% - 98px);
753 max-width: calc(100% - 88px);
754 }
755 */
756}
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
a disabled
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:130