dolibarr 25.0.0-alpha
btn.inc.php
1<?php
2/* Copyright (C) 2024-2025 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.butActionRefused, .butAction, .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.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
128 text-decoration: none;
129 text-transform: uppercase;
130 font-weight: bold;
131 line-height: 1.8em;
132
133 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
134 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
135 display: inline-block;
136 text-align: center;
137 cursor: pointer;
138 color: #444;
139}
140.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
141 text-decoration: none;
142 text-transform: uppercase;
143 font-weight: normal;
144
145 margin: 0em 0.3em 0 0.3em !important;
146 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
147 font-family: <?php print $fontlist ?>;
148 display: inline-block;
149 /* text-align: center; New button are on right of screen */
150 cursor: pointer;
151}
152
153.button {
154 border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
155 display: inline-block;
156 padding: 0.4em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
157 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
158 line-height: 20px;
159 text-align: center;
160 vertical-align: middle;
161 cursor: pointer;
162 color: #333333 !important;
163 text-decoration: none !important;
164 text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
165 background-color: #f5f5f5;
166 background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
167 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
168 background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
169 background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
170 background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
171 background-repeat: repeat-x;
172 border-color: #e6e6e6 #e6e6e6 #bfbfbf;
173 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
174 border: 1px solid #bbbbbb;
175 border-bottom-color: #a2a2a2;
176 border-radius: 2px;
177 box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
178}
179.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
180 text-decoration: none;
181 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
182 display: inline-block;
183 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
184 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
185 line-height: 20px;
186 /* text-align: center; New button are on right of screen */
187 vertical-align: middle;
188 cursor: pointer;
189 border-radius: 2px;
190}
191a.butActionNew>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
192a.butActionNewRefused>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
193
194.tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
195.tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
196span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
197a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
198span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
199a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
200span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
201a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
202span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
203{
204 font-size: 1em;
205 padding-left: 0px;
206}
207
208.button {
209 color: #ffffff !important;
210 text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
211 background-color: #006dcc;
212 background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
213 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
214 background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
215 background-image: -o-linear-gradient(top, #0088cc, #0044cc);
216 background-image: linear-gradient(to bottom, #0088cc, #0044cc);
217 background-repeat: repeat-x;
218 border-color: #0044cc #0044cc #002a80;
219 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
220}
222 color: #666 !important;
223 text-shadow: none;
224 border-color: #555;
225 cursor: not-allowed;
226
227 background-color: #f5f5f5;
228 background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
229 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
230 background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
231 background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
232 background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
233 background-repeat: repeat-x
234}
235
236button.ui-button {
237 padding-top: 5px;
238}
239
240a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
241span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
242a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
243span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
244{
245 padding-<?php echo $left; ?>: 6px;
246 font-size: 1.5em;
247 border: none;
248 box-shadow: none;
249}
250
251.butAction:hover {
252 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), inset 0px 0px 200px rgba(60,60,60,0.1);
253}
254.butActionNew:hover {
255 text-decoration: underline;
256 box-shadow: unset !important;
257}
258
259.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
260 background: var(--butactiondeletebg);
261 color: #633 !important;
262}
263.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) {
264 background: var(--butactioncancelbg) !important;
265 color: #888 !important;
266}
267
268.butActionDelete:hover {
269 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
270}
271.button.button-cancel:hover:not(.buttongen) {
272 box-shadow: 0px 0px 4px 1px rgba(50, 50, 50, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
273}
274
275.butActionRefused {
276 text-decoration: none !important;
277 text-transform: uppercase;
278 font-weight: bold !important;
279
280 white-space: nowrap !important;
281 cursor: not-allowed !important;
282 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
283 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
284 font-family: <?php print $fontlist ?> !important;
285 display: inline-block;
286 text-align: center;
287 cursor: pointer;
288 color: #999 !important;
289
290 border: 1px solid #ccc;
291 box-sizing: border-box;
292 -moz-box-sizing: border-box;
293 -webkit-box-sizing: border-box;
294}
295.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
296 text-decoration: none !important;
297 text-transform: uppercase;
298 font-weight: normal !important;
299
300 white-space: nowrap !important;
301 cursor: not-allowed !important;
302 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
303 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
304 font-family: <?php print $fontlist ?> !important;
305 display: inline-block;
306 /* text-align: center; New button are on right of screen */
307 cursor: pointer;
308 color: #999 !important;
309 padding-top: 0.2em;
310 box-shadow: none !important;
311}
312
313.butActionTransparent {
314 color: #222 ! important;
315 background-color: transparent ! important;
316}
317
318.butActionLogin {
319 background-color: rgb(<?php echo $colorbackhmenu1; ?>);
320}
321
322
323/*
324TITLE BUTTON
325 */
326
327div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
328table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
329table.table-fiche-title tr.titre td.col-right a.btnTitle {
330 margin-<?php echo $left; ?>: 10px;
331}
332
333.btnTitle, a.btnTitle {
334 display: inline-block;
335 padding: 4px 12px;
336 font-size: 14px;
337 font-weight: 400;
338 line-height: 1.4;
339 text-align: center;
340 white-space: nowrap;
341 vertical-align: middle;
342 -ms-touch-action: manipulation;
343 touch-action: manipulation;
344 cursor: pointer;
345 -webkit-user-select: none;
346 -moz-user-select: none;
347 -ms-user-select: none;
348 user-select: none;
349 box-shadow: none;
350 text-decoration: none;
351 position: relative;
352 margin: 0 0 0 10px;
353 text-align: center;
354 color: var(--btncolortext);
355 font-size: 12px;
356 font-weight: 300;
357 /* background-color: #fbfbfb; */
358 border: 1px solid transparent;
359}
360/* *:not(.paginationafterarrows) > .btnTitle, *:not(.paginationafterarrows) > a.btnTitle { */
361.btnTitle, a.btnTitle {
362 min-width: 60px;
363}
364
365a.btnTitle.btnTitleSelected {
366 border: 1px solid #ccc;
367 border-radius: 3px;
368}
369
370.btnTitle > .btnTitle-icon{
371
372}
373
374.btnTitle > .btnTitle-label{
375 color: #666666;
376}
377
378.btnTitle:hover, a.btnTitle:hover {
379 border-radius: 3px;
380 position: relative;
381 margin: 0 0 0 10px;
382 text-align: center;
383 color: #000;
384 background-color: #eee;
385 font-size: 12px;
386 text-decoration: none;
387 box-shadow: none;
388}
389
390.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
391 color: #8a8a8a;
392 cursor: not-allowed;
393 background-color: #fbfbfb;
394 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
395}
396
397.btnTitle:hover .btnTitle-label{
398 color:var(--btncolorborderhover);
399}
400div.pagination .btnTitle:hover .btnTitle-label{
401 color: rgb(<?php print $colortextlink; ?>);
402}
403
404.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
405 color: #8a8a8a;
406}
407
408.btnTitle>.fa {
409 font-size: 2em;
410 display: block;
411}
412
413.paginationafterarrows a.btnTitlePlus, .titre_right a.btnTitlePlus {
414 /* border: 1px solid var(--btncolorborder); */
415 border: unset;
416 background-color: unset;
417}
418.paginationafterarrows a.btnTitlePlus:hover, .titre_right a.btnTitlePlus:hover {
419 border-color: #ddd;
420}
421
422/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
423.btnTitlePlus:hover {
424 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
425 max-height: 42px;
426}
427
428/* nboftopmenuentries = <?php echo $nbtopmenuentries ?> ?> */
429/* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */
430@media only screen and (max-width: <?php echo getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC1', round($nbtopmenuentries * 90, 0) + 340); ?>px) /* reduction 1 */
431{
432 .btnTitle, a.btnTitle {
433 min-width: 40px;
434 }
435}
436
437/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
438@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 */
439{
440 .butAction, .butActionRefused, .butActionDelete {
441 font-size: 0.95em;
442 }
443}
444
445/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
446@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 */
447{
448 .butAction, .butActionRefused, .butActionDelete {
449 font-size: 0.9em;
450 }
451}
452
453/* smartphone */
454@media only screen and (max-width: 767px)
455{
456 .butAction, .butActionRefused, .butActionDelete {
457 font-size: 0.85em;
458 }
459
460 /* for small screen, we reduce the min with of button */
461 .btnTitle, a.btnTitle {
462 display: inline-block;
463 padding: 4px 4px 4px 4px;
464 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 */
465 }
466 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
467 font-size: unset !important;
468 }
469}
470
471
472<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
473.butActionRefused, .butActionNewRefused, .btnTitle.refused {
474 display: none !important;
475}
476<?php } ?>
477
478
479/*
480 * BTN LINK
481 */
482
483.btn-link{
484 margin-right: 5px;
485 border: 1px solid #ddd;
486 color: #333;
487 padding: 5px 10px;
488 border-radius:1em;
489 text-decoration: none !important;
490}
491
492.btn-link:hover{
493 background-color: #ddd;
494 border: 1px solid #ddd;
495}
496
497
498
499/*
500 * BUTTON With Low emphasis
501 */
502
503button.btn-low-emphasis{
504 text-align: center;
505 display: inline-block;
506 border: none;
507 outline: none;
508 cursor: pointer;
509 margin: 0;
510 padding: 0;
511 width: auto;
512 min-width: 1.5em;
513 min-height: 1.5em;
514 line-height: 1.5em;
515
516 overflow: visible;
517 background: transparent;
518 background-position: center; /* used for hover ripple effect */
519 background-size: 0%;
520 color: var(--colortextlink, inherit);
521 font: inherit;
522 line-height: normal;
523
524 /* Corrects font smoothing for webkit */
525 -webkit-font-smoothing: inherit;
526 -moz-osx-font-smoothing: inherit;
527
528 /* Corrects inability to style clickable input types in iOS */
529 -webkit-appearance: none;
530
531
532 transition: background 0.8s;/* used for hover ripple effect */
533 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
534}
535
536button.btn-low-emphasis.--btn-icon{
537 border-radius: 100%;
538}
539
540button.btn-low-emphasis :is(.fa, .fas){
541 color: var(--colortextlink, inherit);
542 opacity: 0.4;
543}
544
545button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
546 opacity: 0.8;
547}
548
549button.btn-low-emphasis.--btn-icon:active {
550 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
551 background-size: 100%;
552 transition: background 0s;/* used for hover ripple effect */
553}
554
555
556input.button-save, input.button-cancel {
557 min-width: 110px;
558 margin-left: 8px !important;
559 margin-right: 8px !important;
560}
561
562/* smartphone */
563
564@media only screen and (max-width: 767px)
565{
566 input.button-save, input.button-cancel {
567 min-width: 90px;
568 margin-left: 4px !important;
569 margin-right: 4px !important;
570 }
571}
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:134