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