dolibarr 25.0.0-alpha
btn.inc.php
1<?php
2/* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
3 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18if (!defined('ISLOADEDBYSTEELSHEET')) {
19 die('Must be call by steelsheet');
20}
36'
37@phan-var-force string $butactionbg
38@phan-var-force string $colorbackhmenu1
39@phan-var-force string $colortextlink
40@phan-var-force int<0,1> $dol_optimize_smallscreen
41@phan-var-force string $fontlist
42@phan-var-force string $fontsize
43@phan-var-force string $left
44@phan-var-force int<0,max> $nbtopmenuentries
45@phan-var-force string $right
46@phan-var-force string $textbutaction
47';
48?>
49
50/* IDE Hack <style type="text/css"> */
51
52:root {
53 --btncolortext:rgb(<?php print $colortextlink; ?>);
54 --btncolorbg: #fbfbfb;
55 --btncolorborderhover: none;
56 --btncolorborder: #FFF;
57 --butactiondeletebg: rgb(234,228,225);
58 --butactioncancelbg: #bbb;
59 --butactionbg: rgb(<?php print $butactionbg; ?>);
60 --textbutaction: rgb(<?php print $textbutaction; ?>);
61}
62
63<?php
64if (getDolGlobalString('THEME_DARKMODEENABLED')) {
65 print "/* For dark mode */\n";
66 if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
67 print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
68 } else {
69 print "@media not print {";
70 }
71 print "
72 :root {
73
74 --btncolortext: ;
75 --btncolorbg: rgb(26,27,27);
76 --btncolorborderhover: #ffffff;
77 --btncolorborder: #2b2c2e;
78 --butactiondeletebg: rgb(252,84,91);
79 --butactioncancelbg: #888;
80 --butactionbg: rgb(173,140,79);
81 --textbutaction: rgb(255,255,255);
82
83 }\n";
84 print "}";
85}
86?>
87
88/* ============================================================================== */
89/* Buttons for actions */
90/* ============================================================================== */
91
92
93div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
94div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
95div.tabsAction > div.divButAction > span.butAction,
96div.tabsAction > div.divButAction > span.butActionDelete,
97div.tabsAction > div.divButAction > span.butActionRefused,
98div.tabsAction > div.divButAction > a.butAction,
99div.tabsAction > div.divButAction > a.butActionDelete,
100div.tabsAction > div.divButAction > a.butActionRefused,
101div.tabsAction > .dropdown > .dropdown-toggle {
102 margin-bottom: 1.4em !important;
103 margin-right: 0px !important;
104}
105div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
106 margin-bottom: 0 !important;
107}
108
109span.butAction, span.butActionDelete {
110 cursor: pointer;
111}
112.paginationafterarrows .butAction {
113 font-size: 0.9em;
114}
115
116.butAction {
117 background: var(--butactionbg);
118 color: var(--textbutaction) !important;
119 /* background: rgb(230, 232, 239); */
120}
121.butAction, .butActionRefused, .butActionDelete {
122 border-radius: 3px;
123}
124:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
125 margin-<?php echo $right; ?>: 0px !important;
126}
127.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active,
128.butActionRefused,
129.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
130 text-decoration: none;
131 text-transform: uppercase;
132 font-weight: bold;
133 /* line-height: 1.8em; */
134
135 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
136 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
137 display: inline-block;
138 text-align: center;
139 cursor: pointer;
140 color: #444;
141 min-width: 40px;
142}
143.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
144 text-decoration: none;
145 text-transform: uppercase;
146 font-weight: normal;
147
148 margin: 0em 0.3em 0 0.3em !important;
149 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
150 font-family: <?php print $fontlist ?>;
151 display: inline-block;
152 /* text-align: center; New button are on right of screen */
153 cursor: pointer;
154}
155
156.button {
157 border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
158 display: inline-block;
159 padding: 0.4em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
160 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
161 line-height: 20px;
162 text-align: center;
163 vertical-align: middle;
164 cursor: pointer;
165 color: #333333 !important;
166 text-decoration: none !important;
167 text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
168 background-color: #f5f5f5;
169 background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
170 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
171 background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
172 background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
173 background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
174 background-repeat: repeat-x;
175 border-color: #e6e6e6 #e6e6e6 #bfbfbf;
176 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
177 border: 1px solid #bbbbbb;
178 border-bottom-color: #a2a2a2;
179 border-radius: 2px;
180 box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
181}
182.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
183 text-decoration: none;
184 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
185 display: inline-block;
186 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
187 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
188 line-height: 20px;
189 /* text-align: center; New button are on right of screen */
190 vertical-align: middle;
191 cursor: pointer;
192 border-radius: 2px;
193}
194a.butActionNew>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
195a.butActionNewRefused>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
196
197.tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
198.tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
199span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
200a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
201span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
202a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
203span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
204a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
205span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
206{
207 font-size: 1em;
208 padding-left: 0px;
209}
210
211.button {
212 color: #ffffff !important;
213 text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
214 background-color: #006dcc;
215 background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
216 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
217 background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
218 background-image: -o-linear-gradient(top, #0088cc, #0044cc);
219 background-image: linear-gradient(to bottom, #0088cc, #0044cc);
220 background-repeat: repeat-x;
221 border-color: #0044cc #0044cc #002a80;
222 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
223}
225 color: #666 !important;
226 text-shadow: none;
227 border-color: #555;
228 cursor: not-allowed;
229
230 background-color: #f5f5f5;
231 background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
232 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
233 background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
234 background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
235 background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
236 background-repeat: repeat-x
237}
238
239button.ui-button {
240 padding-top: 5px;
241}
242
243a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
244span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
245a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
246span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
247{
248 padding-<?php echo $left; ?>: 6px;
249 font-size: 1.5em;
250 border: none;
251 box-shadow: none;
252}
253
254.butAction:hover {
255 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), inset 0px 0px 200px rgba(60,60,60,0.1);
256}
257.butActionNew:hover {
258 text-decoration: underline;
259 box-shadow: unset !important;
260}
261
262.butActionDanger, .butActionDanger:link, .butActionDanger:visited, .butActionDanger:hover, .butActionDanger:active, .buttonDanger {
263 background: var(--butactiondeletebg);
264 color: #633 !important;
265}
266
267.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
268 background: var(--butactiondeletebg);
269 color: #633 !important;
270}
271.button.button-cancel:not(.buttongen), .button.button-cancel:link:not(.buttongen), .button.button-cancel:visited:not(.buttongen), .button.button-cancel:hover:not(.buttongen), .button.button-cancel:active:not(.buttongen), .button.button-cancel:not(.buttongen) {
272 background: var(--butactioncancelbg) !important;
273 color: #888 !important;
274}
275
276.butActionDelete:hover {
277 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
278}
279.button.button-cancel:hover:not(.buttongen) {
280 box-shadow: 0px 0px 4px 1px rgba(50, 50, 50, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
281}
282
283/* Button Clone */
284#action-clone .textbutton, .butAction.butActionClone .textbutton {
285 font-size: 0;
286 display: inline-block;
287}
288#action-clone .textbutton::before, .butAction.butActionClone .textbutton::before {
289 content: "\f24d"; /* fa-clone */
290 font-family: "Font Awesome 5 Free";
291 font-weight: 900; /* required for the "solid" version */
292 font-size: 14px; /* using 1em does not work */
293 /* vertical-align: middle; */
294}
295
296/* Button Delete */
297#action-delete .textbutton, .butAction.butActionDelete .textbutton {
298 font-size: 0;
299 display: inline-block;
300}
301#action-delete .textbutton::before, .butAction.butActionDelete .textbutton::before {
302 content: "\f1f8"; /* fa-trash */
303 font-family: "Font Awesome 5 Free";
304 font-weight: 900; /* required for the "solid" version */
305 font-size: 14px; /* using 1em does not work */
306}
307
308.butActionRefused {
309 text-decoration: none !important;
310 text-transform: uppercase;
311 font-weight: bold !important;
312
313 white-space: nowrap !important;
314 cursor: not-allowed !important;
315 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
316 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
317 font-family: <?php print $fontlist ?> !important;
318 display: inline-block;
319 text-align: center;
320 cursor: pointer;
321 color: #999 !important;
322
323 border: 1px solid #ccc;
324 box-sizing: border-box;
325 -moz-box-sizing: border-box;
326 -webkit-box-sizing: border-box;
327}
328.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
329 text-decoration: none !important;
330 text-transform: uppercase;
331 font-weight: normal !important;
332
333 white-space: nowrap !important;
334 cursor: not-allowed !important;
335 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
336 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
337 font-family: <?php print $fontlist ?> !important;
338 display: inline-block;
339 /* text-align: center; New button are on right of screen */
340 cursor: pointer;
341 color: #999 !important;
342 padding-top: 0.2em;
343 box-shadow: none !important;
344}
345
346.butActionTransparent {
347 color: #222 ! important;
348 background-color: transparent ! important;
349}
350
351.butActionLogin {
352 background-color: var(--butactionbg);
353}
354
355
356/*
357TITLE BUTTON
358 */
359
360div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
361table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
362table.table-fiche-title tr.titre td.col-right a.btnTitle {
363 margin-<?php echo $left; ?>: 10px;
364}
365
366.btnTitle, a.btnTitle {
367 display: inline-block;
368 padding: 4px 12px;
369 font-size: 14px;
370 font-weight: 400;
371 line-height: 1.4;
372 text-align: center;
373 white-space: nowrap;
374 vertical-align: middle;
375 -ms-touch-action: manipulation;
376 touch-action: manipulation;
377 cursor: pointer;
378 -webkit-user-select: none;
379 -moz-user-select: none;
380 -ms-user-select: none;
381 user-select: none;
382 box-shadow: none;
383 text-decoration: none;
384 position: relative;
385 margin: 0 0 0 10px;
386 text-align: center;
387 color: var(--btncolortext);
388 font-size: 12px;
389 font-weight: 300;
390 /* background-color: #fbfbfb; */
391 border: 1px solid transparent;
392}
393/* *:not(.paginationafterarrows) > .btnTitle, *:not(.paginationafterarrows) > a.btnTitle { */
394.btnTitle, a.btnTitle {
395 min-width: 60px;
396}
397
398a.btnTitle.btnTitleSelected {
399 border: 1px solid #ccc;
400 border-radius: 3px;
401}
402
403.btnTitle > .btnTitle-icon{
404
405}
406
407.btnTitle > .btnTitle-label{
408 color: #666666;
409}
410
411.btnTitle:hover, a.btnTitle:hover {
412 border-radius: 3px;
413 position: relative;
414 margin: 0 0 0 10px;
415 text-align: center;
416 color: #000;
417 background-color: #eee;
418 font-size: 12px;
419 text-decoration: none;
420 box-shadow: none;
421}
422
423.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
424 color: #8a8a8a;
425 cursor: not-allowed;
426 background-color: #fbfbfb;
427 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
428}
429
430.btnTitle:hover .btnTitle-label{
431 color:var(--btncolorborderhover);
432}
433div.pagination .btnTitle:hover .btnTitle-label{
434 color: rgb(<?php print $colortextlink; ?>);
435}
436
437.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
438 color: #8a8a8a;
439}
440
441.btnTitle>.fa {
442 font-size: 2em;
443 display: block;
444}
445
446.paginationafterarrows a.btnTitlePlus, .titre_right a.btnTitlePlus {
447 /* border: 1px solid var(--btncolorborder); */
448 border: unset;
449 background-color: unset;
450}
451.paginationafterarrows a.btnTitlePlus:hover, .titre_right a.btnTitlePlus:hover {
452 border-color: #ddd;
453}
454
455/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
456.btnTitlePlus:hover {
457 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
458 max-height: 42px;
459}
460
461/* nboftopmenuentries = <?php echo $nbtopmenuentries ?> ?> */
462/* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */
463@media only screen and (max-width: <?php echo getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC1', round($nbtopmenuentries * 90, 0) + 340); ?>px) /* reduction 1 */
464{
465 .btnTitle, a.btnTitle {
466 min-width: 40px;
467 }
468}
469
470/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
471@media only screen and (max-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC2') ? round($nbtopmenuentries * 69, 0) + 130 : getDolGlobalInt('THEME_ELDY_WITDHOFFSET_FOR_REDUC2'); ?>px) /* reduction 2 */
472{
473 .butAction, .butActionRefused, .butActionDelete {
474 font-size: 0.95em;
475 }
476}
477
478/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
479@media only screen and (max-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC3') ? round($nbtopmenuentries * 47, 0) + 130 : getDolGlobalInt('THEME_ELDY_WITDHOFFSET_FOR_REDUC3'); ?>px) /* reduction 3 */
480{
481 .butAction, .butActionRefused, .butActionDelete {
482 font-size: 0.9em;
483 }
484}
485
486/* smartphone */
487@media only screen and (max-width: 767px)
488{
489 .butAction, .butActionRefused, .butActionDelete {
490 font-size: 0.85em;
491 }
492
493 /* for small screen, we reduce the min with of button */
494 .btnTitle, a.btnTitle {
495 display: inline-block;
496 padding: 4px 4px 4px 4px;
497 min-width: unset; /* if we unset the min-width here, we must also unset the font-size on .paginationafterarrows a.btnTitlePlus:hover span:before to avoid page content move */
498 }
499 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
500 font-size: unset !important;
501 }
502}
503
504
505<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
506.butActionRefused, .butActionNewRefused, .btnTitle.refused {
507 display: none !important;
508}
509<?php } ?>
510
511
512/*
513 * BTN LINK
514 */
515
516.btn-link{
517 margin-right: 5px;
518 border: 1px solid #ddd;
519 color: #333;
520 padding: 5px 10px;
521 border-radius:1em;
522 text-decoration: none !important;
523}
524
525.btn-link:hover{
526 background-color: #ddd;
527 border: 1px solid #ddd;
528}
529
530
531
532/*
533 * BUTTON With Low emphasis
534 */
535
536button.btn-low-emphasis{
537 text-align: center;
538 display: inline-block;
539 border: none;
540 outline: none;
541 cursor: pointer;
542 margin: 0;
543 padding: 0;
544 width: auto;
545 min-width: 1.5em;
546 min-height: 1.5em;
547 line-height: 1.5em;
548
549 overflow: visible;
550 background: transparent;
551 background-position: center; /* used for hover ripple effect */
552 background-size: 0%;
553 color: var(--colortextlink, inherit);
554 font: inherit;
555 line-height: normal;
556
557 /* Corrects font smoothing for webkit */
558 -webkit-font-smoothing: inherit;
559 -moz-osx-font-smoothing: inherit;
560
561 /* Corrects inability to style clickable input types in iOS */
562 -webkit-appearance: none;
563
564
565 transition: background 0.8s;/* used for hover ripple effect */
566 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
567}
568
569button.btn-low-emphasis.--btn-icon{
570 border-radius: 100%;
571}
572
573button.btn-low-emphasis :is(.fa, .fas){
574 color: var(--colortextlink, inherit);
575 opacity: 0.4;
576}
577
578button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
579 opacity: 0.8;
580}
581
582button.btn-low-emphasis.--btn-icon:active {
583 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
584 background-size: 100%;
585 transition: background 0s;/* used for hover ripple effect */
586}
587
588
589input.button-save, input.button-cancel {
590 min-width: 110px;
591 margin-left: 8px !important;
592 margin-right: 8px !important;
593}
594
595/* smartphone */
596
597@media only screen and (max-width: 767px)
598{
599 input.button-save, input.button-cancel {
600 min-width: 90px;
601 margin-left: 4px !important;
602 margin-right: 4px !important;
603 }
604}
print $object position
Definition edit.php:206
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
treeview li table
No Email.
a disabled
editval_textarea active
$fontlist
Definition style.css.php:75
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:141