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