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