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