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