dolibarr 22.0.5
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 */
5if (!defined('ISLOADEDBYSTEELSHEET')) {
6 die('Must be call by steelsheet');
7}
22'
23@phan-var-force string $butactionbg
24@phan-var-force string $colortextlink
25@phan-var-force int $dol_optimize_smallscreen
26@phan-var-force string $fontlist
27@phan-var-force string $fontsize
28@phan-var-force string $left
29@phan-var-force int $nbtopmenuentries
30@phan-var-force string $right
31@phan-var-force string $textbutaction
32@phan-var-force int<0,max> $nbtopmenuentries
33';
34?>
35
36/* IDE Hack <style type="text/css"> */
37
38:root {
39 --btncolortext:rgb(<?php print $colortextlink; ?>);
40 --btncolorbg: #fbfbfb;
41 --btncolorborderhover: none;
42 --btncolorborder: #FFF;
43 --butactiondeletebg: rgb(234,228,225);
44 --butactionbg: rgb(<?php print $butactionbg; ?>);
45 --textbutaction: rgb(<?php print $textbutaction; ?>);
46}
47
48<?php
49if (getDolGlobalString('THEME_DARKMODEENABLED')) {
50 print "/* For dark mode */\n";
51 if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
52 print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
53 } else {
54 print "@media not print {";
55 }
56 print "
57 :root {
58
59 --btncolortext: ;
60 --btncolorbg: rgb(26,27,27);
61 --btncolorborderhover: #ffffff;
62 --btncolorborder: #2b2c2e;
63 --butactiondeletebg: rgb(252,84,91);
64 --butactionbg: rgb(173,140,79);
65 --textbutaction: rgb(255,255,255);
66
67 }\n";
68 print "}";
69}
70?>
71
72/* ============================================================================== */
73/* Buttons for actions */
74/* ============================================================================== */
75
76
77div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
78div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
79div.tabsAction > div.divButAction > span.butAction,
80div.tabsAction > div.divButAction > span.butActionDelete,
81div.tabsAction > div.divButAction > span.butActionRefused,
82div.tabsAction > div.divButAction > a.butAction,
83div.tabsAction > div.divButAction > a.butActionDelete,
84div.tabsAction > div.divButAction > a.butActionRefused,
85div.tabsAction > .dropdown > .dropdown-toggle {
86 margin-bottom: 1.4em !important;
87 margin-right: 0px !important;
88}
89div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
90 margin-bottom: 0 !important;
91}
92
93span.butAction, span.butActionDelete {
94 cursor: pointer;
95}
96
97.butAction {
98 background: var(--butactionbg);
99 color: var(--textbutaction) !important;
100 /* background: rgb(230, 232, 239); */
101}
102.butActionRefused, .butAction, .butActionDelete {
103 border-radius: 3px;
104}
105:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
106 margin-<?php echo $right; ?>: 0px !important;
107}
108.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
109 text-decoration: none;
110 text-transform: uppercase;
111 font-weight: bold;
112 line-height: 1.8em;
113
114 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
115 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
116 font-family: <?php print $fontlist ?>;
117 display: inline-block;
118 text-align: center;
119 cursor: pointer;
120 color: #444;
121
122 /* border: 1px solid #aaa; */
123 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
124
125 /*border-top-right-radius: 0 !important;
126 border-bottom-right-radius: 0 !important;
127 border-top-left-radius: 0 !important;
128 border-bottom-left-radius: 0 !important;*/
129}
130.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
131 text-decoration: none;
132 text-transform: uppercase;
133 font-weight: normal;
134
135 margin: 0em 0.3em 0 0.3em !important;
136 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
137 font-family: <?php print $fontlist ?>;
138 display: inline-block;
139 /* text-align: center; New button are on right of screen */
140 cursor: pointer;
141}
142
143.button {
144 border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
145 display: inline-block;
146 padding: 0.4em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
147 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
148 line-height: 20px;
149 text-align: center;
150 vertical-align: middle;
151 cursor: pointer;
152 color: #333333 !important;
153 text-decoration: none !important;
154 text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
155 background-color: #f5f5f5;
156 background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
157 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
158 background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
159 background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
160 background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
161 background-repeat: repeat-x;
162 border-color: #e6e6e6 #e6e6e6 #bfbfbf;
163 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
164 border: 1px solid #bbbbbb;
165 border-bottom-color: #a2a2a2;
166 border-radius: 2px;
167 box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
168}
169.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
170 text-decoration: none;
171 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
172 display: inline-block;
173 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
174 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
175 line-height: 20px;
176 /* text-align: center; New button are on right of screen */
177 vertical-align: middle;
178 cursor: pointer;
179 border-radius: 2px;
180}
181a.butActionNew>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
182a.butActionNewRefused>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
183
184.tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
185.tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
186span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
187a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
188span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
189a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
190span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
191a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
192span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
193{
194 font-size: 1em;
195 padding-left: 0px;
196}
197
198.button {
199 color: #ffffff !important;
200 text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
201 background-color: #006dcc;
202 background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
203 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
204 background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
205 background-image: -o-linear-gradient(top, #0088cc, #0044cc);
206 background-image: linear-gradient(to bottom, #0088cc, #0044cc);
207 background-repeat: repeat-x;
208 border-color: #0044cc #0044cc #002a80;
209 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
210}
212 color: #666 !important;
213 text-shadow: none;
214 border-color: #555;
215 cursor: not-allowed;
216
217 background-color: #f5f5f5;
218 background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
219 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
220 background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
221 background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
222 background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
223 background-repeat: repeat-x
224}
225
226button.ui-button {
227 padding-top: 5px;
228}
229
230a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
231span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
232a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
233span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
234{
235 padding-<?php echo $left; ?>: 6px;
236 font-size: 1.5em;
237 border: none;
238 box-shadow: none;
239}
240
241.butAction:hover {
242 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), inset 0px 0px 200px rgba(60,60,60,0.1);
243}
244.butActionNew:hover {
245 text-decoration: underline;
246 box-shadow: unset !important;
247}
248
249.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
250 background: var(--butactiondeletebg);
251 /* border: 1px solid #633; */
252 color: #633;
253 /* vertical-align: middle; */
254}
255
256.butActionDelete:hover {
257 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
258}
259
260.butActionRefused {
261 text-decoration: none !important;
262 text-transform: uppercase;
263 font-weight: bold !important;
264
265 white-space: nowrap !important;
266 cursor: not-allowed !important;
267 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
268 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
269 font-family: <?php print $fontlist ?> !important;
270 display: inline-block;
271 text-align: center;
272 cursor: pointer;
273 color: #999 !important;
274
275 border: 1px solid #ccc;
276 box-sizing: border-box;
277 -moz-box-sizing: border-box;
278 -webkit-box-sizing: border-box;
279}
280.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
281 text-decoration: none !important;
282 text-transform: uppercase;
283 font-weight: normal !important;
284
285 white-space: nowrap !important;
286 cursor: not-allowed !important;
287 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
288 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
289 font-family: <?php print $fontlist ?> !important;
290 display: inline-block;
291 /* text-align: center; New button are on right of screen */
292 cursor: pointer;
293 color: #999 !important;
294 padding-top: 0.2em;
295 box-shadow: none !important;
296}
297
298.butActionTransparent {
299 color: #222 ! important;
300 background-color: transparent ! important;
301}
302
303
304/*
305TITLE BUTTON
306 */
307
308div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
309table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
310table.table-fiche-title tr.titre td.col-right a.btnTitle {
311 margin-<?php echo $left; ?>: 10px;
312}
313
314.btnTitle, a.btnTitle {
315 display: inline-block;
316 padding: 4px 12px;
317 font-size: 14px;
318 font-weight: 400;
319 line-height: 1.4;
320 text-align: center;
321 white-space: nowrap;
322 vertical-align: middle;
323 -ms-touch-action: manipulation;
324 touch-action: manipulation;
325 cursor: pointer;
326 -webkit-user-select: none;
327 -moz-user-select: none;
328 -ms-user-select: none;
329 user-select: none;
330 box-shadow: none;
331 text-decoration: none;
332 position: relative;
333 margin: 0 0 0 10px;
334 text-align: center;
335 color: var(--btncolortext);
336 border: none;
337 font-size: 12px;
338 font-weight: 300;
339 /* background-color: #fbfbfb; */
340}
341/* *:not(.paginationafterarrows) > .btnTitle, *:not(.paginationafterarrows) > a.btnTitle { */
342.btnTitle, a.btnTitle {
343 min-width: 60px;
344}
345
346a.btnTitle.btnTitleSelected {
347 border: 1px solid #ccc;
348 border-radius: 3px;
349}
350
351.btnTitle > .btnTitle-icon{
352
353}
354
355.btnTitle > .btnTitle-label{
356 color: #666666;
357}
358
359.btnTitle:hover, a.btnTitle:hover {
360 border-radius: 3px;
361 position: relative;
362 margin: 0 0 0 10px;
363 text-align: center;
364 color: #000;
365 background-color: #eee;
366 font-size: 12px;
367 text-decoration: none;
368 box-shadow: none;
369}
370
371.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
372 color: #8a8a8a;
373 cursor: not-allowed;
374 background-color: #fbfbfb;
375 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
376}
377
378.btnTitle:hover .btnTitle-label{
379 color:var(--btncolorborderhover);
380}
381div.pagination .btnTitle:hover .btnTitle-label{
382 color: rgb(<?php print $colortextlink; ?>);
383}
384
385.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
386 color: #8a8a8a;
387}
388
389.btnTitle>.fa {
390 font-size: 2em;
391 display: block;
392}
393
394.paginationafterarrows a.btnTitlePlus, .titre_right a.btnTitlePlus {
395 /* border: 1px solid var(--btncolorborder); */
396 border: unset;
397 background-color: unset;
398}
399.paginationafterarrows a.btnTitlePlus:hover, .titre_right a.btnTitlePlus:hover {
400 border-color: #ddd;
401}
402
403/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
404.btnTitlePlus:hover {
405 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
406 max-height: 42px;
407}
408
409/* nboftopmenuentries = <?php echo $nbtopmenuentries ?> ?> */
410/* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */
411@media only screen and (max-width: <?php echo getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC1', round($nbtopmenuentries * 90, 0) + 340); ?>px) /* reduction 1 */
412{
413 .btnTitle, a.btnTitle {
414 min-width: 40px;
415 }
416}
417
418/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
419@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 */
420{
421 .butAction, .butActionRefused, .butActionDelete {
422 font-size: 0.95em;
423 }
424}
425
426/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
427@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 */
428{
429 .butAction, .butActionRefused, .butActionDelete {
430 font-size: 0.9em;
431 }
432}
433
434/* smartphone */
435@media only screen and (max-width: 767px)
436{
437 .butAction, .butActionRefused, .butActionDelete {
438 font-size: 0.85em;
439 }
440
441 /* for small screen, we reduce the min with of button */
442 .btnTitle, a.btnTitle {
443 display: inline-block;
444 padding: 4px 4px 4px 4px;
445 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 */
446 }
447 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
448 font-size: unset !important;
449 }
450}
451
452
453<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
454.butActionRefused, .butActionNewRefused, .btnTitle.refused {
455 display: none !important;
456}
457<?php } ?>
458
459
460/*
461 * BTN LINK
462 */
463
464.btn-link{
465 margin-right: 5px;
466 border: 1px solid #ddd;
467 color: #333;
468 padding: 5px 10px;
469 border-radius:1em;
470 text-decoration: none !important;
471}
472
473.btn-link:hover{
474 background-color: #ddd;
475 border: 1px solid #ddd;
476}
477
478
479
480/*
481 * BUTTON With Low emphasis
482 */
483
484button.btn-low-emphasis{
485 text-align: center;
486 display: inline-block;
487 border: none;
488 outline: none;
489 cursor: pointer;
490 margin: 0;
491 padding: 0;
492 width: auto;
493 min-width: 1.5em;
494 min-height: 1.5em;
495 line-height: 1.5em;
496
497 overflow: visible;
498 background: transparent;
499 background-position: center; /* used for hover ripple effect */
500 background-size: 0%;
501 color: var(--colortextlink, inherit);
502 font: inherit;
503 line-height: normal;
504
505 /* Corrects font smoothing for webkit */
506 -webkit-font-smoothing: inherit;
507 -moz-osx-font-smoothing: inherit;
508
509 /* Corrects inability to style clickable input types in iOS */
510 -webkit-appearance: none;
511
512
513 transition: background 0.8s;/* used for hover ripple effect */
514 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
515}
516
517button.btn-low-emphasis.--btn-icon{
518 border-radius: 100%;
519}
520
521button.btn-low-emphasis :is(.fa, .fas){
522 color: var(--colortextlink, inherit);
523 opacity: 0.4;
524}
525
526button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
527 opacity: 0.8;
528}
529
530button.btn-low-emphasis.--btn-icon:active {
531 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
532 background-size: 100%;
533 transition: background 0s;/* used for hover ripple effect */
534}
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.
a disabled
treeview li table
No Email.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:162