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