dolibarr 23.0.3
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 --butactionbg: rgb(<?php print $butactionbg; ?>);
59 --textbutaction: rgb(<?php print $textbutaction; ?>);
60}
61
62<?php
63if (getDolGlobalString('THEME_DARKMODEENABLED')) {
64 print "/* For dark mode */\n";
65 if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
66 print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
67 } else {
68 print "@media not print {";
69 }
70 print "
71 :root {
72
73 --btncolortext: ;
74 --btncolorbg: rgb(26,27,27);
75 --btncolorborderhover: #ffffff;
76 --btncolorborder: #2b2c2e;
77 --butactiondeletebg: rgb(252,84,91);
78 --butactionbg: rgb(173,140,79);
79 --textbutaction: rgb(255,255,255);
80
81 }\n";
82 print "}";
83}
84?>
85
86/* ============================================================================== */
87/* Buttons for actions */
88/* ============================================================================== */
89
90
91div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
92div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
93div.tabsAction > div.divButAction > span.butAction,
94div.tabsAction > div.divButAction > span.butActionDelete,
95div.tabsAction > div.divButAction > span.butActionRefused,
96div.tabsAction > div.divButAction > a.butAction,
97div.tabsAction > div.divButAction > a.butActionDelete,
98div.tabsAction > div.divButAction > a.butActionRefused {
99 margin-bottom: 1.4em !important;
100 margin-right: 0px !important;
101}
102div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
103 margin-bottom: 0 !important;
104}
105
106span.butAction, span.butActionDelete {
107 cursor: pointer;
108}
109
110.butAction {
111 background: var(--butactionbg);
112 color: var(--textbutaction) !important;
113 /* background: rgb(230, 232, 239); */
114}
115.butActionRefused, .butAction, .butActionDelete {
116 border-radius: 3px;
117}
118:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
119 margin-<?php echo $right; ?>: 0px !important;
120}
121.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
122 text-decoration: none;
123 text-transform: uppercase;
124 font-weight: bold;
125 line-height: 1.8em;
126
127 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
128 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
129 font-family: <?php print $fontlist ?>;
130 display: inline-block;
131 text-align: center;
132 cursor: pointer;
133 color: #444;
134
135 /* border: 1px solid #aaa; */
136 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
137
138 /*border-top-right-radius: 0 !important;
139 border-bottom-right-radius: 0 !important;
140 border-top-left-radius: 0 !important;
141 border-bottom-left-radius: 0 !important;*/
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.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
263 background: var(--butactiondeletebg);
264 color: #633 !important;
265}
266
267.butActionDelete:hover {
268 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
269}
270
271.butActionRefused {
272 text-decoration: none !important;
273 text-transform: uppercase;
274 font-weight: bold !important;
275
276 white-space: nowrap !important;
277 cursor: not-allowed !important;
278 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
279 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
280 font-family: <?php print $fontlist ?> !important;
281 display: inline-block;
282 text-align: center;
283 cursor: pointer;
284 color: #999 !important;
285
286 border: 1px solid #ccc;
287 box-sizing: border-box;
288 -moz-box-sizing: border-box;
289 -webkit-box-sizing: border-box;
290}
291.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
292 text-decoration: none !important;
293 text-transform: uppercase;
294 font-weight: normal !important;
295
296 white-space: nowrap !important;
297 cursor: not-allowed !important;
298 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
299 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
300 font-family: <?php print $fontlist ?> !important;
301 display: inline-block;
302 /* text-align: center; New button are on right of screen */
303 cursor: pointer;
304 color: #999 !important;
305 padding-top: 0.2em;
306 box-shadow: none !important;
307}
308
309.butActionTransparent {
310 color: #222 ! important;
311 background-color: transparent ! important;
312}
313
314.butActionLogin {
315 background-color: rgb(<?php echo $colorbackhmenu1; ?>);
316}
317
318
319/*
320TITLE BUTTON
321 */
322
323div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
324table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
325table.table-fiche-title tr.titre td.col-right a.btnTitle {
326 margin-<?php echo $left; ?>: 10px;
327}
328
329.btnTitle, a.btnTitle {
330 display: inline-block;
331 padding: 4px 12px;
332 font-size: 14px;
333 font-weight: 400;
334 line-height: 1.4;
335 text-align: center;
336 white-space: nowrap;
337 vertical-align: middle;
338 -ms-touch-action: manipulation;
339 touch-action: manipulation;
340 cursor: pointer;
341 -webkit-user-select: none;
342 -moz-user-select: none;
343 -ms-user-select: none;
344 user-select: none;
345 box-shadow: none;
346 text-decoration: none;
347 position: relative;
348 margin: 0 0 0 10px;
349 text-align: center;
350 color: var(--btncolortext);
351 border: none;
352 font-size: 12px;
353 font-weight: 300;
354 /* background-color: #fbfbfb; */
355}
356/* *:not(.paginationafterarrows) > .btnTitle, *:not(.paginationafterarrows) > a.btnTitle { */
357.btnTitle, a.btnTitle {
358 min-width: 60px;
359}
360
361a.btnTitle.btnTitleSelected {
362 border: 1px solid #ccc;
363 border-radius: 3px;
364}
365
366.btnTitle > .btnTitle-icon{
367
368}
369
370.btnTitle > .btnTitle-label{
371 color: #666666;
372}
373
374.btnTitle:hover, a.btnTitle:hover {
375 border-radius: 3px;
376 position: relative;
377 margin: 0 0 0 10px;
378 text-align: center;
379 color: #000;
380 background-color: #eee;
381 font-size: 12px;
382 text-decoration: none;
383 box-shadow: none;
384}
385
386.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
387 color: #8a8a8a;
388 cursor: not-allowed;
389 background-color: #fbfbfb;
390 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
391}
392
393.btnTitle:hover .btnTitle-label{
394 color:var(--btncolorborderhover);
395}
396div.pagination .btnTitle:hover .btnTitle-label{
397 color: rgb(<?php print $colortextlink; ?>);
398}
399
400.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
401 color: #8a8a8a;
402}
403
404.btnTitle>.fa {
405 font-size: 2em;
406 display: block;
407}
408
409.paginationafterarrows a.btnTitlePlus, .titre_right a.btnTitlePlus {
410 /* border: 1px solid var(--btncolorborder); */
411 border: unset;
412 background-color: unset;
413}
414.paginationafterarrows a.btnTitlePlus:hover, .titre_right a.btnTitlePlus:hover {
415 border-color: #ddd;
416}
417
418/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
419.btnTitlePlus:hover {
420 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
421 max-height: 42px;
422}
423
424/* nboftopmenuentries = <?php echo $nbtopmenuentries ?> ?> */
425/* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */
426@media only screen and (max-width: <?php echo getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC1', round($nbtopmenuentries * 90, 0) + 340); ?>px) /* reduction 1 */
427{
428 .btnTitle, a.btnTitle {
429 min-width: 40px;
430 }
431}
432
433/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
434@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 */
435{
436 .butAction, .butActionRefused, .butActionDelete {
437 font-size: 0.95em;
438 }
439}
440
441/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
442@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 */
443{
444 .butAction, .butActionRefused, .butActionDelete {
445 font-size: 0.9em;
446 }
447}
448
449/* smartphone */
450@media only screen and (max-width: 767px)
451{
452 .butAction, .butActionRefused, .butActionDelete {
453 font-size: 0.85em;
454 }
455
456 /* for small screen, we reduce the min with of button */
457 .btnTitle, a.btnTitle {
458 display: inline-block;
459 padding: 4px 4px 4px 4px;
460 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 */
461 }
462 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
463 font-size: unset !important;
464 }
465}
466
467
468<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
469.butActionRefused, .butActionNewRefused, .btnTitle.refused {
470 display: none !important;
471}
472<?php } ?>
473
474
475/*
476 * BTN LINK
477 */
478
479.btn-link{
480 margin-right: 5px;
481 border: 1px solid #ddd;
482 color: #333;
483 padding: 5px 10px;
484 border-radius:1em;
485 text-decoration: none !important;
486}
487
488.btn-link:hover{
489 background-color: #ddd;
490 border: 1px solid #ddd;
491}
492
493
494
495/*
496 * BUTTON With Low emphasis
497 */
498
499button.btn-low-emphasis{
500 text-align: center;
501 display: inline-block;
502 border: none;
503 outline: none;
504 cursor: pointer;
505 margin: 0;
506 padding: 0;
507 width: auto;
508 min-width: 1.5em;
509 min-height: 1.5em;
510 line-height: 1.5em;
511
512 overflow: visible;
513 background: transparent;
514 background-position: center; /* used for hover ripple effect */
515 background-size: 0%;
516 color: var(--colortextlink, inherit);
517 font: inherit;
518 line-height: normal;
519
520 /* Corrects font smoothing for webkit */
521 -webkit-font-smoothing: inherit;
522 -moz-osx-font-smoothing: inherit;
523
524 /* Corrects inability to style clickable input types in iOS */
525 -webkit-appearance: none;
526
527
528 transition: background 0.8s;/* used for hover ripple effect */
529 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
530}
531
532button.btn-low-emphasis.--btn-icon{
533 border-radius: 100%;
534}
535
536button.btn-low-emphasis :is(.fa, .fas){
537 color: var(--colortextlink, inherit);
538 opacity: 0.4;
539}
540
541button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
542 opacity: 0.8;
543}
544
545button.btn-low-emphasis.--btn-icon:active {
546 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
547 background-size: 100%;
548 transition: background 0s;/* used for hover ripple effect */
549}
print $object position
Definition edit.php:207
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:77
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:129