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